Skip to main content

secure-string

Tests codecov Mypy pypi downloads versions

Protects passwords from accidentally getting into logs

Installation

pip install secure-strings  # not secure-string, but secure-strings

Examples

from secure_string import SecureString, SecureStringContextManager, SecureStringStrictContextManager


password = SecureString('my password')
print(password)  # this will print '***' to stdout
print(password.value)  # this will print 'my password', use the `value` property to get real value

# we can disable string protection
with SecureStringContextManager(False):
    print(password)  # 'my password'


# we can also enable strict mode when we need to find a place where the password can be displayed
with SecureStringStrictContextManager(True):
    print(password)  # SecureStringStrictError, Method "__str__" does not allowed in strict mode context

Metadata

Release files for secure-strings 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for secure-strings 1.0.4
File Size Uploaded Provenance Actions
secure_strings-1.0.4.tar.gz 7.3 kB Without provenance Details for secure_strings-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for secure-strings 1.0.4
File Interpreter ABI Platform Actions
secure_strings-1.0.4-py3-none-any.whl Python 3 none any Details for secure_strings-1.0.4-py3-none-any.whl

Total release size: 15.3 kB

Release files / secure_strings-1.0.4.tar.gz

Download URL secure_strings-1.0.4.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d1c151e8caa04e28d02de06b394bd6f134446fd6849f01aa561268d6c8b62258
BLAKE2b-256 checksum
How to use checksums
99acc9b179506ba4869853bccff933b526df33cf722e022d979d94867b3eb833
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.20

Release files / secure_strings-1.0.4-py3-none-any.whl

Download URL secure_strings-1.0.4-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
efa7939a24ae934aa49acfcedb1279fbe746e2681f8d40e30c4a10a0e1a08bd3
BLAKE2b-256 checksum
How to use checksums
aed63adf480914f4f49061e06b5f8dc1025b04a2ee5fa7d221e1c5b53da4f516
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.20

Security for secure-strings 1.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page