Store and load secret key-value pairs from a local cache
Project description
python-keyenv: Your local, safe keyring 🕵️♂️
Go-to solution for effortless secret keys management. This lib/tool allows you to securley store (once for all!) and swiftly load secret key-value pairs from a local cache using dotenv file logic. Now, accessing your favorite API keys across all your projects is as simple as saying hello.
Usage
Save your keys and interact with cache
Run this anywhere in your computer to safely store a key on disk
$ keyenv -n {service name} -sk {secret key}
You can of course update a service's key anytime, or list all services
$ keyenv update -n {service name} -sk {new secret key}
$ keyenv list # this will list all service names
You can also provide path to a json
file to store/update commands
$ keyenv store -p {path/to/json}
$ keyenv update -p {path/to/json}
You could also perform same actions from a Python script if needed
import keyenv as kv
kv.store(service="secret")
kv.update(service="secret")
kv.store("path/to/json/keys")
print(kv.list())
Load your keys across your Python projects
You can then access all of your keys with keyenv.get(service)
in your Python code 🥳
import langchain.llms as llms
import keyenv as kv
os.environ["OPENAI_API_KEY"] = kv.get("openai")
llm = llms.OpenAI()
llm_chain = LLMChain(prompt="Hi my name is", llm=llm)
llm_chain.run()
Installation
🚨 To install python-keyenv
, use pip: pip install python-keyenv
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file keyenv-0.1.0.tar.gz
.
File metadata
- Download URL: keyenv-0.1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.11.2 Darwin/22.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1f80f9de653e17dad71fe5ea6c66096e0a04c5162bbe4a53226e2ce5cef7d2a |
|
MD5 | fc28c26e35f30b0d358aa1a2acb73a38 |
|
BLAKE2b-256 | 72405b5b3d0294089d0540dbcd4c004e988b526a62ce0a2b2ecf929e682eda81 |
File details
Details for the file keyenv-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: keyenv-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.11.2 Darwin/22.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 589b08c408ecd8a2211dc572dfb2c591b13e496b493869fa0617d3afbb74cbef |
|
MD5 | e6e43dd1905872fe8be8271562461d01 |
|
BLAKE2b-256 | add52c14efefce4ed38a15ed8640e49b817c9f57fa3ef1bca7fd1df8ad98e112 |