Skip to main content

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

ez_credentials-1.2.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

ez_credentials-1.2.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file ez_credentials-1.2.0.tar.gz.

File metadata

  • Download URL: ez_credentials-1.2.0.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.6 Darwin/23.6.0

File hashes

Hashes for ez_credentials-1.2.0.tar.gz
Algorithm Hash digest
SHA256 8905f17ab2253d73e897b2b3b35b0edb10d45c14ab1f72f6f5391dd0f0e43174
MD5 d0ed08ec70ebac4e5084b6c89e2a8165
BLAKE2b-256 39e782ca7833b00b70311d4ba7264066b2682ad666ea066f295079732b9ba144

See more details on using hashes here.

File details

Details for the file ez_credentials-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: ez_credentials-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.11.6 Darwin/23.6.0

File hashes

Hashes for ez_credentials-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1bb8cc080ae081924c867ad28fa290a7b7ac6f1666b52223cd8d1c881c91b4c9
MD5 38612dbb7c9ab4f1696b4ae6a962cd17
BLAKE2b-256 7e36abe9cba6e82fbaf90f91085226fa1fac3269e077170716416483474ea334

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page