Skip to content

Commit 3fa5374

Browse files
committed
Update also docs introduction and overview to align.
1 parent f4341c4 commit 3fa5374

File tree

2 files changed

+19
-15
lines changed

2 files changed

+19
-15
lines changed

docs/index.rst

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,25 @@
66
py-dependency-injection
77
=======================
88

9-
A dependency injection library for Python.
9+
A dependency injection library for Python — inspired by the built-in DI system in ASP.NET Core.
1010

11-
Purpose
12-
-------
11+
Overview
12+
--------
1313

14-
Dependency injection is a powerful design pattern that promotes loose coupling and enhances testability in software applications. `py-dependency-injection` is a prototypical implementation of this pattern, designed to provide the essential features needed for effective dependency management in both small scripts and larger software projects.
14+
`py-dependency-injection` provides a lightweight and extensible way to manage dependencies in Python applications. It promotes constructor injection, supports scoped lifetimes, and encourages clean architecture through explicit configuration and testable design.
1515

16-
This library is particularly suited for beginners exploring the concept of dependency injection, as it offers a straightforward and easy-to-understand implementation. It serves as an excellent starting point for learning the pattern and can also be used as a foundational base for frameworks requiring a more specialized interface for dependency injection.
16+
This library is well-suited for both standalone use in Python applications and as a foundation for frameworks or tools that require structured dependency management.
1717

1818
Key Advantages
1919
--------------
2020

21-
- **Suitable for Learning:** Ideal for beginners exploring the concept of dependency injection.
22-
- **Base Implementation for Frameworks:** Can be used as a foundational base for frameworks requiring a more specialized interface for dependency injection.
23-
- **Standalone Solution:** Can also be used on its own, as a fully-featured dependency injection solution in any software project.
21+
- **Familiar model** – Inspired by ASP.NET Core’s DI system
22+
- **Scoped lifetimes** – Support for `singleton`, `scoped`, and `transient` registrations
23+
- **Explicit injection** – Promotes clarity over magic
24+
- **Test-friendly** – Designed for container isolation and overrides
25+
- **Minimalistic** – Easy to use, extend, and integrate
26+
27+
You can find the source code for `py-dependency-injection` in our `GitHub repository <https://github.com/runemalm/py-dependency-injection>`_.
2428

2529
.. userguide-docs:
2630
.. toctree::

docs/userguide.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Getting Started
99
Introduction
1010
############
1111

12-
`py-dependency-injection` is a lightweight and flexible dependency injection library for Python. It simplifies managing dependencies in your applications, promoting cleaner and more testable code.
12+
`py-dependency-injection` is a lightweight and extensible dependency injection library for Python — inspired by the built-in DI system in **ASP.NET Core**. It promotes constructor injection, supports scoped lifetimes, and encourages clean, testable application architecture.
1313

14-
This guide will help you understand the key concepts and how to start using the library. For detailed examples, see the `Examples` section.
14+
This guide provides an overview of the key concepts and demonstrates how to start using the library effectively. For detailed examples, see the `Examples` section.
1515

1616
############
1717
Installation
@@ -75,11 +75,11 @@ Basic workflow:
7575
Best Practices
7676
##############
7777

78-
- **Use Constructor Injection**: Preferred for most cases as it promotes clear and testable designs.
79-
- **Leverage Tags for Organization**: Group dependencies logically using tags.
80-
- **Choose the Right Scope**: Use scoped or singleton lifetimes to optimize performance and resource usage.
81-
- **Keep Dependencies Decoupled**: Avoid tightly coupling your components to the container.
82-
- **Isolate Contexts with Containers**: Use multiple containers to manage dependencies for separate modules or contexts.
78+
- **Prefer Constructor Injection**: It promotes clear interfaces and testable components.
79+
- **Use the Right Lifetime**: Choose between transient, scoped, and singleton based on your component's role.
80+
- **Organize with Tags**: Use tag-based registration and resolution to group related services.
81+
- **Avoid Container Coupling**: Inject dependencies via constructors rather than accessing the container directly.
82+
- **Use Multiple Containers When Needed**: For modular apps or test isolation, create dedicated containers.
8383

8484
#################
8585
Where to Go Next?

0 commit comments

Comments
 (0)