# google/pinject

A pythonic dependency injection library.

Repository: https://github.com/google/pinject
Canonical: https://ross.abutalabs.com/products/pinject
Homepage: https://pypi.org/project/pinject/
Language: Python
License: Apache-2.0
License Family: permissive
Archived: true
Last push: 2021-03-23T16:42:22+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4822, "days_push": 1989, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1342, forks 86 (observed 2026-08-28T04:04:26.272809+00:00)

## What it is
Pinject is a Python dependency injection library from Google that assembles objects into graphs with minimal boilerplate. It is designed to be pythonic, requiring no decorators or annotations to get started.

## Use cases
- wire dependencies in a python object-oriented codebase
- assemble object graphs without decorators or annotations
- replace verbose java-style DI frameworks in python
- make classes easier to unit test with injected dependencies
- get started with dependency injection in one line

## When to choose
- you write lots of object-oriented python and want low-boilerplate DI
- you value clear error messages over framework magic
- you want a DI library designed for python rather than a port of Guice or Spring

## When to avoid
- you need a library with active development and recent releases
- you need advanced DI features like scoped lifecycles found in heavier frameworks
- your project is not python

## Facets
- artifact type: library
- maturity: maintenance
- function: developer-tools, configuration-management
- domain: developer-tools
- platform: python, cross-platform
- tags: dependency-injection, object-graphs, pythonic, google, python

## Member repositories
- google/pinject (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:26.272809+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:43:05.419313+00:00, confidence not recorded.
  - readme: https://github.com/google/pinject (fetched 2026-08-28T04:04:26.272809+00:00, sha 530a9b536f22)
  - homepage: https://pypi.org/project/pinject/ (fetched 2026-08-29T12:02:25.390212+00:00, sha 4b4e8fead74a)
  - registry_pypi: https://pypi.org/pypi/pinject/json (fetched 2026-08-29T12:02:25.399332+00:00, sha 9162b585237c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
