Skip to main content

A solution for persistent environment variables.

Project description

Keyway

Persistent environment variables!

A simple solution to prevent accidentally uploading your api keys to github. Functions similarly to normal environment variables, except the keys and values persist through restarts without having to use Bash.

import keyway
kw = keyway.Keyway()

Set, access, and delete keys like a dictionary.

kw["alpha"] = "an api key"
kw["bravo"] = "a setting"
kw["charlie"] = 42

kw["alpha"]
#>> "an api key"

del kw["alpha"]

Missing keys return None.

kw["alpha"]
#>> None

Keys are not stored in memory.

kw.keys()
#>> dict_keys([])

To retrieve a dict of all of a user's keys, use the "all" keyword. All keys are stored as text for simplicity.

kw[all]
#>> {'bravo': 'a variable', 'charlie': '42'}

To delete all of a user's keys, use the "all" keyword.

del kw[all]
kw[all]
#>> {}
  • By default, keys are stored in the active environment folder
    • Never upload your virtual environment to github.
    • Optionally set a custom path and/or database name like:
      • kw = keyway.Keyway(path = "your/custom/path", db_name = "custom_name")
        
    • You can also optionally set a user for the keyway instance:
      • kw = keyway.Keyway(user = "username")
        
  • Keyway has no dependencies outside of the standard library.
  • License: MIT

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

keyway-1.0.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

keyway-1.0.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file keyway-1.0.0.tar.gz.

File metadata

  • Download URL: keyway-1.0.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for keyway-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a493981a1f122b43cf06d65e5fe3ca86d0a26db89cfa7455937ed2dfd04c3009
MD5 aa78ceea158e3097499c009669c79ac8
BLAKE2b-256 f72f6ce2e02442f40daf04f6eaf6aa08dfb6b67abb36d6ae0499ad85f49ceb4d

See more details on using hashes here.

File details

Details for the file keyway-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: keyway-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for keyway-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 529c128eeff17b0bf5db23aaf5c6b4d5660ea62ad54870a46bd0a52b17111f31
MD5 43047b711c41742cb4fba63dff758875
BLAKE2b-256 41d9f9e0e8eac57d55283d6a288dd8421c312cd579187b22c1e259a8de1d81b8

See more details on using hashes here.

Supported by

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