Metadata-Version: 2.1
Name: secretfunctions
Version: 0.0.2
Summary: simple library to keep some things private and secret
Author-email: NeuralDevelopment <neutro2@outlook.de>
License: MIT License
        
        Copyright (c) 2023 NeuralDevelopment
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://dev.azure.com/neuraldevelopment/secretfunctions
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: load_dotenv>=0.1.0
Provides-Extra: dev
Provides-Extra: test

# 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 

```python
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>
