Metadata-Version: 2.4
Name: py-rl-toolkit
Version: 0.1.0
Summary: A comprehensive, easy-to-use Python toolkit for reinforcement learning research and education
Author-email: RL Toolkit Team <rltoolkit@example.com>
Maintainer-email: RL Toolkit Team <rltoolkit@example.com>
License: MIT License
        
        Copyright (c) 2024 RL Toolkit Contributors
        
        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.
Project-URL: Homepage, https://github.com/Nits1627/PyPiRL
Project-URL: Documentation, https://github.com/Nits1627/PyPiRL/blob/main/docs.md
Project-URL: Repository, https://github.com/Nits1627/PyPiRL.git
Project-URL: Bug Tracker, https://github.com/Nits1627/PyPiRL/issues
Keywords: reinforcement learning,machine learning,AI,Q-learning,DQN,SARSA
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.19.0
Requires-Dist: matplotlib>=3.3.0
Requires-Dist: tqdm>=4.60.0
Provides-Extra: torch
Requires-Dist: torch>=1.9.0; extra == "torch"
Provides-Extra: dev
Requires-Dist: pytest>=6.0; extra == "dev"
Requires-Dist: pytest-cov>=2.0; extra == "dev"
Requires-Dist: black>=21.0; extra == "dev"
Requires-Dist: flake8>=3.8; extra == "dev"
Requires-Dist: twine>=3.0; extra == "dev"
Dynamic: license-file

# PyPiRL - Python Reinforcement Learning Toolkit

A comprehensive, easy-to-use Python toolkit for reinforcement learning research and education. Built with clean APIs, extensive documentation, and thorough testing.

## 🚀 Features

### Core Algorithms
- **Q-Learning**: Tabular off-policy value-based algorithm
- **SARSA**: Tabular on-policy value-based algorithm  
- **DQN**: Deep Q-Network with PyTorch neural networks

### Environments
- **SimpleGridWorld**: Configurable grid environment with obstacles and goals
- **SimpleMaze**: Customizable maze environment with walls

### Policies
- **RandomPolicy**: Uniform random action selection
- **GreedyPolicy**: Always selects best action
- **EpsilonGreedyPolicy**: Balances exploration/exploitation with decay
- **SoftmaxPolicy**: Boltzmann exploration with temperature

### Utility Functions
- **Training**: `train_agent()` with progress tracking and early stopping
- **Evaluation**: `evaluate_agent()` with performance metrics
- **Visualization**: `plot_learning_curve()` and `plot_comparison()`
- **Persistence**: `save_agent()` and `load_agent()` for model saving
- **Episode Running**: `run_episode()` for single episode execution
- **Algorithm Comparison**: `compare_algorithms()` for benchmarking

## 📦 Installation

### From PyPI (when published)
```bash
pip install py-rl-toolkit
```

### From Source
```bash
git clone https://github.com/Nits1627/PyPiRL.git
cd PyPiRL
pip install -e .
```

### From Wheel
```bash
pip install dist/rltoolkit-0.1.0-py3-none-any.whl
```

## 🎯 Quick Start

```python
from rltoolkit import QLearning, SimpleGridWorld, EpsilonGreedyPolicy

# Create environment and agent
env = SimpleGridWorld(size=5)
agent = QLearning(env.state_space_size, env.action_space_size)
policy = EpsilonGreedyPolicy(agent, epsilon=0.1)

# Train the agent
from rltoolkit import train_agent
rewards = train_agent(env, agent, policy, episodes=100)

# Evaluate performance
from rltoolkit import evaluate_agent
avg_reward = evaluate_agent(env, agent, policy, episodes=10)
print(f"Average reward: {avg_reward}")
```

## 📚 Examples

See `examples.py` for comprehensive usage examples including:
- Training different algorithms
- Comparing algorithm performance
- Visualizing learning curves
- Custom environment creation

## 🧪 Testing

Run the comprehensive test suite:
```bash
python -m pytest tests/ -v
```

## 📖 Documentation

Detailed documentation is available in `docs.md` including:
- API reference for all classes and functions
- Algorithm explanations
- Environment specifications
- Policy implementations

## 🔧 Requirements

- Python ≥ 3.7
- NumPy
- Matplotlib
- PyTorch (for DQN)
- TQDM (for progress bars)

## 📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

## 🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## 📊 Package Status

- ✅ All 58 tests passing
- ✅ Package successfully built
- ✅ Ready for PyPI publication
- ✅ GitHub Actions workflow configured for automated publishing
