Skip to main content

Python utility to work with data from RepeaterBook.

Project description

Discord

Badges
Build Nox semantic-release PyPI Read the Docs
Tests coverage pre-commit asv
Standards SemVer 2.0.0 Conventional Commits
Code uv Ruff Nox Checked with mypy
Repo GitHub issues GitHub stars GitHub license All Contributors Contributor Covenant

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

Read the full documentation

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

See Also

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

MIT

This project was created with the MicaelJarniac/crustypy template.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

repeaterbook-0.6.0.tar.gz (251.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

repeaterbook-0.6.0-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file repeaterbook-0.6.0.tar.gz.

File metadata

  • Download URL: repeaterbook-0.6.0.tar.gz
  • Upload date:
  • Size: 251.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for repeaterbook-0.6.0.tar.gz
Algorithm Hash digest
SHA256 4f2f6576e639c5e79d127f04d640d0d380085ded408b5432e27e036bac96a756
MD5 b66be5c1a683a698263eb8b95b7ecf61
BLAKE2b-256 af3cab64b9ae8946100c13dc3f6d7074cd2fc558ee6a506fe2a632b25342efce

See more details on using hashes here.

Provenance

The following attestation bundles were made for repeaterbook-0.6.0.tar.gz:

Publisher: semantic-release.yml on MicaelJarniac/repeaterbook

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file repeaterbook-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: repeaterbook-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for repeaterbook-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 de6772f8bb9ceee1519a92fef1f24ff9820e4f739551c21ef1d90dde568cf054
MD5 e57666681969bbc9637b895705bf6f8e
BLAKE2b-256 363abf1f013bcf7c8ea77edd6c8cf48d99662b06b6c567b3983ea0c754e9cd35

See more details on using hashes here.

Provenance

The following attestation bundles were made for repeaterbook-0.6.0-py3-none-any.whl:

Publisher: semantic-release.yml on MicaelJarniac/repeaterbook

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page