utility package designed to detect sensitive
Project description
Sensitive Data Guard Utility
Overview
This repository contains a utility package designed to detect sensitive information or secrets in a given text content. The utility takes a text file as input, either specified by path or content as a string, and returns true or false based on the detection of any sensitive information. Usage
To use the utility, follow these steps:
Install the package:
pip install sensitive_data_guard
Import the detector in your Python script or application:
from sensitive_data_guard import detect_info
Use the detector with a file path or content string:
result = detect_info("path/to/your/file.txt")
print(result) # True if sensitive information is found, False otherwise
Configuration
The detection is based on known patterns configured in the config.yaml file included in the utility package. Example patterns include strings starting with SECRET_, ending with _KEY, _PASSWORD, and more. Users can customize patterns in the configuration file. Testing
Ensure the utility works as expected by running test cases using pytest. Install pytest first if not already installed:
pip install pytest
Run tests:
pytest
Code Hygiene
The code follows the Black formatting style, and pre-commit hooks are set up to ensure code hygiene. Install pre-commit:
pip install pre-commit
Set up pre-commit hooks:
pre-commit install
This ensures that code formatting is checked before every commit. Building and Releasing Build the Package Locally
To build the package locally, use the following command:
python setup.py sdist bdist_wheel
This creates the distribution package in the dist directory.
Release to PyPI
To release the package to the PyPI repository, use twine. Install twine if not already installed:
pip install twine
Upload the distribution package to PyPI:
twine upload dist/*
Automate Release with GitHub Actions
The repository is set up with GitHub Actions to automate the release process. Whenever a pull request is merged into the main branch, a new package version is created and released on PyPI.
Contribution
Feel free to contribute to this project by submitting issues or pull requests. Your feedback and contributions are highly appreciated!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pkgLavanya-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72ab26e7cf5765e07344b0f84425a70f70cf34e9b99197ad82393f33e60a0855 |
|
MD5 | 9c82a19ffba8b73a9e6865be3a2b05d5 |
|
BLAKE2b-256 | f1e8f2fcf7b71859d1f7cb7adc72542f89dde8fda89d507803e2287ab8692a3c |