A powerful web scraping and API tool for League of Legends esports data from Leaguepedia, powered by AI agents.
- Scraping player information from Leaguepedia
- AI-powered data extraction and analysis
- Rate limiting and retry mechanisms
- Async support for better performance
- Comprehensive error handling
- Type-safe implementation
- Python 3.8+
- Poetry for dependency management
- OpenAI API key
- PostgreSQL database
- Redis for caching
- Clone the repository:
git clone https://github.com/yourusername/leaguepedia-api.git
cd leaguepedia-api- Install dependencies using Poetry:
poetry install- Copy the example environment file and configure your variables:
cp .env.example .env- Edit the
.envfile with your configuration values.
from src.agents.scraping_agent import ScrapingAgent
# Initialize the agent
agent = ScrapingAgent(openai_api_key="your-api-key")
# Get player data
player_data = await agent.get_player_data("Faker")
print(player_data)poetry run pytestleaguepedia-api/
├── src/
│ ├── scrapers/
│ │ ├── base.py
│ │ ├── players.py
│ │ ├── teams.py
│ │ └── tournaments.py
│ ├── agents/
│ │ ├── base_agent.py
│ │ └── scraping_agent.py
│ ├── database/
│ │ ├── models.py
│ │ └── connections.py
│ └── api/
│ └── routes.py
├── tests/
├── .env.example
├── pyproject.toml
└── README.md
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Leaguepedia for providing the data
- OpenAI for the GPT models
- The League of Legends community