secure-string
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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
secure_strings-1.0.4.tar.gz
(7.3 kB
view details)
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 secure_strings-1.0.4.tar.gz.
File metadata
- Download URL: secure_strings-1.0.4.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1c151e8caa04e28d02de06b394bd6f134446fd6849f01aa561268d6c8b62258
|
|
| MD5 |
d7757d127a165248cf86d16c46895a3c
|
|
| BLAKE2b-256 |
99acc9b179506ba4869853bccff933b526df33cf722e022d979d94867b3eb833
|
File details
Details for the file secure_strings-1.0.4-py3-none-any.whl.
File metadata
- Download URL: secure_strings-1.0.4-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.8.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efa7939a24ae934aa49acfcedb1279fbe746e2681f8d40e30c4a10a0e1a08bd3
|
|
| MD5 |
09a692772dcf0233023121f816a676a2
|
|
| BLAKE2b-256 |
aed63adf480914f4f49061e06b5f8dc1025b04a2ee5fa7d221e1c5b53da4f516
|