numx


Namenumx JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/tomhea/numx
SummaryImport Numbers
upload_time2023-12-07 10:57:38
maintainer
docs_urlNone
authorTom Herman
requires_python>=3.8,<4.0
licenseBSD-2-Clause-Simplified
keywords math primes fast cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # NumX - Import Numbers

[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/tomhea/numx)](https://github.com/tomhea/numx)
[![GitHub](https://img.shields.io/github/license/tomhea/numx)](LICENSE)
[![PyPI - Version](https://img.shields.io/pypi/v/numx)](https://pypi.org/project/numx/)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/numx)](https://pypi.org/project/numx/)

Just Import Numbers.

```python
>> from numx import p25  # The 25th prime
>> print(p25)
97
```

This library allows importing useful numbers, as the Nth prime, prime lists, random numbers, fibonacci, e, pi, ...  
The library is [thoroughly tested](#how-to-test), and uses [sympy](https://pypi.org/project/sympy/) as its computational mind.

### How to Download
```
pip install numx
```

# Supported Number Types
- `pN`  - the Nth prime.
- `plN` - list of the first N primes.
- `PN`  - count the primes upto N.
- `PLN` - list of primes upto N.
- `nN`  - the number N.
- `rN`  - random integer in range [0, N].
- `piN` - pi to N decimal places (as numx.__Float).
- `eN`  - e to N decimal places (as numx.__Float).
- `tN`  - Euler's totient function of N.
- `faN` - N! (N factorial).
- `fiN` - fibonacci(N), starting from fi0 == 0.

Moreover, for big numbers you can use: 
- `2e7` to denote `2 * 10**7`
- `2p7` to denote `2 ** 7`
- `_` as a dot, so: `6_25p_5` is `6.25 ** 0.5`

An import can fail only when importing a variable written in a bad format (e.g. numx.n7e will fail).  
When it fails, numx will raise the numx.__NumXError exception, which inherits from ValueError.

numx.__Float is sympy.Float, which supports the str() and float() functions.

### How to Test

The library is thoroughly tested. If you want to run the test, just run:
```
>> git clone https://github.com/tomhea/numx.git
>> pytest numx
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/tomhea/numx",
    "name": "numx",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "math,primes,fast,cli",
    "author": "Tom Herman",
    "author_email": "flipjumpproject@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/d6/bf/ee6af32d7555e21ecafee09da6737f519ac5fba0fe4b4071226762b77519/numx-1.0.1.tar.gz",
    "platform": null,
    "description": "# NumX - Import Numbers\n\n[![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/tomhea/numx)](https://github.com/tomhea/numx)\n[![GitHub](https://img.shields.io/github/license/tomhea/numx)](LICENSE)\n[![PyPI - Version](https://img.shields.io/pypi/v/numx)](https://pypi.org/project/numx/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/numx)](https://pypi.org/project/numx/)\n\nJust Import Numbers.\n\n```python\n>> from numx import p25  # The 25th prime\n>> print(p25)\n97\n```\n\nThis library allows importing useful numbers, as the Nth prime, prime lists, random numbers, fibonacci, e, pi, ...  \nThe library is [thoroughly tested](#how-to-test), and uses [sympy](https://pypi.org/project/sympy/) as its computational mind.\n\n### How to Download\n```\npip install numx\n```\n\n# Supported Number Types\n- `pN`  - the Nth prime.\n- `plN` - list of the first N primes.\n- `PN`  - count the primes upto N.\n- `PLN` - list of primes upto N.\n- `nN`  - the number N.\n- `rN`  - random integer in range [0, N].\n- `piN` - pi to N decimal places (as numx.__Float).\n- `eN`  - e to N decimal places (as numx.__Float).\n- `tN`  - Euler's totient function of N.\n- `faN` - N! (N factorial).\n- `fiN` - fibonacci(N), starting from fi0 == 0.\n\nMoreover, for big numbers you can use: \n- `2e7` to denote `2 * 10**7`\n- `2p7` to denote `2 ** 7`\n- `_` as a dot, so: `6_25p_5` is `6.25 ** 0.5`\n\nAn import can fail only when importing a variable written in a bad format (e.g. numx.n7e will fail).  \nWhen it fails, numx will raise the numx.__NumXError exception, which inherits from ValueError.\n\nnumx.__Float is sympy.Float, which supports the str() and float() functions.\n\n### How to Test\n\nThe library is thoroughly tested. If you want to run the test, just run:\n```\n>> git clone https://github.com/tomhea/numx.git\n>> pytest numx\n```\n",
    "bugtrack_url": null,
    "license": "BSD-2-Clause-Simplified",
    "summary": "Import Numbers",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/tomhea/numx",
        "Repository": "https://github.com/tomhea/numx"
    },
    "split_keywords": [
        "math",
        "primes",
        "fast",
        "cli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "44cdb3da1c4f9309b14ff0fadb99bab0805c9b7d875e045123b921dfaf255cab",
                "md5": "ce90d88cc83a57d838b762eba4c6bc5e",
                "sha256": "67d50b534a24c2bf7caff6d8da4ce1adec676ea3d40b04ad0031040be4512991"
            },
            "downloads": -1,
            "filename": "numx-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ce90d88cc83a57d838b762eba4c6bc5e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 5558,
            "upload_time": "2023-12-07T10:57:36",
            "upload_time_iso_8601": "2023-12-07T10:57:36.551358Z",
            "url": "https://files.pythonhosted.org/packages/44/cd/b3da1c4f9309b14ff0fadb99bab0805c9b7d875e045123b921dfaf255cab/numx-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d6bfee6af32d7555e21ecafee09da6737f519ac5fba0fe4b4071226762b77519",
                "md5": "022b8a362474c83114b8b6a16bdd61d7",
                "sha256": "ded2a6813b78bcb81782d6c5e9969e3c2cb5aaf718bcf17cb337ce358fee3c18"
            },
            "downloads": -1,
            "filename": "numx-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "022b8a362474c83114b8b6a16bdd61d7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 3904,
            "upload_time": "2023-12-07T10:57:38",
            "upload_time_iso_8601": "2023-12-07T10:57:38.187540Z",
            "url": "https://files.pythonhosted.org/packages/d6/bf/ee6af32d7555e21ecafee09da6737f519ac5fba0fe4b4071226762b77519/numx-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-07 10:57:38",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tomhea",
    "github_project": "numx",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "numx"
}
        
Elapsed time: 0.14669s