Skip to main content

Parse and model Dallas Central Appriasal District data

Project description

https://travis-ci.com/hydrospanner/dcad_parser.svg?branch=master

This repo provides tools for fast DB integration of data from the Dallas Central Appraisal District (DCAD). This includes

  • A CLI to generate SQLAlchemy models by parsing a data dictionary and flask-sqlacodegen.

  • A parser for DCAD’s table exports for parsing, coersion, and validation.

Data Model CLI

Parse the Dallas Central Appraisal District (DCAD) data dictionary into sqlalchemy metadata. Use the generated metadata to generate Flask-SQLAlchemy model code, using flask-sqlacodegen.

This will convert this data dictionary structure:

TABLE [ABATEMENT_EXEMPT]                Table containing information for abatement if applicable
        [ACCOUNT_NUM]                   The DCAD Account number
        [APPRAISAL_YR]                  The appraisal year for the data
        [TOT_VAL]                       The total value for the property

into

from flask_sqlalchemy import SQLAlchemy


db = SQLAlchemy()



class AbatementExempt(db.Model):
    __tablename__ = 'abatement_exempt'

    account_num = db.Column(db.Integer, primary_key=True, nullable=False, info='The DCAD Account number')
    appraisal_yr = db.Column(db.Integer, primary_key=True, nullable=False, info='The appraisal year for the data')
    tot_val = db.Column(db.Float, info='The total value for the property')

Example (using the entery point)

generate_sqlalchemy path/to/file.txt --outfile models.py --flask

To see the full list of options

generate_sqlalchemy --help

Table Parser

This parser functions as a dictionary parser for the invidual table exports. It also coerces and validates the data. It uses the same naming convention logic to identify field types as the Data Model process.

Where to get it

[PyPI](https://pypi.org/project/dcad-parser-hydrospanner/)

pip install dcad-parser-hydrospanner

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

dcad-parser-hydrospanner-0.1.1.tar.gz (9.1 kB view hashes)

Uploaded Source

Built Distribution

dcad_parser_hydrospanner-0.1.1-py3-none-any.whl (10.5 kB view hashes)

Uploaded Python 3

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