A Python module to securely interact with passfortress.com API for retrieving and loading environment variables from a remote .env file.
Project description
Python Fortress
Python Fortress is a library designed to facilitate interaction with an API to retrieve an .env file and load its values into your environment variables. It's designed for securely and efficiently loading environment variables from a remote source.
Features
- Easy loading and configuration.
- Secure retrieval of the
.envfile content from passfortress.com API. - Simple and efficient usage with intuitive methods.
Installation
To install the project dependencies, run:
pip install -r requirements.txt
Basic usage
The main module fortress.py provides the Fortress class and a convenience function configure() and load_env().
You just need configure your Fortress instance and then, call the load_env() method with desired envfile id.
Example:
from python_fortress.fortress import Fortress
credentials = {
"api_key": "<YOUR_API_KEY>",
"access_token": "<YOUR_ACCESS_TOKEN>",
"master_key": "<YOUR_MASTER_KEY>"
}
fortress = Fortress()
fortress.configure(**credentials)
fortress.load_env(envfile_id="<YOUR_ENVFILE_ID>")
Tests
The project comes with a set of tests to ensure everything works as expected. You can run the tests using pytest:
pip install -r requirements_dev.txt
pytest
To obtain a coverage report:
coverage run -m pytest
coverage report
CI/CD
Thanks to GitHub Actions, each push or pull request will trigger the CI pipeline which will run tests and calculate code coverage.
Contribution
If you're interested in contributing to the project, please follow these steps:
- Fork repository.
- Create a new branch for your feature or fix.
- Implement your change or fix.
- Run the tests to make sure everything is working as expected.
- Open a pull request.
Licencia
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_fortress-1.1.0.tar.gz.
File metadata
- Download URL: python_fortress-1.1.0.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.16 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ab8b2aba86112ee37304124c850daa0ed6945edddf551e302efc608c2a64309
|
|
| MD5 |
6c3616c6c4e71ddbb0a654ec06210420
|
|
| BLAKE2b-256 |
240e2f7b4d7fc456b11ce6231213aa78950dadbf676574cf892d58dd2a7f2a0d
|
File details
Details for the file python_fortress-1.1.0-py3-none-any.whl.
File metadata
- Download URL: python_fortress-1.1.0-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.16 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17f977065884b20553ac9c8f01ae9eed8625bb290bef627b3c45ecbeebc4479a
|
|
| MD5 |
9005862a370b55a71ea2db7a614fefbd
|
|
| BLAKE2b-256 |
9cfdb1c0a057f445af4c10a0eebc6cefb503cda7ceedca2f29f8f6bdfb506257
|