API Reference¶
This page provides detailed API documentation for RepeaterBook.
Main Module¶
repeaterbook
¶
Python utility to work with data from RepeaterBook.
Classes¶
RepeaterBook
¶
RepeaterBook API client.
Attributes¶
Functions¶
init_db
¶
populate
¶
Populate internal database.
Source code in src/repeaterbook/database.py
query
¶
Query the database.
Source code in src/repeaterbook/database.py
RepeaterBookAPIError
¶
Bases: RepeaterBookError
Error returned by the RepeaterBook API.
Raised when the API returns an error response (status: "error"). The error message from the API is preserved in the exception message.
RepeaterBookCacheError
¶
Bases: RepeaterBookError
Error during cache operations.
Raised when reading from or writing to the cache fails, such as file permission issues or disk full errors.
RepeaterBookError
¶
Bases: Exception
Base exception for RepeaterBook library.
All RepeaterBook-specific exceptions inherit from this class, making it easy to catch all library errors with a single except clause.
RepeaterBookUnauthorizedError
¶
Bases: RepeaterBookAPIError
Unauthorized access to the API.
Raised when the API returns a 401 Unauthorized status code, indicating that authentication is required or has failed.
RepeaterBookValidationError
¶
Bases: RepeaterBookError
Invalid data or response format.
Raised when: - API response is not in expected format (not a dict) - Required fields are missing from the response - Data values fail validation (e.g., invalid coordinates)
Repeater
¶
Bases: SQLModel
Repeater.
Functions¶
validate_latitude
classmethod
¶
Validate latitude is within valid range.
Source code in src/repeaterbook/models.py
validate_longitude
classmethod
¶
Validate longitude is within valid range.
Source code in src/repeaterbook/models.py
validate_frequency
classmethod
¶
Validate frequency is positive.