noether


Namenoether JSON
Version 1.1 PyPI version JSON
download
home_pagehttps://github.com/yunruse/noether
SummaryWork with physical measurements and constants
upload_time2023-08-02 16:49:06
maintainer
docs_urlNone
authorMia yun Ruse
requires_python>=3.10
license
keywords physics unit measure constant measurement uncertainty
VCS
bugtrack_url
requirements toml
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Noether
`523 units, 60 prefixes`

[![PyPI](https://img.shields.io/pypi/v/noether?color=blue)](https://pypi.org/packages/noether)

**Noether** is a unit-enriched Python package, akin to Wolfram Alpha or gnu `units`. It has a large (and expanding) catalogue of up-to-date units and constants, allowing code to be written directly in the units they are concerned with while also ensuring e.g. you don't mistakenly add an energy to a length.

Just grab Python 3.10 or later and `pip install noether` to run!

Development is ongoing, especially in expanding the unit catalogue and improving unit display mechanisms.

## Usage 

Noether can be used as a Python package or as a CLI:

```sh
$ alias noe='python -im noether'
$ noe marathon
marathon  # length, 42195 m, Race length based on Greek legend, set by convention from 1908 Summer Olympics
$ noether 23degC @ degF
73.4 °F  # temperature
$ noether 'horsepower @ dB(kW)'
-1.33418061 dB(kW)  # power, 0.73549875 kW
```

The CLI allows a few niceties such as slightly terser syntax, but otherwise behaves identically to Python:

```sh
$ noether 5cm @ in --value
1.9685039370078738
$ python
>>> from noether import *
>>> 5*cm @ inch
1.9685039370078738 in  # length
```

In addition to `@` for display, you can more permanently set display units:

```py
>>> display(inch)
>>> 5 * cm
>>> mile
mile  # length, 63360 in
```

Units propagate uncertainty automatically under most operations:

```py
>>> m(5, 0.1)**3
125 ± 7.5 m**3  # volume
```

You can define your own units and dimensions:

```py
>>> foo = Unit(3e11 * furlong / fortnight, 'foo')
>>> c @ foo
6.008724999284181 foo  # speed

>>> health = Dimension.new('health', 'H')
>>> apple = Unit(health, 'apple', 'a')
>>> apple / day
apple / day  # health / time, 1.1574074074074073e-05 a / s
```

Various `conf` settings allow for customisation to behaviour:

```py
>>> conf.info_spectrum = True
>>> nm(400)
4e-07 m  # length, visible, purple
```

Use `conf.save()` to save to (by default) `~/.config/noether.toml`.


## For more, see...

- [CHANGELOG.md](https://github.com/yunruse/Noether/blob/release/CHANGELOG.md)
- [CONTRIBUTING.md](https://github.com/yunruse/Noether/blob/release/CONTRIBUTING.md)
- [LICENSE.txt](https://github.com/yunruse/Noether/blob/release/LICENSE.txt)

Other tools for working with units include:

- [Wolfram Alpha](https://www.wolframalpha.com), a comprehensive online intelligence engine
- [gnu `units`](https://www.gnu.org/software/units/), a command-line tool you likely already have
- [units](https://pypi.org/project/units/), a simple Python package for defining your own units
- [unyt](https://pypi.org/project/unyt/), a Python package with numpy support

### 📚 _**Did you know?**_

```
>>> lunation / (year % lunation)
2.7153489666011486
```
A [**lunation**](https://en.wikipedia.org/wiki/Lunar_month#Synodic_month) (about 29 days) separates one full moon from another. Every so often a thirteenth full moon occurs in a year - "a [blue moon](https://en.wikipedia.org/wiki/Blue_moon)". "Once in a blue moon" is actually only every 2.71 years or so - not as rare as you'd think. Don't tell Sinatra!

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/yunruse/noether",
    "name": "noether",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "physics unit measure constant measurement uncertainty",
    "author": "Mia yun Ruse",
    "author_email": "mia@yunru.se",
    "download_url": "https://files.pythonhosted.org/packages/64/80/94887eb659f511ccbb6b2386a894ee514de4d604f2dd85f5b2aa3784ca9e/noether-1.1.tar.gz",
    "platform": null,
    "description": "# Noether\n`523 units, 60 prefixes`\n\n[![PyPI](https://img.shields.io/pypi/v/noether?color=blue)](https://pypi.org/packages/noether)\n\n**Noether** is a unit-enriched Python package, akin to Wolfram Alpha or gnu `units`. It has a large (and expanding) catalogue of up-to-date units and constants, allowing code to be written directly in the units they are concerned with while also ensuring e.g. you don't mistakenly add an energy to a length.\n\nJust grab Python 3.10 or later and `pip install noether` to run!\n\nDevelopment is ongoing, especially in expanding the unit catalogue and improving unit display mechanisms.\n\n## Usage \n\nNoether can be used as a Python package or as a CLI:\n\n```sh\n$ alias noe='python -im noether'\n$ noe marathon\nmarathon  # length, 42195 m, Race length based on Greek legend, set by convention from 1908 Summer Olympics\n$ noether 23degC @ degF\n73.4 \u00b0F  # temperature\n$ noether 'horsepower @ dB(kW)'\n-1.33418061 dB(kW)  # power, 0.73549875 kW\n```\n\nThe CLI allows a few niceties such as slightly terser syntax, but otherwise behaves identically to Python:\n\n```sh\n$ noether 5cm @ in --value\n1.9685039370078738\n$ python\n>>> from noether import *\n>>> 5*cm @ inch\n1.9685039370078738 in  # length\n```\n\nIn addition to `@` for display, you can more permanently set display units:\n\n```py\n>>> display(inch)\n>>> 5 * cm\n>>> mile\nmile  # length, 63360 in\n```\n\nUnits propagate uncertainty automatically under most operations:\n\n```py\n>>> m(5, 0.1)**3\n125 \u00b1 7.5 m**3  # volume\n```\n\nYou can define your own units and dimensions:\n\n```py\n>>> foo = Unit(3e11 * furlong / fortnight, 'foo')\n>>> c @ foo\n6.008724999284181 foo  # speed\n\n>>> health = Dimension.new('health', 'H')\n>>> apple = Unit(health, 'apple', 'a')\n>>> apple / day\napple / day  # health / time, 1.1574074074074073e-05 a / s\n```\n\nVarious `conf` settings allow for customisation to behaviour:\n\n```py\n>>> conf.info_spectrum = True\n>>> nm(400)\n4e-07 m  # length, visible, purple\n```\n\nUse `conf.save()` to save to (by default) `~/.config/noether.toml`.\n\n\n## For more, see...\n\n- [CHANGELOG.md](https://github.com/yunruse/Noether/blob/release/CHANGELOG.md)\n- [CONTRIBUTING.md](https://github.com/yunruse/Noether/blob/release/CONTRIBUTING.md)\n- [LICENSE.txt](https://github.com/yunruse/Noether/blob/release/LICENSE.txt)\n\nOther tools for working with units include:\n\n- [Wolfram Alpha](https://www.wolframalpha.com), a comprehensive online intelligence engine\n- [gnu `units`](https://www.gnu.org/software/units/), a command-line tool you likely already have\n- [units](https://pypi.org/project/units/), a simple Python package for defining your own units\n- [unyt](https://pypi.org/project/unyt/), a Python package with numpy support\n\n### \ud83d\udcda _**Did you know?**_\n\n```\n>>> lunation / (year % lunation)\n2.7153489666011486\n```\nA [**lunation**](https://en.wikipedia.org/wiki/Lunar_month#Synodic_month) (about 29 days) separates one full moon from another. Every so often a thirteenth full moon occurs in a year - \"a [blue moon](https://en.wikipedia.org/wiki/Blue_moon)\". \"Once in a blue moon\" is actually only every 2.71 years or so - not as rare as you'd think. Don't tell Sinatra!\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Work with physical measurements and constants",
    "version": "1.1",
    "project_urls": {
        "Homepage": "https://github.com/yunruse/noether"
    },
    "split_keywords": [
        "physics",
        "unit",
        "measure",
        "constant",
        "measurement",
        "uncertainty"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "18843628495e25aa1fa2e375bbfdf01854ded918ad680653e3f02157f40454f3",
                "md5": "9cf3413159ed69c33ed5336c3cf28e01",
                "sha256": "ccd0f168842b1c912bc4b941643c3e16d49fe7947d70397d858e5b19e3196c23"
            },
            "downloads": -1,
            "filename": "noether-1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9cf3413159ed69c33ed5336c3cf28e01",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 60776,
            "upload_time": "2023-08-02T16:49:04",
            "upload_time_iso_8601": "2023-08-02T16:49:04.337362Z",
            "url": "https://files.pythonhosted.org/packages/18/84/3628495e25aa1fa2e375bbfdf01854ded918ad680653e3f02157f40454f3/noether-1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "648094887eb659f511ccbb6b2386a894ee514de4d604f2dd85f5b2aa3784ca9e",
                "md5": "1c07fb2b8282928f08268f29647931bb",
                "sha256": "0be875bfa58c9c7288f97ec71af4f35c2b674afb8b37ad4dd8a3594c2e58d6de"
            },
            "downloads": -1,
            "filename": "noether-1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1c07fb2b8282928f08268f29647931bb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 45893,
            "upload_time": "2023-08-02T16:49:06",
            "upload_time_iso_8601": "2023-08-02T16:49:06.075575Z",
            "url": "https://files.pythonhosted.org/packages/64/80/94887eb659f511ccbb6b2386a894ee514de4d604f2dd85f5b2aa3784ca9e/noether-1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-02 16:49:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "yunruse",
    "github_project": "noether",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "toml",
            "specs": [
                [
                    "==",
                    "0.10.2"
                ]
            ]
        }
    ],
    "lcname": "noether"
}
        
Elapsed time: 0.09589s