Skip to main content

Build Status - master branch Coverage of the code quality License

Simple method used to load configuration variables from different sources.

Supports loadings variables from the environment, json file and/or Django settings.

The method will search for the keys in any of the 3 sources and returns the first match.

Search order:

  1. Environment

  2. JSON - used if path is set and the file exists

  3. Django settings - used if Django is installed

This is useful if you need to set configuration variables(SECRET_KEY, DATABASE_NAME, etc…) via environment on a CI server and load the same variables from a json file in a production environment.

Installation

pip install iconf (or add to your requirements.txt)

Usage

import iconf

# find and return keys from environment variables and/or django settings
# and/or json file
configs = iconf.get(keys=["KEY1", "KEY2"], path="configs.json")


# import full json file
configs = iconf.get(path="configs.json")

# import from environment and/or django settings
configs = iconf.get(["KEY1", "KEY2"])

Test

run tests with python -m unittest discover

License

3 Clause BSD.

Bug report and Help

For bug reports open a github ticket. Patches gratefully accepted.

Metadata

Release files for iconf 0.0.2

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

Source distribution (sdist)

Source distribution for iconf 0.0.2
File Size Uploaded Provenance
iconf-0.0.2.tar.gz 2.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for iconf 0.0.2
File Interpreter ABI Platform
iconf-0.0.2-py3.7.egg Legacy Egg format - - Details

Total release size: 6.2 kB

Release files / iconf-0.0.2.tar.gz

Download URL iconf-0.0.2.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
43b1439dd03d94c195cc1b31a103bed77e4fce3264c7b64060b0139fa237ebb7
BLAKE2b-256 checksum
How to use checksums
b90e515f33c829cf9aacaff82b6f47a2df1d9758e7915824458eba8cfdce4e38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / iconf-0.0.2-py3.7.egg

Download URL iconf-0.0.2-py3.7.egg
Size 3.4 kB
Tags Egg
SHA-256 checksum
How to use checksums
cc97acb2cb6c2f3fd6297bd1cd4474323e31431a4b8911214af544a15690a14d
BLAKE2b-256 checksum
How to use checksums
2147ace6bbde0a0663478f419813fd24396630d4516653ea587497ce66aff783
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for iconf 0.0.2

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.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

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