Skip to main content

Protects passwords from accidentally getting into logs

Project description

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

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

secure_strings-1.0.3.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

secure_strings-1.0.3-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file secure_strings-1.0.3.tar.gz.

File metadata

  • Download URL: secure_strings-1.0.3.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for secure_strings-1.0.3.tar.gz
Algorithm Hash digest
SHA256 fe1f9d23eddc49a3064cf6fcaeb8cb9b6eb89290d4c1e757c89f41ca2dae6d87
MD5 164924a6b88d6d86ae142ef8126b900d
BLAKE2b-256 6cab1366647c4f13c7dc559c61224ba094ad3c9341a0568ba65d347ef8674778

See more details on using hashes here.

File details

Details for the file secure_strings-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: secure_strings-1.0.3-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

Hashes for secure_strings-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8e4bc22f130bf8ca7c01a8b37806fe5163ab1f6d1098de0c029bfb4b9259bec8
MD5 6fd467a4a6336f348982b4a8e97d67b3
BLAKE2b-256 dfe9e46352117d26a3025d1d3ae53f61760a344fa4c2afc438757ea74aee063b

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