Skip to main content

A small package to simplify configuration storing and retrieving

Project description

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.

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

betterconfigs-0.8.4.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

betterconfigs-0.8.4-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file betterconfigs-0.8.4.tar.gz.

File metadata

  • Download URL: betterconfigs-0.8.4.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for betterconfigs-0.8.4.tar.gz
Algorithm Hash digest
SHA256 d027ddb2895caff8443b53b035ae18dff50db6a6baef250af315495794ce1113
MD5 4f46ddc6762743e7161d3502f928e1b3
BLAKE2b-256 8843e660aa0414c0075f700f048328c961a1af518c23892f035a5eee5889c4ea

See more details on using hashes here.

File details

Details for the file betterconfigs-0.8.4-py3-none-any.whl.

File metadata

File hashes

Hashes for betterconfigs-0.8.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2d0a411eec8067d6708166643537ff3a8bde8eb1b8af831bbb21121bb667e237
MD5 f6f428ecc432cf6e2205c27e8aabe6a2
BLAKE2b-256 add082c31467994a23cf98c8106f76bcedee32bfc5d85f692141adc2c5c55ed7

See more details on using hashes here.

Supported by

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