将VDV 451文件导入数据库
vdv2pg的Python项目详细描述
用于将VDV 451数据转储到数据库的工具
这是为了快速分析
VDV 451格式。通过运行此脚本,将创建并填充新架构
每个input文件有一个表。使用了一些已知的主键映射,您可以
可以使用配置文件添加更多内容(请参见development.ini.dist
以获取示例)。
在转储数据之后,将使用 新架构。它设置外键和索引。您可能需要将其修改为 符合您的需要(如果您没有创建所有选项卡,可能会出现一些错误 在这里引用)。
安装
pip install vdv2pg
使用量
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
示例:
vdv2pg --schema import01 postgresql:///vdv_imports *.X10