RepeaterBook¶
Welcome to RepeaterBook's documentation!
RepeaterBook is a Python library that provides a powerful and convenient interface to RepeaterBook.com, the world's largest database of amateur radio repeaters. With this library, you can programmatically download, query, and analyze repeater data for various amateur radio applications.
Features¶
- Easy API Access: Download repeater data from RepeaterBook.com with a simple async interface
- Local Database: Store repeater information in a local SQLite database for fast queries
- Geographic Queries: Find repeaters near a location using distance-based filtering
- Band Filtering: Query repeaters by frequency band (2m, 70cm, etc.)
- Digital Mode Support: Filter by DMR, P25, NXDN, and other digital modes
- Smart Caching: Automatic caching of API responses to reduce load and improve performance
- Type Safe: Fully typed with mypy for excellent IDE support
- Async/Await: Non-blocking I/O for efficient API operations
Quick Example¶
import asyncio
from repeaterbook import RepeaterBook, Repeater
from repeaterbook.services import RepeaterBookAPI
from repeaterbook.models import ExportQuery, Status
from repeaterbook.utils import LatLon, Radius
from repeaterbook.queries import filter_radius, square, band, Bands
import pycountry
async def find_nearby_repeaters():
# Download repeater data
api = RepeaterBookAPI()
brazil = pycountry.countries.get(name="Brazil")
repeaters = await api.download(query=ExportQuery(countries={brazil}))
# Store in local database
rb = RepeaterBook()
rb.populate(repeaters)
# Find DMR repeaters within 50km of São Paulo
sao_paulo = LatLon(lat=-23.5505, lon=-46.6333)
radius = Radius(origin=sao_paulo, distance=50)
nearby = rb.query(
square(radius),
Repeater.dmr_capable == True,
Repeater.operational_status == Status.ON_AIR,
band(Bands.CM_70) # 70cm band
)
filtered = filter_radius(nearby, radius)
# Display results (filter_radius returns repeaters sorted by distance)
from haversine import haversine
for rep in filtered[:5]:
distance = haversine(radius.origin, (rep.latitude, rep.longitude), unit=radius.unit)
print(f"{distance:.1f}km - {rep.frequency:.4f} MHz - {rep.callsign}")
asyncio.run(find_nearby_repeaters())
Documentation¶
- Getting Started - Tutorial for beginners
- Usage Guide - Comprehensive usage examples
- Examples - Real-world use cases
- Architecture - Understanding the internals
- API Reference - Complete API documentation
- FAQ - Common questions and troubleshooting
Read RepeaterBook's official API documentation for more information about the upstream API.
Use Cases¶
- Trip Planning: Find repeaters along travel routes
- Emergency Communications: Identify emergency-capable repeaters
- Radio Programming: Generate codeplugs for DMR and other digital radios
- Coverage Analysis: Create coverage maps and statistics
- Network Analysis: Analyze repeater networks and infrastructure
- Mobile Apps: Build repeater directory applications
- Research: Analyze amateur radio repeater trends and distributions
Related Projects¶
- MicaelJarniac/opengd77 - OpenGD77 radio programming
- MicaelJarniac/ogdrb - OpenGD77 RepeaterBook integration
See Also¶
- afourney/hamkit - Ham radio toolkit
- desertblade/OpenGD77-Repeaterbook - OpenGD77 integration
- TomHW/OpenGD77 - OpenGD77 firmware
Installation¶
PyPI¶
repeaterbook is available on PyPI:
# With uv (recommended)
uv add repeaterbook
# With pip
pip install repeaterbook
# With Poetry
poetry add repeaterbook
GitHub¶
You can also install the latest version of the code directly from GitHub:
# With uv
uv add git+https://github.com/MicaelJarniac/repeaterbook
# With pip
pip install git+https://github.com/MicaelJarniac/repeaterbook
# With Poetry
poetry add git+https://github.com/MicaelJarniac/repeaterbook
Requirements¶
- Python 3.10 or higher
- Dependencies are automatically installed:
- aiohttp - Async HTTP client
- sqlmodel - SQL ORM with type safety
- haversine - Distance calculations
- pycountry - Country/region codes
- loguru - Structured logging
- tqdm - Progress bars
Contributing¶
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
More details can be found in CONTRIBUTING.
Contributors ✨¶
License¶
This project was created with the MicaelJarniac/crustypy template.