Skip to main content

No project description provided

Project description

HomeSweetHome

HomeSweetHome is a library providing opinionated home directory and Dynaconf-based configuration for Python projects.

Usage

Let's say that your application is named myapp.

By default HomeSweetHome assumes your application directory is ~/.myapp and that default configuration file for your application is a YML file ~/.myapp/myapp.yml. In order to make sure the following structure is in place, just create SweetHome object.

from homesweethome.homesweethome import SweetHome

sweet_home = SweetHome("myapp")

Now you can read properties from the configuration YML:

from homesweethome.homesweethome import SweetHome

sweet_home = SweetHome("myapp")
host = sweet_home.read_setting("server.host")
port = sweet_home.read_setting("server.port")

Environment variables

You can read settings from environment variables as well using Dynaconf convention (i.e.APPPREFIX_FOO__BAR__BAZ pattern to read foo.bar.baz setting for application prefix APPPREFIX):

from homesweethome.homesweethome import SweetHome

sweet_home = SweetHome("myapp")
host = sweet_home.read_setting("server.host") # export MYAPP_SERVER__HOST
port = sweet_home.read_setting("server.port") # export MYAPP_SERVER__PORT

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

homesweethome-0.5.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.

homesweethome-0.5.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file homesweethome-0.5.0.tar.gz.

File metadata

  • Download URL: homesweethome-0.5.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for homesweethome-0.5.0.tar.gz
Algorithm Hash digest
SHA256 4235202e4c42702af0a2a3e73b683325aa2f2b77af8bab2258172ba1fa17a91c
MD5 e3122adbfb1f4637cb0458f549fdf0da
BLAKE2b-256 d0a4dd9d0b7c453a667896be9746f0866628155fb2f6d6a7074cdf7516e35e6a

See more details on using hashes here.

File details

Details for the file homesweethome-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: homesweethome-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for homesweethome-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f59fac1b8053f85a17da45dd33291da8dc44011b77c83b1fdb0e46ba88e0f888
MD5 7c33554e64facd194ee96056f0181b51
BLAKE2b-256 0e421da2ff52e5e4c0fb217d72b7557fa16980b889f8667f6ce64a2595e96a34

See more details on using hashes here.

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