Name | heare-ids JSON |
Version |
0.1.3
JSON |
| download |
home_page | None |
Summary | Stripe-like tokens in pure-python with no dependencies. |
upload_time | 2025-01-07 02:55:45 |
maintainer | None |
docs_url | None |
author | Sean Fitzgerald |
requires_python | <4.0,>=3.10 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Heare IDs
A Python module for creating, validating, parsing, and manipulating tokens that are base-62 encoded.
## Features
- Generate unique tokens with a prefix, generation character, timestamp, and entropy part
- Validate the structure and character set of tokens
- Parse tokens into their components (prefix, generation, timestamp, entropy)
- Swap the prefix of a token with a new prefix
## Installation
```
pip install heare-ids
```
## Usage
### Generating Tokens
```python
from heare import ids
# Generate a new token with default settings
token = ids.new('my_prefix')
# Generate a token with custom generation, timestamp, and entropy
token = ids.new('my_prefix', generation='A', timestamp=1234567890, entropy=15)
```
### Validating Tokens
```python
is_valid = ids.is_valid(token)
```
### Parsing Tokens
```python
parsed = ids.parse(token)
prefix = parsed.prefix
generation = parsed.generation
timestamp = parsed.timestamp
entropy = parsed.entropy
```
### Swapping Prefixes
```python
new_token = ids.swap_prefix(token, 'new_prefix')
```
## License
This project is licensed under the [MIT License](LICENSE).
## Contributing
Contributions are welcome! Please open an issue or submit a pull request.
Raw data
{
"_id": null,
"home_page": null,
"name": "heare-ids",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Sean Fitzgerald",
"author_email": "sean@fitzgeralds.me",
"download_url": "https://files.pythonhosted.org/packages/82/de/fe84da6a536be7bc5999ae15aaebbc86b9dd837472754daa8ec7244343f6/heare_ids-0.1.3.tar.gz",
"platform": null,
"description": "# Heare IDs\n\nA Python module for creating, validating, parsing, and manipulating tokens that are base-62 encoded.\n\n## Features\n\n- Generate unique tokens with a prefix, generation character, timestamp, and entropy part\n- Validate the structure and character set of tokens\n- Parse tokens into their components (prefix, generation, timestamp, entropy)\n- Swap the prefix of a token with a new prefix\n\n## Installation\n\n```\npip install heare-ids\n```\n\n## Usage\n\n### Generating Tokens\n\n```python\nfrom heare import ids\n\n# Generate a new token with default settings\ntoken = ids.new('my_prefix')\n\n# Generate a token with custom generation, timestamp, and entropy\ntoken = ids.new('my_prefix', generation='A', timestamp=1234567890, entropy=15)\n```\n\n### Validating Tokens\n\n```python\nis_valid = ids.is_valid(token)\n```\n\n### Parsing Tokens\n\n```python\nparsed = ids.parse(token)\nprefix = parsed.prefix\ngeneration = parsed.generation\ntimestamp = parsed.timestamp\nentropy = parsed.entropy\n```\n\n### Swapping Prefixes\n\n```python\nnew_token = ids.swap_prefix(token, 'new_prefix')\n```\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Stripe-like tokens in pure-python with no dependencies.",
"version": "0.1.3",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "67892f47b7470b3fea8bde8f9c60d57c49b55eb0672e0705234cd1702235f2c1",
"md5": "01b86f92b7849f55523c3c92c12436fe",
"sha256": "5d50d6b04115ee1f9b69cbe1b326460a8ef3a247fb0bc12f8c78aaacd739d1dc"
},
"downloads": -1,
"filename": "heare_ids-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "01b86f92b7849f55523c3c92c12436fe",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 4307,
"upload_time": "2025-01-07T02:55:44",
"upload_time_iso_8601": "2025-01-07T02:55:44.211111Z",
"url": "https://files.pythonhosted.org/packages/67/89/2f47b7470b3fea8bde8f9c60d57c49b55eb0672e0705234cd1702235f2c1/heare_ids-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "82defe84da6a536be7bc5999ae15aaebbc86b9dd837472754daa8ec7244343f6",
"md5": "6251dc843046ea8013fca22f7ca3dcbe",
"sha256": "5067a9405dc851b6b46a5403a98b3c86bace751924d4a49d3e2788b045e1dfa9"
},
"downloads": -1,
"filename": "heare_ids-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "6251dc843046ea8013fca22f7ca3dcbe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 3584,
"upload_time": "2025-01-07T02:55:45",
"upload_time_iso_8601": "2025-01-07T02:55:45.590124Z",
"url": "https://files.pythonhosted.org/packages/82/de/fe84da6a536be7bc5999ae15aaebbc86b9dd837472754daa8ec7244343f6/heare_ids-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-07 02:55:45",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "heare-ids"
}