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.

Install

pip install datapackage-convert

Usage

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. my_datapackage.zip

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

datapackage_convert-0.5.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.4 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

datapackage_convert-0.5.2-cp310-none-win_amd64.whl (4.4 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

datapackage_convert-0.5.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.4 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

datapackage_convert-0.5.2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (9.7 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

datapackage_convert-0.5.2-cp310-cp310-macosx_10_7_x86_64.whl (5.1 MB view hashes)

Uploaded CPython 3.10 macOS 10.7+ x86-64

datapackage_convert-0.5.2-cp39-none-win_amd64.whl (4.4 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

datapackage_convert-0.5.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

datapackage_convert-0.5.2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (9.7 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

datapackage_convert-0.5.2-cp39-cp39-macosx_10_7_x86_64.whl (5.1 MB view hashes)

Uploaded CPython 3.9 macOS 10.7+ x86-64

datapackage_convert-0.5.2-cp38-none-win_amd64.whl (4.4 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

datapackage_convert-0.5.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.4 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

datapackage_convert-0.5.2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (9.7 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

datapackage_convert-0.5.2-cp38-cp38-macosx_10_7_x86_64.whl (5.1 MB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

datapackage_convert-0.5.2-cp37-none-win_amd64.whl (4.4 MB view hashes)

Uploaded CPython 3.7 Windows x86-64

datapackage_convert-0.5.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.4 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

datapackage_convert-0.5.2-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (9.7 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

datapackage_convert-0.5.2-cp37-cp37m-macosx_10_7_x86_64.whl (5.1 MB view hashes)

Uploaded CPython 3.7m macOS 10.7+ x86-64

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