This documentation is organized to help you effectively learn and use the Resource Manager library:
Begin your journey with the Resource Manager through our step-by-step tutorials:
- Introduction - Core concepts and benefits
- Basic Usage - Simple examples to get started
- Defining Resources - Detailed guide to resources
- Dependency Resolution - Understanding resolution
- Visualization - Creating dependency graphs
- Advanced Usage - Advanced techniques
Practical solutions for common tasks:
- Custom Resolution - Customize resolution logic
- Multiple Environments - Dev, staging, production
- Feature Flags - Implementing feature flags
- Optional Dependencies - Handle optional resources
- Organizing Resources - Structure complex applications
Understand how it works internally:
- Resource Model - Core resource concepts
- Resource Linking - Link mechanics
- Dependency Resolution - Resolution algorithm
- Extension Points - Extending the library
from resource_manager.resources import ResourceManager
from resource_manager.resolver import DepBuilder
# Create a resource manager
manager = ResourceManager()
# Add resources with dependencies
manager.add_resource(
"database",
config={"provides": ["database.main"]}
)
manager.add_resource(
"application",
config={
"requires": ["database.main"],
"provides": ["app.web"]
}
)
# Resolve dependencies
resolver = DepBuilder(resources=manager, feature_names=["app.web"])
resolver.resolve()
# Print the resolved dependency order
print("Dependency order:", resolver.dep_order)| Section | Description |
|---|---|
| Tutorials | Step-by-step learning path |
| How-To Guides | Task-oriented guides |
| Implementation | Technical details |