Skip to main content

A tool for working with local copies of the FCC Universal Licensing System (ULS) database dumps (e.g., to look up information about a US call sign.)

Project description

hamkit.uls

PyPI - Version PyPI - Python Version


[!NOTE]
hamkit.uls is a small standalone component of hamkit. You can use it by itself (see below) if queries against the FCC ULS database is all that you need. Alternatively, install the entire collection of HamKit modules with pip install hamkit.

[!TIP]
Even if you do not use ULS instances directly (e.g, if you want to run your own database queries), ULS.download() is useful for downloading and parsing the data into sqlite.

A simple library to work with a local copy of the FCC ULS database

pip install hamkit-uls

Download the ULS data, and load it into a sqlite database

At present, the library is mainly only useful for downloading and parsing the FCC ULS database (from their weekly database dumps), loading it into a sqlite database, and retrieving information about call signs. Here is an example, showing these operations:

import os
import logging
from hamkit.uls import ULS

logging.basicConfig(level=logging.DEBUG)

# Download the database, if not already present
db_file = "uls.db"
if not os.path.isfile(db_file):
    ULS.download("uls.db")

# Query information about a callsign
uls = ULS(db_file)
print(uls.call_sign_lookup("kk7cmt"))

which will output the following:

UlsRecord(service='AMAT', unique_id='12345678', uls_file_number='', call_sign='KK7CMT', entity_type='L', entity_name='Fourney, Adam', first_name='Adam', middle_initial='', last_name='Fourney', street_address='1234 Streetname ST', city='Cityname', state='WA', zip_code='12345', status_code='', status_date='', linked_call_sign='', operator_class='T', group_code='D', region_code='7')

In general, the operation is straightforward enough, but ULS.download() has numerous options, as per the following docstring:

"""
Download the amateur and/or GMRS license data from the FCC, and load
it into a local sqlite database.

Parameters:
    db_filename:  The location of the sqlite database to create.
    overwrite:    If true, overwrite any existing file (Default: False)
    amat_uri:     The URI from where to download amateur radio license data.
                  Set to None to skip downloading amateur radio data.
                  (Default: ULS_AMAT_URI)
    gmrs_uri:     The URI from where to download GMRS license data.
                  Set to None to skip downloading GMRS data.
                  (Default: ULS_GMRS_URI)
"""

License

hamkit-uls is distributed under the terms of the MIT license.

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

hamkit_uls-0.0.1a3.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

hamkit_uls-0.0.1a3-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file hamkit_uls-0.0.1a3.tar.gz.

File metadata

  • Download URL: hamkit_uls-0.0.1a3.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.26.0

File hashes

Hashes for hamkit_uls-0.0.1a3.tar.gz
Algorithm Hash digest
SHA256 13bdbccc70084ba5dc0a5cedc5b7925873e9f3ebd5f6eb0e062cf1020a4d780a
MD5 90722a3079d06d6643cf1ff5157c7165
BLAKE2b-256 a29b653ccb5d57ce191884e9dffa6853b7faf4da3dcbbac16d257e364a26f53c

See more details on using hashes here.

File details

Details for the file hamkit_uls-0.0.1a3-py3-none-any.whl.

File metadata

File hashes

Hashes for hamkit_uls-0.0.1a3-py3-none-any.whl
Algorithm Hash digest
SHA256 c37a9f417093d41f06083f75a14e015397e5361cec0854930e2d9c47d2b4718e
MD5 cfcc9f555bad63025297d8eed6d7adeb
BLAKE2b-256 fe9a58dffa6c65a9ca393977f7074e213ad926e78299fd4eef55e5dc6198a600

See more details on using hashes here.

Supported by

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