Quickstart
Avoid hard-coding secrets in your projects using ape-keyring.
ape-keyring is built on top of keyring and is an account plugin and secret manager.
By default, keyring uses your OS's secure storage and prompts for authorization upon request.
Thus, keyring is useful for securely managing local developer environments.
This guide demonstrates how to use ape-keyring as an account plugin and secret manager.
Dependencies
- python3 version 3.9 or greater, python3-dev
Installation
via pip
You can install the latest release via pip:
pip install ape-keyring
via setuptools
You can clone the repository and use setuptools for the most up-to-date version:
git clone https://github.com/antazoey/ape-keyring.git
cd ape_keyring
python3 setup.py install
Quick Usage
Use ape-keyring for both accounts and secrets.
Accounts
Use ape-keyring as an account plugin.
You can add existing accounts to keyring to use in your scripts, console, or tests:
ape keyring import keyring_dev_0
It then securely prompts you for your private key.
NOTE: You can only add existing accounts to keyring and generate new ones.
You can delete accounts by doing:
ape keyring accounts delete <alias>
This only deletes the account from keyring and not the blockchain.
To remove all your keyring accounts, run the command:
ape keyring accounts delete-all
Finally, list your accounts by doing:
ape keyring accounts list
Secrets
Use ape-keyring as a secrets managers, such as Infura project IDs, Etherscan API keys, your mother's maiden name.
To add secrets to keyring, do:
ape keyring set WEB3_API_KEY
and then when it prompts you, input the value to your secret.
Optionally, scope your secrets to the active project.
ape keyring set DEPLOYMENT_SECRET --scope project
To enable your secrets to become environment variables at runtime,
use the ape-config.yaml option set_env_vars:
keyring:
set_env_vars: true
Metadata
Release files for ape-keyring 0.8.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ape-keyring-0.8.0.tar.gz | 22.7 kB | Without provenance | Details for ape-keyring-0.8.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ape_keyring-0.8.0-py3-none-any.whl | Python 3 | none | any | Details for ape_keyring-0.8.0-py3-none-any.whl |
Total release size: 39.4 kB
Release files / ape-keyring-0.8.0.tar.gz
| Download URL | ape-keyring-0.8.0.tar.gz |
|---|---|
| Size | 22.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1b101963d43a73493fcfedbeb7e96acd0e0071561e0a5d85db752a639dfca5e7
|
|
BLAKE2b-256 checksum How to use checksums |
ad3c837fdcc5e847ca40e767550a83120e3e9b608bfc12c9eaee9f5176cf5142
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.14
|
Release files / ape_keyring-0.8.0-py3-none-any.whl
| Download URL | ape_keyring-0.8.0-py3-none-any.whl |
|---|---|
| Size | 16.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
009ff63fe629515f422e58f91c8eb1a8b2f5dcb180efd4d6708710e20a843ad1
|
|
BLAKE2b-256 checksum How to use checksums |
10646c5f7bb9545eda44af8e5d7543ad66c3acd72c63d28f4b8062555fbd29d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.10.14
|
Security for ape-keyring 0.8.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.