{ "cells": [ { "cell_type": "markdown", "id": "9f3fbb6a-4bf0-4cba-b955-161739b67811", "metadata": { "tags": [] }, "source": [ "

forallpeople documentation

\n", "\n", "> *\"For all time. For all people.\"*\n", "> - Nicolas de Caritat (Marquis de Condorcet), in regards to the metric system (now the SI system)" ] }, { "cell_type": "markdown", "id": "d3ba711e-0458-41f6-8635-4d4d9cebe213", "metadata": {}, "source": [ "`forallpeople` is a Python library for representing the SI base units to enable easy-to-use, units-aware calculations. In addition to the SI base units, `forallpeople` can be used to represent units which are defined by the SI unit system, such as US Customary units." ] }, { "cell_type": "markdown", "id": "f930578e-70e8-4f81-a537-1bdac33f9e2c", "metadata": {}, "source": [ "## Installation\n", "\n", "```\n", "pip install forallpeople\n", "```" ] }, { "cell_type": "markdown", "id": "66a4f401-f6c4-4014-af9c-e5d099da3b7f", "metadata": {}, "source": [ "## A Simple Example" ] }, { "cell_type": "code", "execution_count": 3, "id": "aa5ff08e-db5c-4eb1-b007-5367a5a92110", "metadata": {}, "outputs": [ { "data": { "text/html": [ "34.335 kN" ], "text/latex": [ "34.335\\ \\text{kN}" ], "text/markdown": [ "34.335 kN" ], "text/plain": [ "34.335 kN" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import forallpeople as si\n", "si.environment('default')\n", "\n", "g = 9.81 * si.m/si.s**2\n", "m = 3500 * si.kg\n", "force = m * g\n", "force" ] }, { "cell_type": "markdown", "id": "f25ec3aa-5135-4ebd-9f99-d233fba16eb6", "metadata": {}, "source": [ "## Features\n", "\n", "* Rich representations for use in Jupyter (HTML, Latex, plain-text)\n", "* Units display as conventional symbols by default\n", "* Units \"auto-reduce\" based upon the unit environment\n", "* Auto-scaling of SI derived units and base units (e.g. 1100 Hz -> 1.1 kHz)\n", "* Conversion between units defined in your environment\n", "* Custom unit environments for defining US, imperial, and derived SI unit options\n", "* Interactive imports to push unit names into the top level namespace\n", "* Immutable, hashable instances" ] }, { "cell_type": "markdown", "id": "e3d330c2-256b-4b6d-9d6e-a558463cad74", "metadata": {}, "source": [ "## Contents" ] }, { "cell_type": "markdown", "id": "caa0338c-9ab5-4c27-a446-5c2750b40009", "metadata": { "tags": [ "nbsphinx-toctree" ] }, "source": [ "- [Basic Usage](basic_usage.ipynb)\n", "- [API](interface.ipynb)\n", "- [Standard Behaviours](standard_behaviours.ipynb)\n", "- [Dimensionally-inconsistent Calculations](empiricals.ipynb)\n", "- [Customizing Environments](environments.ipynb)\n", "- [Background and Approach](background.ipynb)" ] } ], "metadata": { "kernelspec": { "display_name": "forallpeople", "language": "python", "name": "forallpeople" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.4" } }, "nbformat": 4, "nbformat_minor": 5 }