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.

Files for vdv2pg, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size vdv2pg-0.0.2-py3-none-any.whl (7.3 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size vdv2pg-0.0.2.tar.gz (5.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page