Skip to main content

Package to write and hide tokens, passwords, secret keys, without having to put them in the code

Project description

Celare v0.0.3

A package to write and hide tokens, passwords, secret keys, without having to put them in the code!

How to use?

  1. Install the package using pip
pip3 install celare

or

pip3 install celare

2.1 For scripts

2.1.1 Import the celare module inside your code

from celare import celare
from celare.read import read_tokens

2.1.2 Run your code in the terminal and enter the name of the variable and the token for it, as in the example below

python3 your_code.py TOKEN t0k3n SECRET_KEY s3cr3tk3y

2.2 For notebooks

2.2.1 Import the celare module inside your notebook

from celare.celare import celare_notebook
from celare.read import read_tokens

2.2.2 The celare_notebook function receives a dictionary containing the reference (key) and token (value). You can run the notebook cell only when necessary once as the code example below and then discard it.

celare_notebook({"TOKEN": "t0k3n", "SECRET_KEY": "s3cr3tk3y"})
  1. A file called ".tokens.json" will be created in the root directory, where all tokens passed will be saved. If you are going to put your project on GitHub and need to hide this file, import the module that generates a gitignore template automatically or add the file's hiding information if it already exists.
from celare import gitignore
  1. To update a saved token or add a new one, just repeat the step 2. if you only need to run the code, don't worry, you don't need to pass the token arguments every time you run, only when necessary.

  2. To read the tokens file use the read_tokens() function, this will return a dictionary with all the tokens saved before.

tokens = read_tokens()

How to contribute?

  1. Clone this repository to make modifications Using HTTPS
git clone https://github.com/MariaEduardaDeAzevedo/celare.git

or using GitHub CLI

gh repo clone MariaEduardaDeAzevedo/celare
  1. If you don't have modifications to do, just open an issue!

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

celare-0.0.3.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file celare-0.0.3.tar.gz.

File metadata

  • Download URL: celare-0.0.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/51.1.2 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for celare-0.0.3.tar.gz
Algorithm Hash digest
SHA256 17570d6f55ace1e824d4c006bb69efea575615d66eb330902fe9fcfe66214c24
MD5 097d4844c8ca7c14512b590a535aa4b1
BLAKE2b-256 eca91503de7b335c80d36e783b3ae30d7953d343f173afd66ce8bb5e9eb0b67f

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