Find and read your project configuration files easily
Project description
Easily manage your application settings and secrets
Welcome to Stela
Stela were the "information files" of ancient times. This library aims to simplify your project configurations, proposing an opinionated way to manage your project using dotenv files, or using any source you need.
Install
$ pip install stela
Documentation
Key features:
- Learn once, use everywhere. Stela aims to be easily used in any Python project or Framework.
- Separate settings from secrets from environments. Instead of using a single dotenv file to store all your settings, we use multiple dotenv files, one for each environment. This way, you can split secrets from settings, and you can have different values for the same setting in different environments.
- Easy to implement. Use the command
stela init
to initialize your project and configure.env
and.gitignore
files. - Easy to use. To access you configuration just include
from stela import env
in your code. Simple as that. - One Interface, Any Source. You're not limited to dotenv files. Create your custom logic to import data from any source you need.
Quick Start
Run Stela initialization command. This command will create .env
, .env.local
and .gitignore
files.
$ stela init --use-default
# Add this to .env
API_URL="http://localhost:8000"
DB_URL="db://user:password@db:0000/name"
# my_script.py
from stela import env
API_URL = env.API_URL # http://localhost:8000
DATABASE_URL_CONNECTION = env.DB_URL # db://user:password@db:0000/name
# Add to .env.local
DB_URL="db://real_user:real_password@real_db:0000/name"
# my_script.py
from stela import env
API_URL = env.API_URL # http://localhost:8000
DATABASE_URL_CONNECTION = env.DB_URL # db://real_user:real_password@real_db:0000/name
That's it! Just check our Documentation for tons of customization and advice.
Migrating from version 4.x
- Stela 5.0 is a major rework. The old format still works, but we strongly advise updating your code as soon as possible. Please check this document to understand how to update your existing project.
- Drop support to Python 3.8
Not working?
Don't panic. Get a towel and, please, open an issue.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stela-5.0.2.tar.gz
(21.2 kB
view hashes)
Built Distribution
stela-5.0.2-py3-none-any.whl
(28.6 kB
view hashes)