Metadata-Version: 2.1
Name: keyway
Version: 1.0.1
Summary: A solution for persistent environment variables.
Author-email: hardchaos <hardchaos.com@gmail.com>
Project-URL: Homepage, https://github.com/hardchaos/keyway
Project-URL: Bug Tracker, https://github.com/hardchaos/keyway/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE

# 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.

```python 
pip install keyway 
```

Import with
```python
import keyway
kw = keyway.Keyway()
```
Set, access, and delete keys like a dictionary.
```python
kw["alpha"] = "an api key"
kw["bravo"] = "a setting"
kw["charlie"] = 42

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

del kw["alpha"]
```

Missing keys return None.
```python
kw["alpha"]
#>> None
```

Keys are not stored in memory.
```python
kw.keys()
#>> dict_keys([])
```

To retrieve a dictionary of all of a user's keys, use the "all" keyword. All keys are stored as text for simplicity.
```python
kw[all]
#>> {'bravo': 'a variable', 'charlie': '42'}
```

To delete all of a user's keys, use the "all" keyword.
```python
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:
    * ``` python
      kw = keyway.Keyway(path = "your/custom/path", db_name = "custom_name")
      ```
  * You can also optionally set a user for the keyway instance: 
    * ```python
      kw = keyway.Keyway(user = "username")
      ```
* Keyway has no dependencies outside of the standard library. 
* License: MIT
