Multipurpose python utils
Project description
jania
Librería Python ultra-minimalista para gestión de configuración: prioridad automática entre entorno, archivos y valores por defecto.
Instalación
pip install jania
Uso
from jania import env, env_config
# Cargar un archivo de configuración custom (opcional)
env_config("settings.toml")
# Obtener variable con prioridad: entorno > archivo custom > config.py > settings.toml > settings.yaml > fallback
valor = env("ENDPOINT_OUT_MSG", "http://localhost:5000")
Soporta archivos de configuración en formato:
- Python (
config.py) - TOML (
settings.toml) - YAML (
settings.yaml) - JSON (
config.json) - TXT (
key=valorpor línea)
Puedes añadir nuevos formatos fácilmente.
Ejemplo completo
Supón que tienes los siguientes archivos en tu proyecto:
config.py
ENDPOINT_OUT_MSG = "http://localhost:8000/msg"
settings.toml
ENDPOINT_OUT_MSG = "http://localhost:8080/msg"
settings.yaml
ENDPOINT_OUT_MSG: "http://localhost:8090/msg"
Entonces:
from jania import env
print(env("ENDPOINT_OUT_MSG", "http://localhost:5000"))
Imprimirá (según prioridad de archivos y entorno).
Licencia
MIT License © 2025 Julian Ania
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
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 jania-0.2.2.tar.gz.
File metadata
- Download URL: jania-0.2.2.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9326997bfe4ab91d4eb81b67a6a115ced3fc20f8e66300d21210322a841b2ebb
|
|
| MD5 |
95907a3d4288b3d708d9065ab2471740
|
|
| BLAKE2b-256 |
540b642faa512f2f6f14b7c7e06da2c8045a73e2fb4cad30cf1267c151d467ce
|
Provenance
The following attestation bundles were made for jania-0.2.2.tar.gz:
Publisher:
publish.yml on julianin/JANIALIB
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jania-0.2.2.tar.gz -
Subject digest:
9326997bfe4ab91d4eb81b67a6a115ced3fc20f8e66300d21210322a841b2ebb - Sigstore transparency entry: 248479163
- Sigstore integration time:
-
Permalink:
julianin/JANIALIB@da2aadde05a6c67bccc44edb9bc487ddb7ab25f6 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/julianin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@da2aadde05a6c67bccc44edb9bc487ddb7ab25f6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file jania-0.2.2-py3-none-any.whl.
File metadata
- Download URL: jania-0.2.2-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc4d1bb3bd5707bc9a66dbe5fd6d55f07cb505487af3c5806fa03c5502dbb984
|
|
| MD5 |
447ed66de453ff143da0416d81cee1cb
|
|
| BLAKE2b-256 |
230799522619bba400967fefecfb1ff0b47e72ca4902a6a2f4a59b8e0a47631b
|
Provenance
The following attestation bundles were made for jania-0.2.2-py3-none-any.whl:
Publisher:
publish.yml on julianin/JANIALIB
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jania-0.2.2-py3-none-any.whl -
Subject digest:
dc4d1bb3bd5707bc9a66dbe5fd6d55f07cb505487af3c5806fa03c5502dbb984 - Sigstore transparency entry: 248479166
- Sigstore integration time:
-
Permalink:
julianin/JANIALIB@da2aadde05a6c67bccc44edb9bc487ddb7ab25f6 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/julianin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@da2aadde05a6c67bccc44edb9bc487ddb7ab25f6 -
Trigger Event:
push
-
Statement type: