Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dms-codes/hamdb
Ham Radio Callsign Information Retrieval This Python script allows you to retrieve information about ham radio callsigns using the HamDB API. You can obtain details such as callsign class, grid location, latitude, longitude, name, and address.
https://github.com/dms-codes/hamdb
api python scrape
Last synced: 2 days ago
JSON representation
Ham Radio Callsign Information Retrieval This Python script allows you to retrieve information about ham radio callsigns using the HamDB API. You can obtain details such as callsign class, grid location, latitude, longitude, name, and address.
- Host: GitHub
- URL: https://github.com/dms-codes/hamdb
- Owner: dms-codes
- Created: 2021-06-01T12:26:04.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-01T10:04:40.000Z (over 1 year ago)
- Last Synced: 2023-10-01T11:26:37.622Z (over 1 year ago)
- Topics: api, python, scrape
- Language: Python
- Homepage: https://github.com/dms-codes/hamdb
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ham Radio Callsign Information Retrieval
This Python script allows you to retrieve information about ham radio callsigns using the [HamDB API](http://api.hamdb.org/v1). You can obtain details such as callsign class, grid location, latitude, longitude, name, and address.
## Prerequisites
Before running the script, ensure you have the `requests` library installed. You can install it using `pip`:
```bash
pip install requests
```## Usage
1. Import the necessary library:
```python
import requests
```2. Define the base URL for the HamDB API:
```python
urlbase = "http://api.hamdb.org/v1/{}/json/hamdb"
```3. Implement functions to retrieve specific information about a callsign:
- `GetData(callsign)`: Retrieves all available data for the specified callsign.
- `GetClass(callsign)`: Retrieves the class of the callsign.
- `GetGrid(callsign)`: Retrieves the grid location of the callsign.
- `GetLatLong(callsign)`: Retrieves the latitude and longitude of the callsign.
- `GetName(callsign)`: Retrieves the name associated with the callsign.
- `GetFullAddress(callsign)`: Retrieves the full address information of the callsign.For example, to get the name associated with a callsign:
```python
name = GetName("vk3ye")
print(name)
```4. Customize the functions or use them as needed to retrieve specific information about ham radio callsigns.
## Example
In this example, we retrieve the name associated with the "vk3ye" callsign and print it.
## License
This script is provided under the [MIT License](LICENSE).
```Feel free to modify the README.md file to include additional information or examples based on your specific project requirements.