Name | secured JSON |
Version |
0.1.4
JSON |
| download |
home_page | None |
Summary | None |
upload_time | 2024-05-21 08:06:04 |
maintainer | None |
docs_url | None |
author | Joao Paulo Euko |
requires_python | <4.0,>=3.10 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/secured)
![PyPI - Downloads](https://img.shields.io/pypi/dm/secured)
![PyPI](https://img.shields.io/pypi/v/secured)
[![codecov](https://codecov.io/gh/Joaopeuko/secured/graph/badge.svg?token=W5MF118U50)](https://codecov.io/gh/Joaopeuko/secured)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/secured)
![PyPI - License](https://img.shields.io/pypi/l/secured)
# Secured
- [Secured](#secured)
- [Installation](#installation)
- [Usage](#usage)
- [Example 1: Basic Usage](#example-1-basic-usage)
- [Example 2: Custom Usage](#example-2-custom-usage)
- [Example 3: Config Usage](#example-3-config-usage)
- [Example 4: Compose](#example-4-compose)
- [Features](#features)
Secure your Python data structures and secrets with Secured. This package provides a straightforward solution for obscuring sensitive data in applications. It's specifically designed for developers who need to protect API keys, database credentials, and other critical configuration details from accidental exposure. Featuring customizable security measures, our tool allows you to control how sensitive information is represented and managed securely. It's ideal for projects that demand high data confidentiality and integrity. Please note that this provides a thin layer of protection.
## Installation
To install Secured, run the following command:
```python
pip install secured
```
## Usage
Below are some examples on how to use Secured to protect your sensitive data:
### Example 1: Basic Usage
```python
from secured import Secure
# Protect a sensitive string
DATABASE_URL = "mysql://user:password@localhost/dbname"
secure_database_url = Secure(DATABASE_URL, "<Data Hidden>")
# Usage in code
print(secure_database_url) # Output: <Data Hidden>
```
### Example 2: Custom Usage
```python
from secured import Secure
# Protect an API key with a custom message
API_KEY = "12345-abcdef-67890-ghijk"
secure_api_key = Secure(API_KEY, "API Key Protected")
# Usage in code
print(secure_api_key) # Output: API Key Protected
```
### Example 3: Config Usage
The `Secured` class allows you to securely read configuration files containing sensitive data. Here's how you can use it:
```python
from secured.secured import Secured
# Create a Secured object to read a YAML configuration file
secured = Secured('config.yaml', secure=True)
# Access configuration attributes securely
print(secured.config.name) # Using dot notation
print(secured.config["name"]) # Using dictionary-like notation
```
### Example 4: Compose
```python
from secured.secured import Secured
# Define the custom secure message
message = "🔒 <Data Secured> 🔒"
# Example secured object
CONFIG_PATH = "examples/config.yaml"
DATABASE_URL = "mysql://{user}:{password}@localhost/dbname"
secure = Secured(CONFIG_PATH, secure=True, message=message)
# Usage in code
secure_database_url = secure.compose(DATABASE_URL, user="guest", password="guest_password")
print(secure_database_url) # Output: 🔒 <Data Secured> 🔒
print(secure_database_url.get_original()) # Careful! This will print the original data, do not use it.
print(secure_database_url == "mysql://guest:guest_password@localhost/dbname") # Output: True
```
## Features
- **Data Protection**: Helps prevent the accidental logging or display of sensitive information.
- **Customizable Representations**: Set how your data is displayed when being secured.
- **Ease of Use**: Integrate seamlessly into existing Python applications.
Raw data
{
"_id": null,
"home_page": null,
"name": "secured",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Joao Paulo Euko",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/96/bb/982208c26f8729933c18420143da443c1c476919edeba24e651af2a53dbc/secured-0.1.4.tar.gz",
"platform": null,
"description": "![PyPI - Python Version](https://img.shields.io/pypi/pyversions/secured)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/secured)\n![PyPI](https://img.shields.io/pypi/v/secured)\n[![codecov](https://codecov.io/gh/Joaopeuko/secured/graph/badge.svg?token=W5MF118U50)](https://codecov.io/gh/Joaopeuko/secured)\n![PyPI - Wheel](https://img.shields.io/pypi/wheel/secured)\n![PyPI - License](https://img.shields.io/pypi/l/secured)\n\n# Secured\n\n- [Secured](#secured)\n - [Installation](#installation)\n - [Usage](#usage)\n - [Example 1: Basic Usage](#example-1-basic-usage)\n - [Example 2: Custom Usage](#example-2-custom-usage)\n - [Example 3: Config Usage](#example-3-config-usage)\n - [Example 4: Compose](#example-4-compose)\n - [Features](#features)\n\nSecure your Python data structures and secrets with Secured. This package provides a straightforward solution for obscuring sensitive data in applications. It's specifically designed for developers who need to protect API keys, database credentials, and other critical configuration details from accidental exposure. Featuring customizable security measures, our tool allows you to control how sensitive information is represented and managed securely. It's ideal for projects that demand high data confidentiality and integrity. Please note that this provides a thin layer of protection.\n\n## Installation\n\nTo install Secured, run the following command:\n\n```python\npip install secured\n```\n\n## Usage\n\nBelow are some examples on how to use Secured to protect your sensitive data:\n\n### Example 1: Basic Usage\n\n```python\nfrom secured import Secure\n\n# Protect a sensitive string\nDATABASE_URL = \"mysql://user:password@localhost/dbname\"\nsecure_database_url = Secure(DATABASE_URL, \"<Data Hidden>\")\n\n# Usage in code\nprint(secure_database_url) # Output: <Data Hidden>\n```\n\n### Example 2: Custom Usage\n\n```python\nfrom secured import Secure\n\n# Protect an API key with a custom message\nAPI_KEY = \"12345-abcdef-67890-ghijk\"\nsecure_api_key = Secure(API_KEY, \"API Key Protected\")\n\n# Usage in code\nprint(secure_api_key) # Output: API Key Protected\n```\n\n### Example 3: Config Usage\n\nThe `Secured` class allows you to securely read configuration files containing sensitive data. Here's how you can use it:\n\n```python\nfrom secured.secured import Secured\n\n# Create a Secured object to read a YAML configuration file\nsecured = Secured('config.yaml', secure=True)\n\n# Access configuration attributes securely\nprint(secured.config.name) # Using dot notation\nprint(secured.config[\"name\"]) # Using dictionary-like notation\n```\n\n### Example 4: Compose\n\n```python\nfrom secured.secured import Secured\n\n# Define the custom secure message\nmessage = \"\ud83d\udd12 <Data Secured> \ud83d\udd12\"\n\n# Example secured object\nCONFIG_PATH = \"examples/config.yaml\"\nDATABASE_URL = \"mysql://{user}:{password}@localhost/dbname\"\nsecure = Secured(CONFIG_PATH, secure=True, message=message)\n\n# Usage in code\nsecure_database_url = secure.compose(DATABASE_URL, user=\"guest\", password=\"guest_password\")\nprint(secure_database_url) # Output: \ud83d\udd12 <Data Secured> \ud83d\udd12\nprint(secure_database_url.get_original()) # Careful! This will print the original data, do not use it.\nprint(secure_database_url == \"mysql://guest:guest_password@localhost/dbname\") # Output: True\n```\n\n## Features\n\n- **Data Protection**: Helps prevent the accidental logging or display of sensitive information.\n- **Customizable Representations**: Set how your data is displayed when being secured.\n- **Ease of Use**: Integrate seamlessly into existing Python applications.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": null,
"version": "0.1.4",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e588c4b2b03cad060270d566680ba866331b38b6ed370a87c754406abfa04aea",
"md5": "d911e486f001db4202e6f7827cc41804",
"sha256": "05bdfc654c5cb16e7dd8d79e8514ff131791af2572d53c3eb366d734dbbd13d2"
},
"downloads": -1,
"filename": "secured-0.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d911e486f001db4202e6f7827cc41804",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 8574,
"upload_time": "2024-05-21T08:06:03",
"upload_time_iso_8601": "2024-05-21T08:06:03.206435Z",
"url": "https://files.pythonhosted.org/packages/e5/88/c4b2b03cad060270d566680ba866331b38b6ed370a87c754406abfa04aea/secured-0.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "96bb982208c26f8729933c18420143da443c1c476919edeba24e651af2a53dbc",
"md5": "0485250eae5bb553e0fec017d360a094",
"sha256": "f6f314e8620d9c2edb3086e0e2a6eb36028eb428d9b5780e1a3c802b9b8e0a78"
},
"downloads": -1,
"filename": "secured-0.1.4.tar.gz",
"has_sig": false,
"md5_digest": "0485250eae5bb553e0fec017d360a094",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 7028,
"upload_time": "2024-05-21T08:06:04",
"upload_time_iso_8601": "2024-05-21T08:06:04.889398Z",
"url": "https://files.pythonhosted.org/packages/96/bb/982208c26f8729933c18420143da443c1c476919edeba24e651af2a53dbc/secured-0.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-21 08:06:04",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "secured"
}