New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

datapackage-convert

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datapackage-convert

Convert your datapackages

  • 0.5.2
  • PyPI
  • Socket score

Maintainers
1

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')

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc