Python utilities classes for safe deployment and management of Threads, synchronization and Python data structures.
Project description
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:
pip install safethread
Usage
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/ folder and the full documentation (link below).
Documentation
The full documentation is available in 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 file).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file safethread-1.0.1.tar.gz.
File metadata
- Download URL: safethread-1.0.1.tar.gz
- Upload date:
- Size: 15.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
359bb6ac68463c09913ee452e5b2fbd4925c7f628fce321b059e8295a1ea8989
|
|
| MD5 |
9910ff73bcaba708ef4dc615091b231d
|
|
| BLAKE2b-256 |
900175f2c4dfc89bba4192e2ee9287b7f18177f918332d9e1503161e0fe40bdc
|
File details
Details for the file safethread-1.0.1-py3-none-any.whl.
File metadata
- Download URL: safethread-1.0.1-py3-none-any.whl
- Upload date:
- Size: 17.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
865534109df9b90d88af8c5c6faf0330924b832ed8c339595dc1fe02b4b15f1b
|
|
| MD5 |
37cc63b2a535fcd76e71b9bdf42aeb8d
|
|
| BLAKE2b-256 |
4dfea26188b7db811afd322bc3628b98d886782255f2f8233f39f7e7808757de
|