Metadata-Version: 2.4
Name: randonneuring-intelligence
Version: 0.1.0
Summary: Python libraries for processing and analyzing randonneuring cycling event data
Author-email: Prathap Pandian <mprathappandian@gmail.com>
License: MIT
Project-URL: Homepage, https://github.com/mprathappandian/randonneuring-intelligence
Project-URL: Repository, https://github.com/mprathappandian/randonneuring-intelligence
Project-URL: Documentation, https://github.com/mprathappandian/randonneuring-intelligence/blob/main/README.md
Keywords: randonneuring,cycling,audax,data-analysis,lrm
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
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: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.4.0; extra == "dev"
Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Dynamic: license-file

# Randonneuring Intelligence

A comprehensive Python library for processing and analyzing randonneuring cycling event data from multiple sources.

## Overview

This library provides two main modules for working with randonneuring data:

- **audax_india**: Process and analyze Audax India event and participant data
- **lrm**: Process and analyze Long Randonnée Medal (LRM) results from worldwide events

## Features

### Audax India Module (32 functions)
- Load and merge event catalogs with detailed participant data
- Filter events by year, club, location, state, distance, status
- Filter participants by name, club, result status, medal, fee payment
- Statistical analysis: event stats, club stats, rider stats, completion rates
- Query functions for unique values across all dimensions

### LRM Module (21 functions)
- Load worldwide LRM result data
- Filter by year, rider, country, event, club, distance, gender, time
- Statistical analysis: rider stats, club stats, event stats, time analysis
- Gender distribution analysis
- Query functions for unique values

## Installation

### From source
```bash
cd intelligence
pip install -e .
```

### With development dependencies
```bash
pip install -e ".[dev]"
```

## Quick Start

### Audax India
```python
from randonneuring_intelligence.audax_india import (
    load_events,
    filter_events_by_year,
    get_club_statistics
)

# Load data
events = load_events('data/audax_india/events.json')

# Filter 2023 events
events_2023 = filter_events_by_year(events, year=2023)

# Get club statistics
stats = get_club_statistics(events, "Pune Randonneurs")
print(f"Total events: {stats['total_events']}")
```

### LRM
```python
from randonneuring_intelligence.lrm import (
    load_data,
    filter_by_year,
    get_rider_stats
)

# Load data
records = load_data('data/lrm/results.json')

# Filter and analyze
records_2023 = filter_by_year(records, year=2023)
stats = get_rider_stats(records, "SMITH, John")
print(f"Total events: {stats['total_events']}")
```

## Project Structure

```
intelligence/
├── src/
│   └── randonneuring_intelligence/
│       ├── __init__.py
│       ├── audax_india/          # Audax India module
│       │   ├── __init__.py
│       │   ├── data_loader.py
│       │   ├── filters.py
│       │   ├── aggregations.py
│       │   └── queries.py
│       └── lrm/                  # LRM module
│           ├── __init__.py
│           ├── data_loader.py
│           ├── filters.py
│           ├── aggregations.py
│           └── queries.py
├── tests/
│   ├── audax_india/
│   └── lrm/
├── docs/
│   ├── audax_india/
│   └── lrm/
├── data/                         # Data files location
├── pyproject.toml               # Project configuration
├── LICENSE
└── README.md
```

## Development

### Running Tests
```bash
# Run all tests
pytest

# Run with coverage
pytest --cov=src --cov-report=html

# Run specific module tests
pytest tests/audax_india/
pytest tests/lrm/
```

### Code Quality
```bash
# Format code
black src/ tests/

# Lint
flake8 src/ tests/

# Type checking
mypy src/
```

## Documentation

Detailed documentation for each module:
- [Audax India Documentation](docs/audax_india/README.md)
- [LRM Documentation](docs/lrm/README.md)

## Requirements

- Python >= 3.8
- No external runtime dependencies (pure Python standard library)

## License

MIT License - see [LICENSE](LICENSE) file for details.

## Contributing

Contributions are welcome! Please ensure:
1. All tests pass
2. Code is formatted with black
3. Type hints are included
4. Documentation is updated

## Authors

Randonneuring Intelligence Team
