Skip to main content

Elapse Secrets Filters

Elapse Secrets Filters is a Python package designed to help you search and mask sensitive information in a body of text using pre-defined regular expressions. This package includes filters for common secrets like AWS keys, Github tokens, API keys, and much more.

The package provides two main functions:

  1. filter_elapse_secrets(text: str) -> str - Uses the predefined regex filters to search and mask (with asterisks) any matching sensitive information in the input text.

  2. find_error_in_regex(yaml_file: str) -> None - Checks the YAML file containing regex rules for any incorrect patterns and logs the error if any are found.

Getting Started

  1. Install elapse-secrets

    pip install elapse-secrets
    

Usage

This is a basic usage example.

from elapse_secrets import filter_elapse_secrets

text_with_secrets = "My AWS Access Key is AKIAYOURACCESSKEYHERE"
filtered_text = filter_elapse_secrets(text_with_secrets)
print(filtered_text)
# Output: My AWS Access Key is ********

Documentation

filter_elapse_secrets(text: str) -> str

This function takes a string as input and returns the string with sensitive information replaced by asterisks.

Parameters

  • text (str): The text to filter.

Returns

  • str: The filtered text.

find_error_in_regex(yaml_file: str) -> None

This function checks a YAML file for incorrect regular expression patterns. If an error is found, it is logged.

Parameters

  • yaml_file (str): The YAML file to check.

Returns

  • None

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is licensed under the terms of the MIT license.

Contact

Please feel free to contact the maintainers of this project if you have any questions.

Acknowledgments

We would like to thank all the contributors who have been part of this project.

Metadata

Release files for elapse-secrets 0.1.2

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

Source distribution (sdist)

Source distribution for elapse-secrets 0.1.2
File Size Uploaded
elapse_secrets-0.1.2.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for elapse-secrets 0.1.2
File Interpreter ABI Platform
elapse_secrets-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.4 kB

Release files / elapse_secrets-0.1.2.tar.gz

Download URL elapse_secrets-0.1.2.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9d13b9bf94afea98ed9c3059380b87e991693f0d4e300110eb7796a80986c6d3
BLAKE2b-256 checksum
How to use checksums
c84c0817ab1e1a4cbd7d4a991ba498cbfef5a1884ebfb6c0bc473df7827430ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / elapse_secrets-0.1.2-py3-none-any.whl

Download URL elapse_secrets-0.1.2-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c8bed9f3314a7973162461b22826b9ca1d70d9b3c412e26fbb2419699c2d709
BLAKE2b-256 checksum
How to use checksums
b2d06678bbed172656adc1c71d3e175ac8d71e4ea882bf15529eb97f46f4e68b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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