This tool is designed to convert an FCC Universal Licensing System (ULS) database into an SQLite database.
uls2sqlite has been tested on Fedora Linux 37, but may be portable to other operating systems.
git clone https://git.sr.ht/~cg/uls2sqlite cd uls2sqlite/ pip install -r requirements.txt
This tool will process
.DAT files from a daily or weekly download from the FCC website, or take a single file from a geographical data export.
Command-line arguments to specify input and output files. Use the
--import_file flag to specify the ULS file to be imported, and the
--output_file flag to specify the SQLite database filename to export to. If no SQLite database exists, it will be created.
Example using ULS
.DAT file as input:
python uls2sqlite.py -i HD.dat -o output.sqlite --encoding=utf-8
Note search export files are also pipe-delimited, however they are a single file containing many ULS records. There is a helper tool included,
uls_splitter.py, which can be run against these files to split them into separate pipe-delimited files.
Example using a single ULS file as input:
cd tools python uls_splitter.py -i UL20236291542491.txt cd .. bash process_pipe_files.sh databases/my_database.sqlite
This will split the
UL20236291542491.txt file into separate pipe-delimited files, and process each of them into the
my_database.sqlite SQLite database located in the
There is also a helper file,
process_zip_files.sh, which can be used to process ZIP files downloaded from the FCC website located in the
archives directory. This will process all the files for you in an automated manner.
Example using ZIP files downloaded to the
There are a number of helper tools included to assist with the conversion process.
Processes batches of ZIP files downloaded from the FCC website and converts them into SQLite databases.
Note: If GNU Parallel is installed on your system, the script will attempt to process ZIP files in parallel for a massive speed boost. Be aware this can consume considerable system resources!
Processes a single pipe-delimited file downloaded from the FCC website and converts it into an SQLite database.
Processes a single pipe-delimited ULS database to a SQLite database. Run
uls_splitter.py first to generate the necessary
bash process_pipe_files.sh output.sqlite
Downloads the weekly ULS databases from the URLs in
Ready the .DAT files for import by making sure filenames are correct.
If a combined ULS database is being used, split it into separate pipe-delimited files by record type. Files are
placed in the
python uls_splitter.py -i UL20236291542491.txt
Contains list of URLs for weekly ULS databases provided by the FCC.
ULS definitions SQL file:
ULS record types