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
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
is_valid = ids.is_valid(token)
Parsing Tokens
parsed = ids.parse(token)
prefix = parsed.prefix
generation = parsed.generation
timestamp = parsed.timestamp
entropy = parsed.entropy
Swapping Prefixes
new_token = ids.swap_prefix(token, 'new_prefix')
License
This project is licensed under the MIT License.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
Metadata
Release files for heare-ids 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| heare_ids-0.1.3.tar.gz | 3.6 kB | With provenance | Details for heare_ids-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| heare_ids-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for heare_ids-0.1.3-py3-none-any.whl |
Total release size: 7.9 kB
Release files / heare_ids-0.1.3.tar.gz
| Download URL | heare_ids-0.1.3.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5067a9405dc851b6b46a5403a98b3c86bace751924d4a49d3e2788b045e1dfa9
|
|
BLAKE2b-256 checksum How to use checksums |
82defe84da6a536be7bc5999ae15aaebbc86b9dd837472754daa8ec7244343f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 7, 2025.
Transparency logRelease files / heare_ids-0.1.3-py3-none-any.whl
| Download URL | heare_ids-0.1.3-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5d50d6b04115ee1f9b69cbe1b326460a8ef3a247fb0bc12f8c78aaacd739d1dc
|
|
BLAKE2b-256 checksum How to use checksums |
67892f47b7470b3fea8bde8f9c60d57c49b55eb0672e0705234cd1702235f2c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.0.1 CPython/3.12.8
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 7, 2025.
Transparency logSecurity for heare-ids 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for heare_ids-0.1.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 7, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.