Skip to main content

appfx-di

CI Publish PyPI Python versions License: MIT

appfx-di provides a small, dependency-free dependency injection container for Python applications and reusable appfx components.

Package identity

Purpose Name
Distribution appfx-di
Import namespace appfx.di
Repository https://github.com/Dongbumlee/appfx-di
Supported Python 3.12, 3.13

Installation

python -m pip install appfx-di

For local development:

python -m pip install --upgrade pip
python -m pip install -e ".[dev]"

Quickstart

from appfx.di import Container, Lifetime


class Greeter:
    def greet(self) -> str:
        return "hello"


class LoudGreeter(Greeter):
    def greet(self) -> str:
        return "HELLO"


container = Container()
container.add_type(Greeter, lifetime=Lifetime.SINGLETON)
container.add_type(Greeter, LoudGreeter, name="loud")

default_greeter = container.get_service(Greeter)
loud_greeter = container.get_service(Greeter, name="loud")

assert default_greeter.greet() == "hello"
assert loud_greeter.greet() == "HELLO"

Scoped services

from appfx.di import Container, Lifetime

container = Container()
container.add_type(RequestState, lifetime=Lifetime.SCOPED)

async with container.create_scope() as scope:
    first = scope.get_service(RequestState)
    second = scope.get_service(RequestState)
    assert first is second

Scoped services must be resolved within an active scope. Scope disposal cleans up created scoped services in reverse creation order. shutdown_async() cleans up created singleton instances and clears singleton caches.

Validation

python -m ruff check .
python -m ruff format --check .
python -m pytest --cov
python -m mypy
python -m build
python -m twine check dist\*

Metadata

Release files for appfx-di 0.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 appfx-di 0.1.0
File Size Uploaded Provenance Actions
appfx_di-0.1.0.tar.gz 13.1 kB With provenance Details for appfx_di-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for appfx-di 0.1.0
File Interpreter ABI Platform Actions
appfx_di-0.1.0-py3-none-any.whl Python 3 none any Details for appfx_di-0.1.0-py3-none-any.whl

Total release size: 22.7 kB

Release files / appfx_di-0.1.0.tar.gz

Download URL appfx_di-0.1.0.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bb34625b679d8e2da656d0664f2292c79d3608c118e036e7e36be9f885c749b5
BLAKE2b-256 checksum
How to use checksums
de7583f50eab4065bb52bcfb1f35d26df300298aa57aa52f1fe146e06f42cfb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / appfx_di-0.1.0-py3-none-any.whl

Download URL appfx_di-0.1.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a63b173a58add39d66e22ffa3c2db6977d4e6ebcd37211b746c77460b2ddbf30
BLAKE2b-256 checksum
How to use checksums
5e95da81dad29b25eb906c6bc3bbdb7913f0bdbc05ec023bad8a4bebb39f8ece
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Security for appfx-di 0.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for appfx_di-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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