Name | lange JSON |
Version |
1.230203.2
JSON |
| download |
home_page | |
Summary | Haskell-like intervals for Python |
upload_time | 2023-02-04 20:02:33 |
maintainer | |
docs_url | None |
author | davips |
requires_python | >=3.8,<4.0 |
license | GPLv3 |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
![test](https://github.com/davips/lange/workflows/test/badge.svg)
[![codecov](https://codecov.io/gh/davips/lange/branch/main/graph/badge.svg)](https://codecov.io/gh/davips/lange)
<a href="https://pypi.org/project/lange">
<img src="https://img.shields.io/pypi/v/lange.svg?label=release&color=blue&style=flat-square" alt="pypi">
</a>
![Python version](https://img.shields.io/badge/python-3.8...-blue.svg)
[![license: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
<!--- [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5501845.svg)](https://doi.org/10.5281/zenodo.5501845) --->
<!--- [![arXiv](https://img.shields.io/badge/arXiv-2109.06028-b31b1b.svg?style=flat-square)](https://arxiv.org/abs/2109.06028) --->
[![API](https://img.shields.io/badge/API-autogenerated-a0a0a0.svg)](https://davips.github.io/lange)
# lange
Lazy lists (i.e. Haskell-like ranges) for Python.
[Latest release](https://pypi.org/project/lange) |
[Current code](https://github.com/davips/lange) |
[API documentation](https://davips.github.io/lange)
## Installation
### from package
```bash
# Set up a virtualenv.
python3 -m venv venv
source venv/bin/activate
# Install from PyPI
pip install lange
```
### from source
```bash
cd my-project
git clone https://github.com/davips/lange ../lange
pip install -e ../lange
```
### Features
* Stable floating-point range generation, e.g.: `0.8 - 0.6 == 0.2` up to 28 digits (customizable).
* Infinite `[1 2 ...]` or bounded.
* O(1) access/evaluation `lst[3443]`
### Examples
**Arithmetic Progression**
<details>
<p>
```python3
# Bounded
from lange import ap
print(ap[0.4, 0.8, ..., 2])
"""
[0.4 0.8 .+. 2.0]
"""
```
```python3
# Infinite + slicing
prog = ap[0.4, 0.8, ...]
print(prog[:5])
"""
[0.4 0.8 .+. 2.0]
"""
```
```python3
# As list
print(list(prog[:5]))
"""
[0.4, 0.8, 1.2, 1.6, 2.0]
"""
```
```python3
print(prog[:5].l)
"""
[0.4, 0.8, 1.2, 1.6, 2.0]
"""
```
```python3
# Towards negative.
print(ap[1, -2, ..., -8].l)
"""
[1, -2, -5, -8]
"""
```
</p>
</details>
**Geometric Progression**
<details>
<p>
```python3
# Bounded
from lange import gp
print(gp[0.4, 0.8, ..., 2])
"""
[0.4 0.8 1.6]
"""
```
```python3
# Infinite + slicing
prog = gp[0.4, 0.8, ...]
print(prog[:5])
"""
[0.4 0.8 .*. 6.4]
"""
```
```python3
# As list
print(list(prog[:5]))
"""
[0.4, 0.8, 1.6, 3.2, 6.4]
"""
```
```python3
print(prog[:5].l)
"""
[0.4, 0.8, 1.6, 3.2, 6.4]
"""
```
```python3
# Using negative step.
print(gp[1, -2, ..., 130].l)
"""
[1, -2, 4, -8, 16, -32, 64, -128]
"""
```
</p>
</details>
## Other projects
Please access this [website](https://hosh.page/projects) for more information.
Raw data
{
"_id": null,
"home_page": "",
"name": "lange",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "davips",
"author_email": "dpsabc@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b4/94/e4fe160b674145175ad05941c295b9314a974de6af9711d22752863e86af/lange-1.230203.2.tar.gz",
"platform": null,
"description": "![test](https://github.com/davips/lange/workflows/test/badge.svg)\n[![codecov](https://codecov.io/gh/davips/lange/branch/main/graph/badge.svg)](https://codecov.io/gh/davips/lange)\n<a href=\"https://pypi.org/project/lange\">\n<img src=\"https://img.shields.io/pypi/v/lange.svg?label=release&color=blue&style=flat-square\" alt=\"pypi\">\n</a>\n![Python version](https://img.shields.io/badge/python-3.8...-blue.svg)\n[![license: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n\n<!--- [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.5501845.svg)](https://doi.org/10.5281/zenodo.5501845) --->\n<!--- [![arXiv](https://img.shields.io/badge/arXiv-2109.06028-b31b1b.svg?style=flat-square)](https://arxiv.org/abs/2109.06028) --->\n[![API](https://img.shields.io/badge/API-autogenerated-a0a0a0.svg)](https://davips.github.io/lange)\n\n# lange\nLazy lists (i.e. Haskell-like ranges) for Python.\n[Latest release](https://pypi.org/project/lange) |\n[Current code](https://github.com/davips/lange) |\n[API documentation](https://davips.github.io/lange)\n\n## Installation\n### from package\n```bash\n# Set up a virtualenv. \npython3 -m venv venv\nsource venv/bin/activate\n\n# Install from PyPI\npip install lange\n```\n\n### from source\n```bash\ncd my-project\ngit clone https://github.com/davips/lange ../lange\npip install -e ../lange\n```\n\n\n### Features\n * Stable floating-point range generation, e.g.: `0.8 - 0.6 == 0.2` up to 28 digits (customizable).\n * Infinite `[1 2 ...]` or bounded.\n * O(1) access/evaluation `lst[3443]`\n\n\n### Examples\n\n**Arithmetic Progression**\n<details>\n<p>\n\n```python3\n\n# Bounded\nfrom lange import ap\n\nprint(ap[0.4, 0.8, ..., 2])\n\"\"\"\n[0.4 0.8 .+. 2.0]\n\"\"\"\n```\n\n```python3\n\n# Infinite + slicing\nprog = ap[0.4, 0.8, ...]\nprint(prog[:5])\n\"\"\"\n[0.4 0.8 .+. 2.0]\n\"\"\"\n```\n\n```python3\n\n# As list\nprint(list(prog[:5]))\n\"\"\"\n[0.4, 0.8, 1.2, 1.6, 2.0]\n\"\"\"\n```\n\n```python3\n\nprint(prog[:5].l)\n\"\"\"\n[0.4, 0.8, 1.2, 1.6, 2.0]\n\"\"\"\n```\n\n```python3\n\n# Towards negative.\nprint(ap[1, -2, ..., -8].l)\n\"\"\"\n[1, -2, -5, -8]\n\"\"\"\n```\n\n\n</p>\n</details>\n\n**Geometric Progression**\n<details>\n<p>\n\n```python3\n\n# Bounded\nfrom lange import gp\nprint(gp[0.4, 0.8, ..., 2])\n\"\"\"\n[0.4 0.8 1.6]\n\"\"\"\n```\n\n```python3\n\n# Infinite + slicing\nprog = gp[0.4, 0.8, ...]\nprint(prog[:5])\n\"\"\"\n[0.4 0.8 .*. 6.4]\n\"\"\"\n```\n\n```python3\n\n# As list\nprint(list(prog[:5]))\n\"\"\"\n[0.4, 0.8, 1.6, 3.2, 6.4]\n\"\"\"\n```\n\n```python3\n\nprint(prog[:5].l)\n\"\"\"\n[0.4, 0.8, 1.6, 3.2, 6.4]\n\"\"\"\n```\n\n```python3\n\n# Using negative step.\nprint(gp[1, -2, ..., 130].l)\n\"\"\"\n[1, -2, 4, -8, 16, -32, 64, -128]\n\"\"\"\n```\n\n\n</p>\n</details>\n\n## Other projects\nPlease access this [website](https://hosh.page/projects) for more information.\n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "Haskell-like intervals for Python",
"version": "1.230203.2",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "284d95e5b3494dbb1e0323f7b793f73329cd3d9189be7f3e0c1edacad93a02bc",
"md5": "c8a1a15b2ee0730db4592286feec1248",
"sha256": "97521b797ed3cbfc81ef7df4c21f55db11e071985b3b7b88426e70b504b81fdb"
},
"downloads": -1,
"filename": "lange-1.230203.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c8a1a15b2ee0730db4592286feec1248",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 23752,
"upload_time": "2023-02-04T20:02:30",
"upload_time_iso_8601": "2023-02-04T20:02:30.916909Z",
"url": "https://files.pythonhosted.org/packages/28/4d/95e5b3494dbb1e0323f7b793f73329cd3d9189be7f3e0c1edacad93a02bc/lange-1.230203.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b494e4fe160b674145175ad05941c295b9314a974de6af9711d22752863e86af",
"md5": "e47c94e6a8f9523720c263778467512c",
"sha256": "d9c3f5ae28829f8ab7e6316d65852fce04c31d34d839422b1c978fcaa49dc682"
},
"downloads": -1,
"filename": "lange-1.230203.2.tar.gz",
"has_sig": false,
"md5_digest": "e47c94e6a8f9523720c263778467512c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 19973,
"upload_time": "2023-02-04T20:02:33",
"upload_time_iso_8601": "2023-02-04T20:02:33.022236Z",
"url": "https://files.pythonhosted.org/packages/b4/94/e4fe160b674145175ad05941c295b9314a974de6af9711d22752863e86af/lange-1.230203.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-04 20:02:33",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "lange"
}