Skip to main content

A package to wire up objects

Project description

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
  • 🎯 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.

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

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

apywire-1.0.4.tar.gz (198.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.0.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (719.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

File details

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

File metadata

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

File hashes

Hashes for apywire-1.0.4.tar.gz
Algorithm Hash digest
SHA256 eaa3dbdb07febf13b12e0f784c48604134eda32898e082c5521f99673b1a8726
MD5 b36b9daf238bb723ade7b530c3af44e5
BLAKE2b-256 19fc6deacd26716755aaffe282faba0a416dfcf2bf1d986d0855e10a1564271c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for apywire-1.0.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 556c41f78819862e70603f31e9cc13e367b73a0329b55da949e6eb6a8496ea02
MD5 3de2caf115b0a9369b7b02cb795147a3
BLAKE2b-256 16442bf2248cfc83de1ba70b748a3f5d7b2fcc67e157a5774d979550cf5e5014

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