InfraLib: Infrastructure Management for RL and Optimization
InfraLib is a comprehensive Python library for modeling, simulating, and analyzing large-scale infrastructure management problems using reinforcement learning and stochastic optimization. It provides realistic deterioration modeling, partial observability, and scalable simulation supporting millions of components.
Quick Links
- Documentation: infralib.readthedocs.io
- Website: infralib.github.io
- Research Paper: arXiv
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Installation
Option 1: Install from PyPI (Recommended)
pip install infralib
Option 2: Install with uv (Advanced Users)
First install uv:
# On macOS and Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows:
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
Then install InfraLib:
# Install from PyPI
uv add infralib
# Or install from source
git clone https://github.com/pthangeda/InfraLib.git
cd InfraLib
uv venv --python 3.12
source .venv/bin/activate # On Windows: .venv\\Scripts\\activate
uv pip install -e .
Documentation
Comprehensive documentation is available at infralib.readthedocs.io, including:
- API Reference: Detailed documentation for all classes and functions
- Tutorials: Step-by-step guides for common use cases
- Examples: Complete example implementations
- Theory: Mathematical foundations and model descriptions
Development
Setting Up Development Environment
# Clone the repository
git clone https://github.com/pthangeda/InfraLib.git
cd InfraLib
# Install with development dependencies
uv venv --python 3.12
source .venv/bin/activate
uv pip install -e \".[dev]\"
# Install pre-commit hooks (optional)
uv run pre-commit install
Running Tests and Code Quality
# Run tests
uv run pytest
# Run linting and formatting
uv run ruff check --fix
uv run ruff format
# Run all quality checks
uv run pre-commit run --all-files
Build Documentation
# Install documentation dependencies
uv add --group docs sphinx sphinx-rtd-theme sphinx-autodoc-typehints
# Build documentation
cd docs
uv run sphinx-build -b html . _build/html
Contributing
We welcome contributions from the community! Here's how to get involved:
-
Report Issues: Found a bug? Open an issue
-
Request Features: Have an idea? Start a discussion
-
Contribute Code:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes and add tests
- Run quality checks (
uv run pre-commit run --all-files) - Commit your changes (
git commit -m 'Add amazing feature') - Push to your branch (
git push origin feature/amazing-feature) - Open a Pull Request
-
Improve Documentation: Help us make the docs better
-
Spread the Word: Star the repo and tell others about InfraLib!
Support & Community
- Contact: Pranay Thangeda (pranayt2@illinois.edu or contact@prny.me) - We're happy to help with questions and feature requests
- Collaboration: We welcome collaborations and are willing to implement features that help researchers and practitioners use InfraLib for their specific use cases
- Bug Reports: GitHub Issues
- Discussions: GitHub Discussions
License
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2025 InfraLib Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the \"Software\"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Metadata
Release files for infralib 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| infralib-0.1.0.tar.gz | 107.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| infralib-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 159.4 kB
Release files / infralib-0.1.0.tar.gz
| Download URL | infralib-0.1.0.tar.gz |
|---|---|
| Size | 107.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
890557e3934c9ad304037d9cb829771a0789f3da740137e66928773bbb43c4f5
|
|
BLAKE2b-256 checksum How to use checksums |
7c5d05065405de1abd6875b2d7936f8a1722584b64026174906f8c2c9bf074cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.8
|
Release files / infralib-0.1.0-py3-none-any.whl
| Download URL | infralib-0.1.0-py3-none-any.whl |
|---|---|
| Size | 52.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c8033e3cd7786e3ff65abec9310ffe38cd6a98dce7a8efa7cd9c56182b2d2432
|
|
BLAKE2b-256 checksum How to use checksums |
51e579227ad1370f2204d5d5f46a23484f8856369c5bf42484f9177414faae56
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.8
|
Security for infralib 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.