Pinject is a lightweight dependency-injection library for Python that favors explicit wiring and testability over magic. Instead of global singletons, you declare providers (bindings) that describe how to construct objects, and Pinject resolves the graph by inspecting call signatures. Its container supports constructor injection and fine-grained scoping so you can share expensive resources while keeping tests isolated. The library leans on Python’s introspection to minimize boilerplate, making it natural to adopt in codebases that already rely on type hints or keyword arguments. Because bindings are just Python functions and classes, refactoring remains straightforward and the DI graph is easy to reason about. Pinject is particularly useful for medium-to-large services where configuration, logging, data clients, and business logic need clean separation without resorting to manual plumbing.

Features

  • Constructor-based injection using Python introspection
  • Simple binding definitions for classes, factories, and constants
  • Scopes for per-request, singleton, and custom lifetimes
  • Override and test doubles support for unit and integration tests
  • Minimal boilerplate with clear, explicit wiring
  • Works with type hints and keyword arguments for readability

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

Apache License V2.0

Follow Pinject

Pinject Web Site

Other Useful Business Software
The AI-powered unified PSA-RMM platform for modern MSPs. Icon
The AI-powered unified PSA-RMM platform for modern MSPs.

Trusted PSA-RMM partner of MSPs worldwide

SuperOps.ai is the only PSA-RMM platform powered by intelligent automation and thoughtfully crafted for the new-age MSP. The platform also helps MSPs manage their projects, clients, and IT documents from a single place.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Pinject!

Additional Project Details

Programming Language

Python

Related Categories

Python Libraries

Registered

2025-10-10