Code Monkey home page Code Monkey logo

ncdacdb's Introduction

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')

ncdacdb's People

Contributors

cllghn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.