A simple project to deal with encrypted toml files
Project description
Encrypted TOML (eTOM)
A Python library for handling encrypted TOML files.
Installation
You can install the library using pip:
pip install etom
Usage
Here's a basic example of how to use the EncryptedTOML class:
from etom import EncryptedTOML
# Create an instance
etom = EncryptedTOML()
# Save encrypted TOML data
data = {"section": {"key": "value"}}
etom.save(data, "config.encrypted.toml")
# Load and decrypt TOML data
loaded_data = etom.load("config.encrypted.toml")
# Update existing encrypted TOML file
new_data = {"section": {"new_key": "new_value"}}
etom.update("config.encrypted.toml", new_data)
# Update a specific key
etom.update_key("config.encrypted.toml", ["section", "specific_key"], "specific_value")
# Convert to JSON
json_str = etom.to_json("config.encrypted.toml")
# Create from JSON
etom.from_json(json_str, "new_config.encrypted.toml")
Running Tests
To run the tests, use the following command:
poetry run pytest
License
This project is licensed under the Gpl-3.0 License - see the LICENSE file for details.
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
etom-0.1.0.tar.gz
(2.1 kB
view details)
Built Distribution
etom-0.1.0-py3-none-any.whl
(2.5 kB
view details)
File details
Details for the file etom-0.1.0.tar.gz
.
File metadata
- Download URL: etom-0.1.0.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.0 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7463fa1e8ab3d02ac47ba98f03d6f7b30dc6fc981ef0589c7d1fa0315f48c4b |
|
MD5 | d955a2a2624290981aaaebdfdf3f3709 |
|
BLAKE2b-256 | 058c8cd34b7a8235314fd7cb9adbeb837202f3ff6557be0a884e10a63846046b |
File details
Details for the file etom-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: etom-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.0 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 406620d20b6ff746f3bf491e1c1fb0508e7982efed87b096bb9e5bd2d1dffa62 |
|
MD5 | 383990b3a2baa6e196f862c90acbdaac |
|
BLAKE2b-256 | be561476c9fe31aacec73a82a10e634509518f8f798fdfbb3a3f5b6c7dafdfff |