Skip to main content

pypi versions license

globconf

  • Creates a global configparser object, regardless of the project and module in need of it
  • A docker container can be used to host protected config files, consumable by the parser object
  • verify_required_options merges default options with the configparser ones, and optionally ENV options while validating required options have been set either way.

Getting Started

In a project using globconf:

from globconf import config, verify_required_options, read_config, fetch_config
# when starting the app, the config can be loaded from a specific path:
read_config(path='flaf.ini', force=True)  # reloads config, even if it already is loaded

# or from the globconfd container - caching supported as convenience for offline devs:
fetch_config('http://127.0.0.1:5000/cfg.ini', 'user', 'pass', cache_timeout=86400, force=True)

# if config is not explicitly loaded, config.ini is read from current folder (if there).

# verify_required_options checks presence of options, yielding a dict with the merged options 
# for the section
DEFAULTS = {'required': None, 'optional_a': 1234}
cfg = verify_required_options('Some section', ['required', 'options', 'for', 'the', 'section'])
 
# beyond this, its still basic ConfigParser as you know it..

In modules:

from globconf import verify_required_options
class cls(object):
    def __init__(self):
        self.cfg = verify_required_options('service now', ['host', 'user', 'pwd'])
        if self.cfg.get('verify_ssl', True) is False:
            import urllib3
            urllib3.disable_warnings(InsecureRequestWarning)

And your module is happy as long as someone has initialised the needed section in the global config.

globconfd via docker

docker run -it -v ./users.conf:env_users.conf -v ./cfgs:/configs -p 5000:5000 ssch/globconfd:latest -d

Prerequisites

configparser, diskcache, requests

Building

Build:

sudo python setup.py sdist bdist_wheel
twine upload dist/*

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

Nahh..

Metadata

Release files for globconf 0.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for globconf 0.0.7
File Size Uploaded Provenance Actions
globconf-0.0.7.tar.gz 8.1 kB Without provenance Details for globconf-0.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for globconf 0.0.7
File Interpreter ABI Platform Actions
globconf-0.0.7-py3-none-any.whl Python 3 none any Details for globconf-0.0.7-py3-none-any.whl

Total release size: 17.6 kB

Release files / globconf-0.0.7.tar.gz

Download URL globconf-0.0.7.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
005439f765e6e914254ba6bec79f6d52d8a419ae2362805c54f59eee6a85d2e9
BLAKE2b-256 checksum
How to use checksums
2f404dcdba265f9bca46edafd8f970c4fbdac180128b05fc04004b56e607bfe0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.4

Release files / globconf-0.0.7-py3-none-any.whl

Download URL globconf-0.0.7-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f06e1c40bd8756bab714e25e81c5eda8928ca8732f71497caca585d62578c2e
BLAKE2b-256 checksum
How to use checksums
67e3dfd00ef035cb56c95e2c095e9b5af7a6577612520f50367a513ce52dd89a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.4

Security for globconf 0.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page