Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pyxdi

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pyxdi

Dependency Injection library

  • 0.18.1
  • PyPI
  • Socket score

Maintainers
1

PyxDI

PyxDI is a modern, lightweight and async-friendly Python Dependency Injection library that leverages type annotations (PEP 484) to effortlessly manage dependencies in your applications.

CI codecov Documentation Status


Documentation

http://pyxdi.readthedocs.io/


Requirements

Python 3.8+

and optional dependencies:

  • anyio (for supporting synchronous resources with an asynchronous runtime)

Installation

Install using pip:

pip install pyxdi

or using poetry:

poetry add pyxdi

Quick Example

app.py

from pyxdi import dep, PyxDI

di = PyxDI()


@di.provider(scope="singleton")
def message() -> str:
    return "Hello, world!"


@di.inject
def say_hello(message: str = dep) -> None:
    print(message)


if __name__ == "__main__":
    say_hello()

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc