Skip to content

Commit

Permalink
feat: docs added
Browse files Browse the repository at this point in the history
  • Loading branch information
vshulcz committed Nov 16, 2024
1 parent a43d14a commit 01a82c1
Show file tree
Hide file tree
Showing 2 changed files with 463 additions and 13 deletions.
40 changes: 27 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
![Build Status](https://github.com/vshulcz/di/actions/workflows/ci.yml/badge.svg)
![Python Versions](https://img.shields.io/badge/python-3.10%20|%203.11%20|%203.12%20|%203.13-blue)
![License](https://img.shields.io/github/license/vshulcz/di.svg)


# DI Container for Python
# Injex - DI Container for Python

Injex is a lightweight and easy-to-use DI container for Python applications. This library aims to simplify the management of dependencies in your projects, making your code more modular, testable, and maintainable. This library inspired by popular DI frameworks in other programming languages.
![Build Status](https://github.com/vshulcz/di/actions/workflows/ci.yml/badge.svg)
[![pypi](https://img.shields.io/pypi/v/injex.svg)](https://pypi.python.org/pypi/injex)
[![Python Versions](https://img.shields.io/badge/python-3.10%20|%203.11%20|%203.12%20|%203.13-blue)](https://github.com/vshulcz/injex)
[![License](https://img.shields.io/github/license/vshulcz/di.svg)](https://github.com/vshulcz/injex/LICENSE)

Injex is a lightweight and easy-to-use Dependency Injection (DI) container for Python applications. It simplifies dependency management, making your code more modular, testable, and maintainable. Injex is inspired by popular DI frameworks in other programming languages and brings similar capabilities to Python.

## Features

* 🌟 Simple API: Easy to understand and use.
* πŸ”„ Support for singleton, transient, and scoped services.
* Register multiple implementations of the same interface using names.
* πŸ” Inject dependencies into properties after object creation.
* πŸ›  Handle optional dependencies gracefully.
🌟 Simple API: Easy to understand and use.
πŸ”„ Multiple Lifestyles: Support for singleton, transient, and scoped services.
🧩 Flexible Registrations: Register services, factories, and instances.
🏷️ Named Registrations: Register multiple implementations of the same interface using names.
πŸ” Property Injection: Inject dependencies into properties after object creation.
πŸ›  Optional Dependencies: Handle optional dependencies gracefully.
πŸš€ No External Dependencies: Pure Python implementation without third-party packages.

## Installation

```bash
pip install injex
```

## Why Use Dependency Injection?

Expand Down Expand Up @@ -49,4 +55,12 @@ container.add_transient(IService, ServiceImplementation)
service = container.resolve(IService)
service.perform_action() # output: Service is performing an action.
```
Another examples in [examples folder](./examples).
Another examples in [examples folder](./examples).

## Documentation

For detailed documentation on all functionalities, usage examples, and best practices, please refer to the [Documentation](./docs/tutorial.md).

## Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.
Loading

0 comments on commit 01a82c1

Please sign in to comment.