utility package designed to detect sensitive
Project description
Sensitive Information Detection Utility
This repository contains a utility package designed to detect sensitive information and secrets in given content, particularly within text files. The utility takes either a file path or content as a string input and returns True if any sensitive information or secrets are found, otherwise, it returns False. The detection is based on configurable patterns specified in a separate configuration file included in the utility package. Features
Pattern Detection: The utility employs configurable patterns to identify sensitive information and secrets. Common examples of patterns include strings starting with SECRET_, ending with _KEY, _PASSWORD, and other variations.
Flexible Input: Accepts either a file path or content as a string, providing flexibility in usage.
Test Cases: The repository includes a set of test cases using pytest to demonstrate the effectiveness of the utility. These tests can be executed to validate the correctness of the utility.
Code Hygiene: The codebase adheres to coding standards, and we use tools like black or similar code scanning tools to maintain code hygiene. Pre-commit hooks are set up to automatically format the code before each commit.
To use the utility, follow these steps:
Install the package:
pip install pkgLavanya
Import the detector in your Python script or application:
import pkgLavanya
from pkgLavanya import detect_info
detect_info.op_gen()
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.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fed226ae19837618c2ba53ca923578a3194a4613684f0d1a3efe10cb4549d4a0 |
|
MD5 | d347149ac3fe42b009df29347c9b4af9 |
|
BLAKE2b-256 | 644f2882f3ff494475a91f8065dd5c80df6c806b2b8678eb5ec36cccc52d4be2 |