krausening


Namekrausening JSON
Version 19 PyPI version JSON
download
home_pagehttps://github.com/TechnologyBrewery/krausening
SummaryPython implementation of Krausening
upload_time2024-02-13 15:48:07
maintainer
docs_urlNone
authorEric Konieczny
requires_python>=3.9,<4.0
licenseMIT
keywords properties configuration-management
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Krausening Python - Externalized Property Management and Access for Python Projects #
[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://opensource.org/licenses/mit)
[![PyPI](https://img.shields.io/pypi/v/krausening)](https://pypi.org/project/krausening/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/krausening)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/krausening)

Krausening property management and encryption for Python is packaged using the open-source Python Maven plugin [Habushu](https://bitbucket.org/cpointe/habushu) and made available as a [PyPI package](https://pypi.org/project/krausening/).  

## Distribution Channel

Krausening Python is published to PyPI under the [krausening](https://pypi.org/project/krausening/) project and may be installed using any package installer/manager that leverages PyPI.  For example:

* [Poetry](https://python-poetry.org/) - `poetry add krausening`
* [pip](https://pip.pypa.io/) - `pip install krausening`

## 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_OVERRIDE_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:

```python
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:

```python
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')
```
## 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](https://pypi.org/account/register/) with access to the [krausening](https://pypi.org/project/krausening/) project is required. PyPI account credentials should be specified in your `settings.xml` under the `<id>pypi</id>` `<server>` entry:

```xml
<settings>
  <servers>
    <server>
      <id>pypi</id>
      <username>pypi-username</username>
      <password>pypi-password</password>
    </server>
  </servers>
</settings>
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/TechnologyBrewery/krausening",
    "name": "krausening",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "properties,configuration-management",
    "author": "Eric Konieczny",
    "author_email": "ekoniec1@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/3d/2a/87c907428817af20281826b9ddd85f2a836f6a01af10208942f0c83fc568/krausening-19.tar.gz",
    "platform": null,
    "description": "# Krausening Python - Externalized Property Management and Access for Python Projects #\n[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](https://opensource.org/licenses/mit)\n[![PyPI](https://img.shields.io/pypi/v/krausening)](https://pypi.org/project/krausening/)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/krausening)\n![PyPI - Wheel](https://img.shields.io/pypi/wheel/krausening)\n\nKrausening property management and encryption for Python is packaged using the open-source Python Maven plugin [Habushu](https://bitbucket.org/cpointe/habushu) and made available as a [PyPI package](https://pypi.org/project/krausening/).  \n\n## Distribution Channel\n\nKrausening Python is published to PyPI under the [krausening](https://pypi.org/project/krausening/) project and may be installed using any package installer/manager that leverages PyPI.  For example:\n\n* [Poetry](https://python-poetry.org/) - `poetry add krausening`\n* [pip](https://pip.pypa.io/) - `pip install krausening`\n\n## Managing Properties with Krausening and Python\n\nManaging 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):\n\n* `KRAUSENING_BASE`\n* `KRAUSENING_EXTENSIONS`\n* `KRAUSENING_OVERRIDE_EXTENSIONS`\n* `KRAUSENING_PASSWORD`\n\nIn 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:\n\n```python\nfrom krausening.properties import PropertyManager\n\npropertyManager = PropertyManager.get_instance()\nproperties = None\nproperties = propertyManager.get_properties('my-property-file.properties')\nassert properties['foo'] == 'bar2'\n```\n\nThis 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:\n\n```python\nfrom krausening.properties import PropertyManager\n\nclass TestConfig():\n    \"\"\"\n    Configurations utility class for being able to read in and reload properties\n    \"\"\"\n\n    def __init__(self):\n        self.properties = None\n        self.reload()\n \n    def integration_test_enabled(self):\n        \"\"\"\n        Returns whether the integration tests are enabled or not\n        \"\"\"\n        integration_test_enable = False\n        integration_enable_str = self.properties['integration.test.enabled']\n        if (integration_enable_str):\n            integration_test_enable = (integration_enable_str == 'True')\n        return integration_test_enable\n    \n    def reload(self):\n        self.properties = PropertyManager.get_instance().get_properties('test.properties')\n```\n## Releasing to PyPI\n\nReleasing 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](https://pypi.org/account/register/) with access to the [krausening](https://pypi.org/project/krausening/) project is required. PyPI account credentials should be specified in your `settings.xml` under the `<id>pypi</id>` `<server>` entry:\n\n```xml\n<settings>\n  <servers>\n    <server>\n      <id>pypi</id>\n      <username>pypi-username</username>\n      <password>pypi-password</password>\n    </server>\n  </servers>\n</settings>\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python implementation of Krausening",
    "version": "19",
    "project_urls": {
        "Homepage": "https://github.com/TechnologyBrewery/krausening",
        "Repository": "https://github.com/TechnologyBrewery/krausening"
    },
    "split_keywords": [
        "properties",
        "configuration-management"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b4dcc123540e7bf1c28c4de6df650d61130574456065fb07cd38add4e620639e",
                "md5": "066d3744edda76b6edc05fbce54262b5",
                "sha256": "15b8361e27e37e668caf6596fc51c8591c0e164efccb660b0f0b890b73078109"
            },
            "downloads": -1,
            "filename": "krausening-19-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "066d3744edda76b6edc05fbce54262b5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 7056,
            "upload_time": "2024-02-13T15:48:06",
            "upload_time_iso_8601": "2024-02-13T15:48:06.579200Z",
            "url": "https://files.pythonhosted.org/packages/b4/dc/c123540e7bf1c28c4de6df650d61130574456065fb07cd38add4e620639e/krausening-19-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3d2a87c907428817af20281826b9ddd85f2a836f6a01af10208942f0c83fc568",
                "md5": "ed92ed5f63ac28cc036d29bc2f82b8b0",
                "sha256": "dc9b97074d1ba40bce615452bd7fa9c61d66a31b2175f36d432d62ba902e6976"
            },
            "downloads": -1,
            "filename": "krausening-19.tar.gz",
            "has_sig": false,
            "md5_digest": "ed92ed5f63ac28cc036d29bc2f82b8b0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 5392,
            "upload_time": "2024-02-13T15:48:07",
            "upload_time_iso_8601": "2024-02-13T15:48:07.829189Z",
            "url": "https://files.pythonhosted.org/packages/3d/2a/87c907428817af20281826b9ddd85f2a836f6a01af10208942f0c83fc568/krausening-19.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-13 15:48:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "TechnologyBrewery",
    "github_project": "krausening",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "krausening"
}
        
Elapsed time: 0.17906s