Skip to content

ericjf/leaguepediaapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leaguepedia API

A powerful web scraping and API tool for League of Legends esports data from Leaguepedia, powered by AI agents.

Features

  • 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

Prerequisites

  • Python 3.8+
  • Poetry for dependency management
  • OpenAI API key
  • PostgreSQL database
  • Redis for caching

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/leaguepedia-api.git
cd leaguepedia-api
  1. Install dependencies using Poetry:
poetry install
  1. Copy the example environment file and configure your variables:
cp .env.example .env
  1. Edit the .env file with your configuration values.

Usage

Basic Usage

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)

Running Tests

poetry run pytest

Project Structure

leaguepedia-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

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

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

Acknowledgments

  • Leaguepedia for providing the data
  • OpenAI for the GPT models
  • The League of Legends community

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages