Skip to main content

Convert your datapackages

Project description

Datapackage Convert

Full Documentation

Conversions from tabular-data-packages. Currently:

  • Merge mulitple datapackages into one.
  • To SQLite
  • To Parquet
  • To XLSX
  • To Postgres

All conversions aim to be memory efficiant and as fast they can be. This is the python library, providing bindings to the rust library.


pip install datapackage-convert


When refering to a datapackage you can either reference:

  • A datapackage.json file.
  • A datapackage directory containing a datapackage.json file. e.g. /a/datapackage/dir
  • A zip file containing a datapackage.json file. e.g.

Merge datapackage

This will merge datapckages into a single one.

from datapackage_convert import merge_datapackage

merge_datapackage('output_datapackage', ['datapackage1', 'datapackage2'])

To SQLite

Will convert to sqlite file. Adding foreign key relationships and indexes for them.

from datapackage_convert import datapackage_to_sqlite

datapackage_to_sqlite('mydatabase.db', 'my_datapackage')

To parquet

Will convert to snappy compressed parquet files.

from datapackage_convert import datapackage_to_parquet

datapackage_to_parquet('output_directory', 'my_datapackage')

To xlsx

Will convert to XLSX files.

from datapackage_convert import datapackage_to_xlsx

datapackage_to_xlsx('output.xlsx', 'my_datapackage')

To postgres

Will insert data into postgres database.

from datapackage_convert import datapackage_to_postgres

datapackage_to_xlsx('postgres://name:pass@host/dbname', 'my_datapackage')

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

datapackage_convert-0.5.2.tar.gz (79.4 kB view hashes)

Uploaded source

Built Distributions

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