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.2.2.tar.gz (3.1 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.2.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

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

Hashes for jania-0.2.2.tar.gz
Algorithm Hash digest
SHA256 9326997bfe4ab91d4eb81b67a6a115ced3fc20f8e66300d21210322a841b2ebb
MD5 95907a3d4288b3d708d9065ab2471740
BLAKE2b-256 540b642faa512f2f6f14b7c7e06da2c8045a73e2fb4cad30cf1267c151d467ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for jania-0.2.2.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.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

Hashes for jania-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dc4d1bb3bd5707bc9a66dbe5fd6d55f07cb505487af3c5806fa03c5502dbb984
MD5 447ed66de453ff143da0416d81cee1cb
BLAKE2b-256 230799522619bba400967fefecfb1ff0b47e72ca4902a6a2f4a59b8e0a47631b

See more details on using hashes here.

Provenance

The following attestation bundles were made for jania-0.2.2-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