Skip to main content

Dependency injection library

Project description

FunDI logo

# FunDI

Solution for problem no one had before

Fun stays for function(or for fun if you wish) and DI for Dependency Injection

This library provides fast(to write!) and convenient(to use!) Dependency Injection for functional programming on python.

Why?

This library was inspired by FastAPI's dependency injection. The reasons for its existence are simple:

  • A standalone dependency injection library. DI shouldn't be tied to a specific framework.
  • It simplifies code writing. Dependency injection reduces boilerplate and improves maintainability.
  • Lack of DI libraries for functional programming in Python. Or maybe I just didn't want to find one :3

No more words, let's try!

from fundi import scan, from_, inject


def require_user():
    return "Alice"


def greet(user: str = from_(require_user)):
    print(f"Hello, {user}!")


inject({}, scan(greet))

See the documentation to get more examples: https://fundi.readthedocs.io/en/stable/

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

fundi-1.6.1.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

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

fundi-1.6.1-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file fundi-1.6.1.tar.gz.

File metadata

  • Download URL: fundi-1.6.1.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fundi-1.6.1.tar.gz
Algorithm Hash digest
SHA256 eb06fa37638fc22296e847e5ca68a31b87d48314880bdd113859131cfb7096d7
MD5 0e2c62244600674bf7743ad831d373a7
BLAKE2b-256 f153e6987fb0c456568c91aa6800254fac465e2f5d2bd3f84d45dab895c7a85f

See more details on using hashes here.

File details

Details for the file fundi-1.6.1-py3-none-any.whl.

File metadata

  • Download URL: fundi-1.6.1-py3-none-any.whl
  • Upload date:
  • Size: 29.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fundi-1.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 10c3e76b664f1eaf7dbe2cc40f128c60dfc236af7d09db15957b7621315399de
MD5 dfc9672782cad68fb3ce88113784afce
BLAKE2b-256 08e9ad1978cdd654ccdd6b80025facd685f056a80298e25e1d8d76cb7262f120

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