Python implementation of Krausening
Project description
Krausening Python - Externalized Property Management and Access for Python Projects
Krausening property management and encryption for Python is packaged using the open-source Python Maven plugin Habushu and made available as a PyPI package.
Managing Properties with Krausening and Python
Managing properties with Krausening's Python library utilizes a similar approach to that required by Krausening Java. Krausening Python expects that developers prime their target environment by configuring the following environment variables (which are named and leveraged in the same manner as the Java System Properties expected by Krausening Java):
KRAUSENING_BASE
KRAUSENING_EXTENSIONS
KRAUSENING_PASSWORD
In order to use the Krausening Python, developers may directly use PropertyManager
or extend PropertyManager
to provide a custom interface. For example, developers may directly use the PropertyManager
as such:
from krausening.properties import PropertyManager
propertyManager = PropertyManager.get_instance()
properties = None
properties = propertyManager.get_properties('my-property-file.properties')
assert properties['foo'] == 'bar2'
This has the disadvantage that you must know the property keys in order to find the corresponding property values. To mitigate the need for all property file consumers to rely on specific property keys, consider wrapping the PropertyManager
and writing your own custom methods to get the corresponding keys and values, abstracting away the exact key values:
from krausening.properties import PropertyManager
class TestConfig():
"""
Configurations utility class for being able to read in and reload properties
"""
def __init__(self):
self.properties = None
self.reload()
def integration_test_enabled(self):
"""
Returns whether the integration tests are enabled or not
"""
integration_test_enable = False
integration_enable_str = self.properties['integration.test.enabled']
if (integration_enable_str):
integration_test_enable = (integration_enable_str == 'True')
return integration_test_enable
def reload(self):
self.properties = PropertyManager.get_instance().get_properties('test.properties')
Note: Due to updates the M1 Apple Chip, we strongly recommend using Python >= 3.9 for compatibility reasons.
Distribution Channel
Krausening Python is published to PyPI under the krausening project and may be installed using any package installer/manager that leverages PyPI. For example:
Releasing to PyPI
Releasing Krausening Python integrates into the project's larger utilization of the maven-release-plugin
, specifically publishing the package to PyPI during the deploy
phase. A PyPI account with access to the krausening project is required. PyPI account credentials should be specified in your settings.xml
under the <id>pypi</id>
<server>
entry:
<settings>
<servers>
<server>
<id>pypi</id>
<username>pypi-username</username>
<password>pypi-password</password>
</server>
</servers>
</settings>
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
File details
Details for the file krausening-13.tar.gz
.
File metadata
- Download URL: krausening-13.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.9.13 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 109608f458bfdf69a2cf078bc43c627b1a853c89d4d2ee066128931a461147e5 |
|
MD5 | b2d25c2b153a7f46c70c94c902c76eb8 |
|
BLAKE2b-256 | ad400121463188b414255ea452745460d73795d945ba825ee9e6e1c30a7f949b |
File details
Details for the file krausening-13-py3-none-any.whl
.
File metadata
- Download URL: krausening-13-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.9.13 Darwin/21.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b346d11004f26e9e8341b456ed2a3ac6709e4a7fcaff4fa8070e5f4ec5a3be97 |
|
MD5 | d0036c9690380c8a603ca3e0c25da578 |
|
BLAKE2b-256 | 7394637ac6e6f6e8463b723d5884d2d5e2492b52d15356927d92ec447f30fd85 |