🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

python-fortress

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

python-fortress

A Python module to securely interact with passfortress.com API for retrieving and loading environment variables from a remote .env file.

1.1.0
PyPI
Maintainers
1

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.

codecov

Features

  • Easy loading and configuration.
  • Secure retrieval of the .env file 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

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts