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.4.2.tar.gz (283.1 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.4.2-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for repeaterbook-0.4.2.tar.gz
Algorithm Hash digest
SHA256 3fc3c5ecb11de36945f585e644be0bd94165909ad2458141a33427854a1cffb8
MD5 2a507c60ed5e5a807577edb61915c92f
BLAKE2b-256 17f6db9465b798c79477f957befc81ad7121547d5c17a62bb83d3cfa94bd0539

See more details on using hashes here.

Provenance

The following attestation bundles were made for repeaterbook-0.4.2.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.4.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for repeaterbook-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8532d53c8c5a86a5597f2b730a258c630cb27c95adeceb120147bd1ee7909507
MD5 77c4af26bc060b328bafaf1c0d083b24
BLAKE2b-256 e294a0dcbb34e6a87642be29b3b63c9c753c2e49cf08ccb99cddb2421c2aba0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for repeaterbook-0.4.2-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