Skip to main content

Python implementation of Krausening

Project description

Krausening Python - Externalized Property Management and Access for Python Projects

PyPI License

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:

  • Poetry - poetry add krausening
  • pip - pip install krausening

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

krausening-11.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

krausening-11-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file krausening-11.tar.gz.

File metadata

  • Download URL: krausening-11.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.9.13 Darwin/21.6.0

File hashes

Hashes for krausening-11.tar.gz
Algorithm Hash digest
SHA256 b1c58cbb6d872a47d4be01ad4b80a525de629a41184833599386773f81db4ed6
MD5 f405c74f582bc5ea09eba0297a1e847f
BLAKE2b-256 b44f077368e045557cccb3f03c1c9e03ca4137d3babb093abdad556a2eacb2a2

See more details on using hashes here.

File details

Details for the file krausening-11-py3-none-any.whl.

File metadata

  • Download URL: krausening-11-py3-none-any.whl
  • Upload date:
  • Size: 5.8 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

Hashes for krausening-11-py3-none-any.whl
Algorithm Hash digest
SHA256 46381603c686cb424a91e628b0c522eee18e6b52c58506e8a77c59a9448d5d66
MD5 263a0095d38ef6bc4f13a4cee52dc9bd
BLAKE2b-256 378959ad1e7c61997cd9b7487075185463dff9cb2c874d53e1fd1973fc2dd54d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page