Skip to main content

apywire

PyPI version Python versions License CI Docs

Lazy object wiring and dependency injection for Python 3.12+

Features

  • 🚀 Lazy Loading
  • ⚡ Async Support
  • 🔒 Thread Safety
  • 📦 Code Generation
  • 📄 Naturally Configurable
  • 🧩 Overlayable
  • 🎯 Zero Dependencies

Installation

uv pip install apywire

Quick Example

from apywire import Wiring

spec = {
    "datetime.datetime now": {"year": 2025, "month": 1, "day": 1},
    "MyService service": {"start_time": "{now}"},  # Dependency injection
}

wired = Wiring(spec)
service = wired.service()  # Lazy instantiation + caching

spec is a plain dictionary. It can be written in Python, or come from a config file, apywire doesn't care.

Specs overlay, so a library can ship defaults and a user's config can extend them instead of restating them:

from apywire import Wiring, merge_specs

defaults = {"myapp.Registry registry": {"repos": ["{builtin}"]}}
user = {"registry": {"+repos": ["{my_repo}"]}}  # append, don't replace

wired = Wiring(merge_specs(defaults, user))

Documentation

📚 Full DocumentationGetting StartedAPI ReferenceExamples

Build docs locally:

make docs-serve  # http://127.0.0.1:8000

Development

uv sync --extra dev  # Setup
make all             # Format, lint, test, build

See docs/development.md for guidelines.

License

ISC License - see LICENSES/ISC.txt

Download files

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

Source Distribution

apywire-1.1.0.tar.gz (231.0 kB view details)

Uploaded Source

Built Distribution

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

apywire-1.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (814.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

File details

Details for the file apywire-1.1.0.tar.gz.

File metadata

  • Download URL: apywire-1.1.0.tar.gz
  • Upload date:
  • Size: 231.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for apywire-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d6126979dca383ea2119391b41a71e966432320fa7e55de7218a1ce06783370a
MD5 d873d6229b381dfd5e7df5ec1183adbb
BLAKE2b-256 e7e4d9215bd254071d3d00738a2eb2f9c0f2df5b5bd11f1e57544f8d23dca266

See more details on using hashes here.

File details

Details for the file apywire-1.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for apywire-1.1.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 89e35c176edeb8f9b7b3ce19ae332f630abfb6ed7c7595a142d5d1a05e9fb915
MD5 e0e9699f3136d4b58f901932025b1801
BLAKE2b-256 035d76848b273ce2464f0a75c9f29386cecc721bf4e29ad2e7e818e4b279ab95

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.2.0

2 files

0.1.0

2 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