Name | hasse JSON |
Version |
0.2.0
JSON |
| download |
home_page | None |
Summary | Python library for representing Partially Ordered sets via Hasse Diagrams. |
upload_time | 2025-09-08 03:39:00 |
maintainer | None |
docs_url | None |
author | Marcell Vazquez-Chanlatte |
requires_python | <4.0,>=3.9 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# hasse
Python library for representing Partially Ordered sets via Hasse Diagrams.
[](https://cloud.drone.io/mvcisback/hasse)
[](https://badge.fury.io/py/hasse)
[](https://opensource.org/licenses/MIT)
**Table of Contents**
- [Installation](#installation)
- [Usage](#usage)
# Installation
If you just need to use `hasse`, you can just run:
`$ pip install hasse`
For developers, note that this project uses the
[poetry](https://poetry.eustace.io/) python package/dependency
management tool. Please familarize yourself with it and then
run:
`$ poetry install`
# Usage
`hasse` is centered around the `hasse.PoSet` class. An example is
given below.
```python
import hasse
poset = hasse.PoSet.from_chains(
[1, 2, 4], # 1 < 2 < 4
[1, 3, 4], # 1 < 3 < 4
)
# Test membership and size.
assert 2 in poset
assert len(poset) == 4
assert set(poset) == {1,2,3,4}
# Perform pair wise comparison.
assert poset.compare(1, 1) == '='
assert poset.compare(1, 4) == '<'
assert poset.compare(4, 2) == '>'
assert poset.compare(2, 3) == '||'
# Add an edge.
poset2 = poset.add([2, 1])
poset2.compare(1, 2) == '='
```
PoSet must be a DAG. For large posets we encourage batching via from_chains over many small add() calls.
Raw data
{
"_id": null,
"home_page": null,
"name": "hasse",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Marcell Vazquez-Chanlatte",
"author_email": "mvc@linux.com",
"download_url": "https://files.pythonhosted.org/packages/aa/09/33f8a0179c110a2d4512dc37f0a93d3ad0fab4e22de9a0c55759e62add73/hasse-0.2.0.tar.gz",
"platform": null,
"description": "# hasse\nPython library for representing Partially Ordered sets via Hasse Diagrams.\n\n[](https://cloud.drone.io/mvcisback/hasse)\n[](https://badge.fury.io/py/hasse)\n[](https://opensource.org/licenses/MIT)\n\n**Table of Contents**\n\n- [Installation](#installation)\n- [Usage](#usage)\n\n# Installation\n\nIf you just need to use `hasse`, you can just run:\n\n`$ pip install hasse`\n\nFor developers, note that this project uses the\n[poetry](https://poetry.eustace.io/) python package/dependency\nmanagement tool. Please familarize yourself with it and then\nrun:\n\n`$ poetry install`\n\n# Usage\n\n`hasse` is centered around the `hasse.PoSet` class. An example is\ngiven below.\n\n```python\nimport hasse\n\nposet = hasse.PoSet.from_chains(\n [1, 2, 4], # 1 < 2 < 4\n [1, 3, 4], # 1 < 3 < 4\n)\n\n# Test membership and size.\nassert 2 in poset\nassert len(poset) == 4\nassert set(poset) == {1,2,3,4}\n\n# Perform pair wise comparison.\nassert poset.compare(1, 1) == '='\nassert poset.compare(1, 4) == '<'\nassert poset.compare(4, 2) == '>'\nassert poset.compare(2, 3) == '||'\n\n# Add an edge.\nposet2 = poset.add([2, 1])\nposet2.compare(1, 2) == '='\n```\nPoSet must be a DAG. For large posets we encourage batching via from_chains over many small add() calls.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python library for representing Partially Ordered sets via Hasse Diagrams.",
"version": "0.2.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4e559c20e42e47615fba1ef1b1097b43a5ef5424047cfe53f371c12845802ad9",
"md5": "024779dc028967b29a0d57d9218d5fd6",
"sha256": "62771aa1dbbf70b57d6e19cab0c816aa700a12d83405b15e598580ac093b7d1f"
},
"downloads": -1,
"filename": "hasse-0.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "024779dc028967b29a0d57d9218d5fd6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 3505,
"upload_time": "2025-09-08T03:38:58",
"upload_time_iso_8601": "2025-09-08T03:38:58.860119Z",
"url": "https://files.pythonhosted.org/packages/4e/55/9c20e42e47615fba1ef1b1097b43a5ef5424047cfe53f371c12845802ad9/hasse-0.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "aa0933f8a0179c110a2d4512dc37f0a93d3ad0fab4e22de9a0c55759e62add73",
"md5": "5d5376557fe90176cc4fdce0d1984751",
"sha256": "4d21df7a57551e6f2af615d12a6cee75bf5d988f7b9a4d2a91e0a22d80374718"
},
"downloads": -1,
"filename": "hasse-0.2.0.tar.gz",
"has_sig": false,
"md5_digest": "5d5376557fe90176cc4fdce0d1984751",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 2915,
"upload_time": "2025-09-08T03:39:00",
"upload_time_iso_8601": "2025-09-08T03:39:00.280467Z",
"url": "https://files.pythonhosted.org/packages/aa/09/33f8a0179c110a2d4512dc37f0a93d3ad0fab4e22de9a0c55759e62add73/hasse-0.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-08 03:39:00",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "hasse"
}