Skip to content

Go-to solution for effortless secret keys management. Securly store and swiftly load your key-value pairs from a local cache.

Notifications You must be signed in to change notification settings

andreakiro/python-keyenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 keyenv, use pip: pip install keyenv.

About

Go-to solution for effortless secret keys management. Securly store and swiftly load your key-value pairs from a local cache.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages