Skip to main content

Retrieve API authorization tokens from the environment by it`s names.

Project description

This package contains only a class with only one __init__ which retrieves the requested environment variables.

from tokens import Tokens  # as it all the that the package provides

For instance, we've to get some authorization tokens that already defined in the environment to interact with the Discord API and the Telegram API.

tokens = Tokens(["discord", "telegram"])

The class "Tokens" on initialization will retrieve as attributes these tokens from the environment as "PACKAGE_DISCORD_TOKEN" and "PACKAGE_TELEGRAM_TOKEN" or just "DISCORD_TOKEN" and "TELEGRAM_TOKEN" if the __name__ is undefined.

bot.run(tokens.discord)

The attribute "discord" should contain a string of the token if it has been in the environment, as the same as for "telegram".

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

tokens-retriever-0.0.1.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tokens_retriever-0.0.1.1-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file tokens-retriever-0.0.1.1.tar.gz.

File metadata

  • Download URL: tokens-retriever-0.0.1.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for tokens-retriever-0.0.1.1.tar.gz
Algorithm Hash digest
SHA256 4fa66afd374e64cfb687c132963c8393e8f81997de4df2744dce959ec68bb79f
MD5 9e8e561e48daf683b53fa28b4ce751d1
BLAKE2b-256 5ffb9a4afb019d9bee08e4eec003500fc0078c8594b4e91f88ace6b7e6b87251

See more details on using hashes here.

File details

Details for the file tokens_retriever-0.0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for tokens_retriever-0.0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e23bb0db815f4eb9ae749e875661fd0aeae0970b57b26256aa6711c1328f2de7
MD5 7a89c124791edaabc5e1b0dd29016d5b
BLAKE2b-256 a92d2deb3e1c18da156d6a8e2cc230eedcfd30410d016d988c95f4ae84ba2c6c

See more details on using hashes here.

Supported by

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