Skip to main content

Python utilities classes for safe deployment and management of Threads, synchronization and Python data structures.

Project description

safethread

PyPI License Downloads

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: A thread-safe implementation of a list.
    • SafeDict: A thread-safe implementation of a dictionary.
    • SafeTuple: A thread-safe implementation of a tuple.
    • SafeSet: A thread-safe implementation of a set.
  • 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 import SafeList, SafeDict

# 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 SafeTuple
safe_tuple = SafeTuple(('a','b'))
print(safe_tuple[0])  # Output: 'a'

For further details, check tests 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

safethread-0.1.1.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

safethread-0.1.1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file safethread-0.1.1.tar.gz.

File metadata

  • Download URL: safethread-0.1.1.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for safethread-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8206e080659b7a32e9e5bc5c867c750760a907848d05c0975f00a37bab0bcf68
MD5 fd0ee46b5436b06e063c3edbb6add62b
BLAKE2b-256 c1a556f0bfce812583e25d2c0940718fad3aec335dcf037cd0ed610c52bdc322

See more details on using hashes here.

File details

Details for the file safethread-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: safethread-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for safethread-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d009538862d415faf4f6310556bc59695a568d5b9d415636be2e947271daf835
MD5 4088124a9f022d98d96a251e900de2c0
BLAKE2b-256 dcd67298f176bf9596c4ea29d9202d99b8e9fdd9b26fb4fe0fe86a3bcdf2a59f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page