read key-value pairs from a .kdbx file and can set them as environment variables or return as dict.
Project description
keepass-env
Read key-value pairs from .kdbx
file and can set them as environment variables or return as dict. .kdbx
entries can store key-value attributes. This tool takes a path to entry and loads it's attributes.
install
pip install keepass-env
usage
import keepass_env
entry_path = ['group0', 'subgroup1', 'my_entry']
# load to os.environ
keepass_env.load_env('my_database.kdbx', entry_path)
# return as dict
keepass_env.env_values('my_database.kdbx', entry_path)
{'key-0': 'value-0', 'key-1': 'value-1'}
entry references
This tool supports entry references. For example some entry have following key-value attributes:
key-0 value-0
key-1 ref@group5/entry42:API_TOKEN
Value for key-1
will be loaded from another entry with path ['group5', 'entry42']
and will be taken from its attribute API_TOKEN
.
- Multiple references are supported.
- Default format of references is prefix
ref@
, path separator/
attribute separator:
. This can be configured via arguments toload_env
andenv_values
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
keepass_env-0.0.7.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for keepass_env-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db54d3499e4abc1d62b876a305db4e0c4db51dd888880fe7f1cbd9550a7dcdc3 |
|
MD5 | e49ef772aa5c96bfd7350ff53f4c100a |
|
BLAKE2b-256 | f7e349914d0c4d0f5201f94a918ad3969b6e8b4537596fd3fed7a415baa8f289 |