Easy credentials management using keyring
Project description
Easy credentials
Simple set of classes to manage credentials (user/pwd, token...)
Installation
Classic through pip or your favourite package manager:
pip install ez-credentials
Usage
Instantiate a credential manager. The instance is callable and returns the credentials. You can also get the credentials as a dictionnary or as a tuple.
from ez_credentials import CredentialManager
cred = CredentialManager('test')
cred()
You'll be prompted for your credentials. They will be stored in your keyring.
'test' is the name of the service. You can define several credential managers with different service names.
Optionally, you cat set how long the credentials should be stored, i.e. how frequently the password is asked for. This is defined in seconds, and default to 30 days.
from time import sleep
from ez_credentials import CredentialManager
cred = CredentialManager('test', expires_in=1)
cred()
sleep(1)
cred()
There are other classes (TokenManager, TokenCredentialManager, WebServiceTokenManager and WebServiceTorkenManager; and some aliases).
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
File details
Details for the file ez_credentials-1.2.1.tar.gz
.
File metadata
- Download URL: ez_credentials-1.2.1.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e4214ee3f9e7879b7bc134c7f26bd92f69db29e38f311ee9c1811b4b939e555 |
|
MD5 | 4afbabc18e9b8b2960e5379c24b5ddff |
|
BLAKE2b-256 | 5cd42c895b753f7c83c6425fa1737f020fd101873490f613111dfcd588b6dcc8 |