Skip to main content

Import VDV 451 files into a database

Project description

Tool for dumping VDV 451 data into a database

This is intended to quickly analyze the content of a collection of VDV files in the VDV 451 format. By running this script a new schema is created and filled with one table per inuput file. Some known primary key mappings are used, you can add more using a config-file (see development.ini.dist for an example).

After dumping the data a SQL script apply_constraints.sql is run with the new schema. It sets foreign keys and indices. You may want to modify that to fit your needs (some errors are to be expected if you didn't create all tabels referenced there).

Installation

pip install vdv2pg

Usage

usage: vdv2pg [-h] [--schema SCHEMA] [-c CONFIG]
                [--post_ingest_script POST_INGEST_SCRIPT]
                database_url input_file [input_file ...]

positional arguments:
  database_url          Database to write to.
  input_file            Files to read data from

optional arguments:
  -h, --help            show this help message and exit
  --schema SCHEMA       Schema to create tables in (default: vdv2pg)
  -c CONFIG, --config_file CONFIG
                        Optional primary key and logging configuration
  --post_ingest_script POST_INGEST_SCRIPT
                        Optional path to an alternative post-ingest SQL script

Example:

vdv2pg --schema import01 postgresql:///vdv_imports *.X10

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

vdv2pg-0.0.2.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

vdv2pg-0.0.2-py3-none-any.whl (7.3 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