Skip to main content

BetterConfigs

A small package to simplify configuration storing and retrieving

Usage

Using BetterConfigs is as simple as importing the package, calling a new configuration object, and saving whatever you need to a file.

Example Code

  • Import the package with import betterconfigs
  • Create a configuration file object with objectname = betterconfigs.config(filename) where objectname is a blank variable and filename is the string of the configuration file.
  • You can now set properties using objectname[property]=key. Note you cannot use the property version as this is specific to the configuration file and must not be changed.
import betterconfigs
t = betterconfigs.config('test.config')
t['hello'] = 'world'
print(t['hello'])

Encrypting/Decrypting

With version 0.8 of BetterConfigs, you can now encrypt and decrypt your configuration files on the fly. This is great in the case you need to sync configurations, and don't want them to be available to prying eyes.

To get started, use the encryptFile() function after you've created the config object. This will encrypt all existing configurations in the file, as well as provide you with an encryption key stored in the property encKey. When the configuration object is destroyed, the encKey value is also unloaded from memory, so make sure you save it!

To open an encrypted configuration file, create the object again, and set the encKey value to the same one used to encrypt it previously. Then, just access the configuration as normal, and BetterConfigs handles everything for you.

Finally, to decrypt the file, make sure the encKey value is set correctly, and use the decryptFile() function.

Metadata

Release files for betterconfigs 0.8.4

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

Source distribution (sdist)

Source distribution for betterconfigs 0.8.4
File Size Uploaded Provenance
betterconfigs-0.8.4.tar.gz 16.2 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 32.4 kB

Release files / betterconfigs-0.8.4.tar.gz

Download URL betterconfigs-0.8.4.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d027ddb2895caff8443b53b035ae18dff50db6a6baef250af315495794ce1113
BLAKE2b-256 checksum
How to use checksums
8843e660aa0414c0075f700f048328c961a1af518c23892f035a5eee5889c4ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Release files / betterconfigs-0.8.4-py3-none-any.whl

Download URL betterconfigs-0.8.4-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d0a411eec8067d6708166643537ff3a8bde8eb1b8af831bbb21121bb667e237
BLAKE2b-256 checksum
How to use checksums
add082c31467994a23cf98c8106f76bcedee32bfc5d85f692141adc2c5c55ed7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Security for betterconfigs 0.8.4

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