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, 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


Download files

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

Source Distribution

safethread-1.0.0.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

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

safethread-1.0.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for safethread-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2fd2ab51a67737e888a171bcbb85f3f7faf7726fbd9aa71dd0435e7f58d764a9
MD5 e3896a76cb52131143a2db52ffe01cb7
BLAKE2b-256 0027983a1775d6ee4b53d10a339ebe1575c6694ac2c74eac3a35bb15dc25239a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for safethread-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b543d3294c45244c662c4e50205d67fa688204b1d37039a8d39982f60028219
MD5 e7c41be0e5344f2f52153b6c1d66871f
BLAKE2b-256 c9471fed28042e8fc30d95d471d01ff0933e17763905e02d3b3d8073d0c938af

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