Skip to content

cllghn/NCDACdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NCDACdb

A Python tool for downloading and creating a local database from files obtained through the North Carolina Department Of Adult Correction Offender Public Information site. The site provides a links to files of North Carolina Department of Adult Correction offender related data. The files contain all public information on all NC Department of Adult Correction offenders convicted since 1972. The data files are zipped and their approximate size is listed beside the file description.

The schema for the database is provided, here.

Usage Examples:

Install with pip:

pip install -i https://test.pypi.org/simple/ NCDACdb==0.1.0

Download, and unzip all raw data:

from NCDACdb.fetch import get_zipped_paths, unpack_zipped_paths

urls = get_zipped_paths()    
unpack_zipped_paths(url_list=urls, extract_path="rawdata")

Build a local SQLite database from the downloaded files:

from NCDACdb.build import build_sqlite_db

build_sqlite_db(db_name="ncdacdb", dir_path="rawdata")

Downsize the database to only include records updated after January 1st, 2020:

from NCDACdb.downsize import downsize_by_update

downsize_by_update(input_db='ncdacdb.sqlite',
                   output_db='sub_ncdacdb.sqlite', 
                   date_filter='2020-01-01')

About

A python tool for working with NC DAC Offender Data.

Resources

License

Stars

Watchers

Forks

Languages