Skip to main content

whereby an artificer uses runes and delicate metalwork to create items capable of amazing feats.

Sygaldry is a Python library for building arbitrary object graphs from YAML or TOML configuration files. It is designed for teams that run many similar scheduled jobs and want to write reusable components, then compose them through configuration rather than code.

Features

  • YAML and TOML configuration with deep-merge includes.

  • Interpolation – ${VAR} placeholders resolved from config paths, environment variables, or defaults.

  • Component instantiation – _type mappings construct classes, _func mappings import callables.

  • References – _ref wires components together by name or dotted attribute path.

  • Instance caching – identical specs share instances; named _instance tags give explicit control.

  • Safety – no eval, no arbitrary code; imports are by dotted path only.

Installation

pip install sygaldry

Quick start

Define your components in a YAML file:

# config.yaml
db:
  _type: "myapp.db.Database"
  host: "${DB_HOST:-localhost}"
  port: 5432

service:
  _type: "myapp.services.UserService"
  db: { _ref: "db" }

Then load and resolve:

from sygaldry import load

graph = load("config.yaml")
service = graph["service"]   # a fully wired UserService instance

Or use the Artificery class for more control:

from sygaldry import Artificery

factory = Artificery("config.yaml", transient=True)
graph = factory.resolve()

License

MIT

Release files for sygaldry 0.5.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 sygaldry 0.5.0
File Size Uploaded
sygaldry-0.5.0.tar.gz 8.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for sygaldry 0.5.0
File Interpreter ABI Platform
sygaldry-0.5.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 8.4 MB

Release files / sygaldry-0.5.0.tar.gz

Download URL sygaldry-0.5.0.tar.gz
Size 8.3 MB
Tags Source
SHA-256 checksum
How to use checksums
a256f091d98a0311b824e4bccd8c9028fb46a3344e9329ea71cee2268a3ea0f2
BLAKE2b-256 checksum
How to use checksums
74ef580cdd287ec101fcdb7f325b45aa0838426c6f82dd11a396509d9172bd44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / sygaldry-0.5.0-py2.py3-none-any.whl

Download URL sygaldry-0.5.0-py2.py3-none-any.whl
Size 31.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
647c9a0441614f0899eff3c879633907cdd94fc910cfab990250231d9bbd8fed
BLAKE2b-256 checksum
How to use checksums
519813445216c353c89d9090713574f51ca18d91326b57ca96d43cd6c866684b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.0.1

2 release files

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