# safethread
[](https://pypi.org/project/safethread/)
[](https://github.com/andre-romano/safethread/blob/main/LICENSE)
[](https://pypi.org/project/safethread/)
``safethread`` is a Python package that wraps common Python data structures in thread-safe classes, providing utilities for thread-safe operations and synchronization mechanisms. It includes custom data structures designed to ensure thread safety when used in multi-threaded programming.
## Features
- **Thread-Safe Data Structures**: `SafeList`, `SafeDict`, `SafeTuple`, `SafeSet`, among others.
- **Thread Synchronization**: Built-in locking mechanisms to ensure safe operations in multithreaded environments.
- **Utility Methods**: Additional helpers and utilities for threading and synchronization.
## Installation
You can install ``safethread`` from PyPI:
```bash
pip install safethread
```
## Usage
```python
from safethread.datatype import SafeList, SafeDict, SafeSet
# Using SafeList
safe_list = SafeList()
safe_list.append(1)
print(safe_list[0]) # Output: 1
# Using SafeDict
safe_dict = SafeDict()
safe_dict['key'] = 'value'
print(safe_dict['key']) # Output: 'value'
# Using SafeSet
safe_set = SafeSet(['x','y'])
safe_set.add('z')
print('z' in safe_set) # Output: True
```
For further details, check the [``examples/``](./examples/) folder and the full documentation (link below).
## Documentation
The full documentation is available in [``https://andre-romano.github.io/safethread/docs``](https://andre-romano.github.io/safethread/docs)
## Contributing
We welcome contributions! If you'd like to contribute, please fork the repository and submit a pull request.
## Special thanks / Acknowledgments
- PyPi
- Python 3
## License and Copyright
Copyright (C) 2025 - Andre Luiz Romano Madureira
This project is licensed under the Apache License 2.0.
For more details, see the full license text (see [``LICENSE``](./LICENSE) file).
Raw data
{
"_id": null,
"home_page": "https://github.com/andre-romano/safethread",
"name": "safethread",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "threading, threads, thread-safe, process, multiprocessing, concurrent, Python",
"author": "Andre Luiz Romano Madureira",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/00/79/3af25fdab3a7aa26f7845cb7142675b4b300cb650397a33b57f0d165b34c/safethread-1.0.2.tar.gz",
"platform": null,
"description": "# safethread\r\n\r\n[](https://pypi.org/project/safethread/)\r\n[](https://github.com/andre-romano/safethread/blob/main/LICENSE)\r\n[](https://pypi.org/project/safethread/)\r\n\r\n``safethread`` is a Python package that wraps common Python data structures in thread-safe classes, providing utilities for thread-safe operations and synchronization mechanisms. It includes custom data structures designed to ensure thread safety when used in multi-threaded programming.\r\n\r\n## Features\r\n\r\n- **Thread-Safe Data Structures**: `SafeList`, `SafeDict`, `SafeTuple`, `SafeSet`, among others.\r\n- **Thread Synchronization**: Built-in locking mechanisms to ensure safe operations in multithreaded environments.\r\n- **Utility Methods**: Additional helpers and utilities for threading and synchronization.\r\n\r\n## Installation\r\n\r\nYou can install ``safethread`` from PyPI:\r\n\r\n```bash\r\npip install safethread\r\n```\r\n\r\n## Usage\r\n\r\n```python\r\nfrom safethread.datatype import SafeList, SafeDict, SafeSet\r\n\r\n# Using SafeList\r\nsafe_list = SafeList()\r\nsafe_list.append(1)\r\nprint(safe_list[0]) # Output: 1\r\n\r\n# Using SafeDict\r\nsafe_dict = SafeDict()\r\nsafe_dict['key'] = 'value'\r\nprint(safe_dict['key']) # Output: 'value'\r\n\r\n# Using SafeSet\r\nsafe_set = SafeSet(['x','y'])\r\nsafe_set.add('z')\r\nprint('z' in safe_set) # Output: True\r\n```\r\n\r\nFor further details, check the [``examples/``](./examples/) folder and the full documentation (link below).\r\n\r\n## Documentation\r\n\r\nThe full documentation is available in [``https://andre-romano.github.io/safethread/docs``](https://andre-romano.github.io/safethread/docs)\r\n\r\n## Contributing\r\n\r\nWe welcome contributions! If you'd like to contribute, please fork the repository and submit a pull request.\r\n\r\n## Special thanks / Acknowledgments\r\n\r\n- PyPi\r\n- Python 3\r\n\r\n## License and Copyright\r\n\r\nCopyright (C) 2025 - Andre Luiz Romano Madureira\r\n\r\nThis project is licensed under the Apache License 2.0. \r\n\r\nFor more details, see the full license text (see [``LICENSE``](./LICENSE) file).\r\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Python utilities classes for safe deployment and management of Threads, synchronization and Python data structures.",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://github.com/andre-romano/safethread"
},
"split_keywords": [
"threading",
" threads",
" thread-safe",
" process",
" multiprocessing",
" concurrent",
" python"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "2046fed9020099b53c335d96a30b622411cd59010120d71dbcc62ac70b9a20fb",
"md5": "5faca7e6c3732d110557f2d3aadb4a2f",
"sha256": "fd80affd63257e6a059143b992514840b6042680ee4dcfe13b5cde85c53356c9"
},
"downloads": -1,
"filename": "safethread-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5faca7e6c3732d110557f2d3aadb4a2f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 18532,
"upload_time": "2025-02-17T21:05:40",
"upload_time_iso_8601": "2025-02-17T21:05:40.941051Z",
"url": "https://files.pythonhosted.org/packages/20/46/fed9020099b53c335d96a30b622411cd59010120d71dbcc62ac70b9a20fb/safethread-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "00793af25fdab3a7aa26f7845cb7142675b4b300cb650397a33b57f0d165b34c",
"md5": "2c8740ed60d9f8aee3d0a25d361eb6cf",
"sha256": "73125a4873ce42632905be808bf6161e6a3edaac7c4773dac41481d3c63ce469"
},
"downloads": -1,
"filename": "safethread-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "2c8740ed60d9f8aee3d0a25d361eb6cf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 16103,
"upload_time": "2025-02-17T21:05:42",
"upload_time_iso_8601": "2025-02-17T21:05:42.075223Z",
"url": "https://files.pythonhosted.org/packages/00/79/3af25fdab3a7aa26f7845cb7142675b4b300cb650397a33b57f0d165b34c/safethread-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-17 21:05:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "andre-romano",
"github_project": "safethread",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "safethread"
}