Skip to main content

zettings

PyPI Python Versions PyPI - Downloads GitHub issues

Lines Of Code Codecov GitHub Actions Workflow Status

standard-readme compliant license

A configuration/settings utility that that exposes project settings as standard Python dictionaries.

zettings is a Python configuration library designed for simplicity. It loads settings data from TOML files and exposes them as standard Python dictionaries. This allows you to work with settings in a familiar, Pythonic way.

Table of Contents

Features

  • TOML: Uses TOML under the hood for modern settings files.
  • Dictionary: Access and change settings with regular dictionary operations.
  • Nested Keys: Supports nested dictionary keys with dotted key notation.
  • Optional defaults: Provide default values for initializing the settings file or for when a key is missing in the settings file.
  • Optional always_reload: Reload the setting file everytime a key is read. (Enabled by default)
  • Optional filepath: Provide the exact file Path of the .toml file to use. (overrides name)

Install

# PyPI
pip install zettings

or

uv add zettings

Dependencies

Python 3.9 or greater

Usage

Example

This will create/use a 'settings.toml' file located in the '.zettings' directory of the user's home directory.

from zettings import Settings

# Standard Dictionary Format
defaults = {
    "settings": {
        "name": "MyName",
        "mood": "happy",
    },
}
# Dotted Key Notation
defaults = {}
defaults["settings.name"] = "MyName"
defaults["settings.mood"] = "happy"

settings = Settings(".zettings/settings.toml", defaults) # Change 'zettings' to your project's name

print(settings["settings.mood"])
settings["settings.mood"] = "angry"
print(settings["settings.mood"])

Contributing

PRs accepted.

If editing the Readme, please conform to the standard-readme specification.

Bug Reports and Feature Requests

Please use the issue tracker to report any bugs or request new features.

Contributors

License

MIT © Nick Stuer

Metadata

Release files for zettings 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zettings 1.1.0
File Size Uploaded Provenance
zettings-1.1.0.tar.gz 35.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for zettings 1.1.0
File Interpreter ABI Platform
zettings-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 42.3 kB

Release files / zettings-1.1.0.tar.gz

Download URL zettings-1.1.0.tar.gz
Size 35.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0203e6c47469a84c99c9e4f11e478cb58f26f22d067a46f55f9b10e55bae0633
BLAKE2b-256 checksum
How to use checksums
da9c92aba2eeeee62d5ff216ef424d7f86b77517e637cee7e90445c9fe2149da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.0

Release files / zettings-1.1.0-py3-none-any.whl

Download URL zettings-1.1.0-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f9cedba4aab14d6276e71f7c03d2d4d7647f89512e86cbf618f206f9315c0793
BLAKE2b-256 checksum
How to use checksums
0a26b65b9c8640bede75bdeb4ee9ef1d7ca9be2baa15c829b5928d0870a55d2e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.0

Security for zettings 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page