heare-ids


Nameheare-ids JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryStripe-like tokens in pure-python with no dependencies.
upload_time2024-04-16 06:00:18
maintainerNone
docs_urlNone
authorSean Fitzgerald
requires_python<4.0,>=3.11
licenseMIT
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.11",
    "maintainer_email": null,
    "keywords": null,
    "author": "Sean Fitzgerald",
    "author_email": "sean@fitzgeralds.me",
    "download_url": "https://files.pythonhosted.org/packages/bd/e1/bc8e5636bda2052cd37c30ba5d5ab0b389acd9b628cfc38cc108e88d355f/heare_ids-0.1.0.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.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3779e8f48bad5c2865d72e13432f403eb0a943a4304b3fec65e10a86650f8eec",
                "md5": "d4bf71b43cab97b19d94c12b067354cc",
                "sha256": "641c26cbcc51bb1cc4534ecc40059c8c09d818344d5de21d182dd701f540e2a3"
            },
            "downloads": -1,
            "filename": "heare_ids-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d4bf71b43cab97b19d94c12b067354cc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.11",
            "size": 4210,
            "upload_time": "2024-04-16T06:00:15",
            "upload_time_iso_8601": "2024-04-16T06:00:15.503467Z",
            "url": "https://files.pythonhosted.org/packages/37/79/e8f48bad5c2865d72e13432f403eb0a943a4304b3fec65e10a86650f8eec/heare_ids-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bde1bc8e5636bda2052cd37c30ba5d5ab0b389acd9b628cfc38cc108e88d355f",
                "md5": "2e2c3afcedafa8be8ef5cc62a2896546",
                "sha256": "4b96c177ff23dce9bf1db0debdf9476abaded5faad9bebe11698be01fb8f77fe"
            },
            "downloads": -1,
            "filename": "heare_ids-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2e2c3afcedafa8be8ef5cc62a2896546",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.11",
            "size": 3591,
            "upload_time": "2024-04-16T06:00:18",
            "upload_time_iso_8601": "2024-04-16T06:00:18.242248Z",
            "url": "https://files.pythonhosted.org/packages/bd/e1/bc8e5636bda2052cd37c30ba5d5ab0b389acd9b628cfc38cc108e88d355f/heare_ids-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-16 06:00:18",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "heare-ids"
}
        
Elapsed time: 0.27570s