ustrid


Nameustrid JSON
Version 0.0.3 PyPI version JSON
download
home_pagehttps://github.com/pyrustic/ustrid
SummaryUniquely generated string identifiers
upload_time2024-03-13 23:01:15
maintainerPyrustic Evangelist
docs_urlNone
authorPyrustic Evangelist
requires_python>=3.5
licenseMIT
keywords application pyrustic
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            This package generates unique string identifiers.

```python
from ustrid import ustrid

unique_string_id = ustrid()
```

Under the hood:

```python
import uuid
import threading


def ustrid():
    """Generate a unique string identifier (thread-safe)"""
    return Ustrid.run()


class Ustrid:

    """Private class to generate unique string identifiers (thread-safe)"""
    _lock = threading.Lock()
    _count = 0

    @classmethod
    def run(cls):
        """Generate a unique string identifier (thread-safe)"""
        with cls._lock:
            cls._count += 1
            return "{}-{}".format(cls._count, uuid.uuid4())
```


**Installation:**
```bash
pip install ustrid
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pyrustic/ustrid",
    "name": "ustrid",
    "maintainer": "Pyrustic Evangelist",
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": "rusticalex@yahoo.com",
    "keywords": "application,pyrustic",
    "author": "Pyrustic Evangelist",
    "author_email": "rusticalex@yahoo.com",
    "download_url": "https://files.pythonhosted.org/packages/64/35/e7296039dec4eb83bdb4ad9bb8f42d2bc8b9d7b12281a61741b912b2961d/ustrid-0.0.3.tar.gz",
    "platform": null,
    "description": "This package generates unique string identifiers.\n\n```python\nfrom ustrid import ustrid\n\nunique_string_id = ustrid()\n```\n\nUnder the hood:\n\n```python\nimport uuid\nimport threading\n\n\ndef ustrid():\n    \"\"\"Generate a unique string identifier (thread-safe)\"\"\"\n    return Ustrid.run()\n\n\nclass Ustrid:\n\n    \"\"\"Private class to generate unique string identifiers (thread-safe)\"\"\"\n    _lock = threading.Lock()\n    _count = 0\n\n    @classmethod\n    def run(cls):\n        \"\"\"Generate a unique string identifier (thread-safe)\"\"\"\n        with cls._lock:\n            cls._count += 1\n            return \"{}-{}\".format(cls._count, uuid.uuid4())\n```\n\n\n**Installation:**\n```bash\npip install ustrid\n```\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Uniquely generated string identifiers",
    "version": "0.0.3",
    "project_urls": {
        "Homepage": "https://github.com/pyrustic/ustrid"
    },
    "split_keywords": [
        "application",
        "pyrustic"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "da7430ead78cc67bf8ea46190a18e9d9c8a988c948edfe59a6b5bb39982c6bbb",
                "md5": "aafe9bf30db5f333674019c32e0e5abd",
                "sha256": "0f150479f55fcefc04a330ad1cc3325e338fc13aebf3c1df4cf4bc84e08b7cac"
            },
            "downloads": -1,
            "filename": "ustrid-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "aafe9bf30db5f333674019c32e0e5abd",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 4061,
            "upload_time": "2024-03-13T23:01:13",
            "upload_time_iso_8601": "2024-03-13T23:01:13.873101Z",
            "url": "https://files.pythonhosted.org/packages/da/74/30ead78cc67bf8ea46190a18e9d9c8a988c948edfe59a6b5bb39982c6bbb/ustrid-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6435e7296039dec4eb83bdb4ad9bb8f42d2bc8b9d7b12281a61741b912b2961d",
                "md5": "e8b571eda5965bebc427765330df1989",
                "sha256": "efa96dbccb424dd274a7bafe65afe00032410b73d9435de4bddd45ec61e65998"
            },
            "downloads": -1,
            "filename": "ustrid-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "e8b571eda5965bebc427765330df1989",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 3240,
            "upload_time": "2024-03-13T23:01:15",
            "upload_time_iso_8601": "2024-03-13T23:01:15.282610Z",
            "url": "https://files.pythonhosted.org/packages/64/35/e7296039dec4eb83bdb4ad9bb8f42d2bc8b9d7b12281a61741b912b2961d/ustrid-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-13 23:01:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pyrustic",
    "github_project": "ustrid",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "ustrid"
}
        
Elapsed time: 0.22410s