Skip to main content

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=valor por 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jania-0.1.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jania-0.1.0-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file jania-0.1.0.tar.gz.

File metadata

  • Download URL: jania-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for jania-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d0d96147ba503cb5f35ebdd94e1ad418a5c56095f8f93cd2c78b8a940d70a1d5
MD5 aa4f5b472622e789c70d825d142fc4b6
BLAKE2b-256 763de8262132f86b54b3158629a6c0880b769facb0ca917666184e20e80292db

See more details on using hashes here.

Provenance

The following attestation bundles were made for jania-0.1.0.tar.gz:

Publisher: publish.yml on julianin/JANIALIB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jania-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: jania-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 2.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for jania-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a508947330e067c4ee867d49f039bdc5d96287ed0ee8a8cea791b7e727e646f4
MD5 94347d40caf327e53251da15b8633a4c
BLAKE2b-256 bc7bbf595ef51aa106856823c36215538f5e5dec84f976918b083ab6aece55cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for jania-0.1.0-py3-none-any.whl:

Publisher: publish.yml on julianin/JANIALIB

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page