Skip to main content

simple library to keep some things private and secret

Project description

Introduction

secretfunctions is a simple library to have a common interface for requesting secret elements like passwords etc. we used python-decouple module but and it works fine in the beginning but after a while when using more and more modules it was not clear which file decouple really is using for loading the secrets. In the end we couldn't figure out when a file was used and how. So before investing too much time, we decided to write this simple wrapper over a dotenv file and make a query function.

The class SecretFunction has a singleton and in the constructor the file "~/.env" is loaded. With the function get_secret_key() you can query the values and receive either the value itself or a default, which is None by default.

Getting Started

The module has one class SecretFunction with one method get_secret

Installing

pip install secretfunction

Usage

SecretFunctions

import secretfunctions

secret_handler = secretfunctions.SecretFunctions()
print(secret_handler.get_secret_key("EOD2PD_API_KEY"))

if your ~/.env file exists and you have a key "EOD2PD_API_KEY in there, you receive the value of the key, otherwise you receive None.

That simple.

Project Homepage

https://dev.azure.com/neuraldevelopment/secretfunctions

Contribute

If you find a defect or suggest a new function, please send an eMail to neutro2@outlook.de

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

secretfunctions-0.0.2.tar.gz (4.2 kB view hashes)

Uploaded Source

Built Distribution

secretfunctions-0.0.2-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

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