CSVS Convert
Converts CSV files into XLSX/SQLITE/POSTGRESQL/PARQUET fast.
Install
pip install csvs_convert
Docs
Aims
- Thorough type guessing of CSV columns, so there is no need to configure types of each field. Scans whole file first to make sure all types in a column are consistent. Can detect over 30 date/time formats as well as JSON data.
- Quick conversions/type guessing (uses rust underneath). Uses fast methods specific for each output format:
copyfor postgres- Prepared statements for sqlite using c API.
- Arrow reader for parquet
- Write only mode for libxlsxwriter
- Tries to limit errors when inserting data into database by resorting to "text" if type guessing can't determine a more specific type.
- When inserting into existing databases automatically migrate schema of target to allow for new data (
evolveoption). - Memory efficient. All csvs and outputs are streamed so all conversions should take up very little memory.
- Gather stats and information about CSV files into datapacakge.json file which can use it for customizing conversion.
Drawbacks
- CSV files currently need header rows.
- Whole file needs to be on disk as whole CSV is analyzed therefore files are read twice.
Conversion Docs
This is the python library, providing bindings to the rust library.
Usage From CSV files.
import csvs_convert
#sqlite
csvs_convert.csvs_to_sqlite("sqlite.db", ["file.csv"])
#postgres
csvs_convert.csvs_to_postgres("postgresql://user:postgres@localhost/db", ["file.csv"])
#parquet
csvs_convert.csvs_to_parquet("output", ["file.csv"])
#xlsx
csvs_convert.csvs_to_xlsx("output.xlsx", ["sqlite.db"])
Usage from datapackage
A datapackage is a file that contains metadata about the tables its specification is described here.
To generate datapackage.json file you can use:
csvs_convert.csvs_to_datapackage('path/to/datapackage.json', ["fixtures/large/csv/data.csv"])
Other tools can also generate these files.
You can use this file and alter it as needed. Mostly it is useful if you want to use the same schema across multiple files, as it will save time not having to do the type guessing for every file.
When referring to a datapackage you can either reference:
- A
datapackage.jsonfile. - A datapackage directory containing a
datapackage.jsonfile. e.g./a/datapackage/dir - A zip file containing a
datapackage.jsonfile. e.g.my_datapackage.zip
Examples:
import csvs_convert
#sqlite
csvs_convert.datapackage_to_sqlite("sqlite.db", "path/to/datapackage.json")
#postgres
csvs_convert.datapackage_to_postgres("postgresql://user:postgres@localhost/db", "path/to/datapackage.json")
#parquet
csvs_convert.datapackage_to_parquet("path/to/directory", ["sqlite.db"])
#xlsx
csvs_convert.datapackage_to_xlsx("output.xlsx", "path/to/datapackage.json")
Metadata
Release files for csvs-convert 0.7.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| csvs_convert-0.7.3.tar.gz | 99.2 kB | Without provenance | Details |
Built distributions (wheels)
Total release size: 123.5 MB
Release files / csvs_convert-0.7.3.tar.gz
| Download URL | csvs_convert-0.7.3.tar.gz |
|---|---|
| Size | 99.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
46d47badea554ddd0ae1cd3f524d5eff3df46e5a2e957d600e7399cf4cb67cd6
|
|
BLAKE2b-256 checksum How to use checksums |
73e1825491faf1acc5851360d2a6a888ca75a0b4451b4d1ba1ed8c34a02509fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | csvs_convert-0.7.3-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 6.5 MB |
| Tags | Linux glibc 2.17+ x86-64 PyPy 3.7 PyPy 3.7 7.3 |
|
SHA-256 checksum How to use checksums |
be5e4f4e225504140cceae84c969d8d167f3aa3a237d60046d4a612574c859ab
|
|
BLAKE2b-256 checksum How to use checksums |
007303884b7cccb780b4d60cc280950f95219e18ff86f46035512889af83ce55
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | csvs_convert-0.7.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 6.5 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
84baca3eb3435f4dc33656914a276d9d13a364fa1ad26da7a2f58122a9b8789c
|
|
BLAKE2b-256 checksum How to use checksums |
65a314876cf0e0360c6a525ad8ef56e6c7fa0faff5e34dcde50f62e731e52fd9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | csvs_convert-0.7.3-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 10.0 MB |
| Tags | CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6f3b304e1b1b56d767b3a4aa742ee9c7b2f1aaa2f8a31279a9340a82d2514b9c
|
|
BLAKE2b-256 checksum How to use checksums |
0f73352ad31e2c5dde9c55f9c74d9dcd4cf9aef43d2c6f3257b335ed17833e9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp311-cp311-macosx_10_7_x86_64.whl
| Download URL | csvs_convert-0.7.3-cp311-cp311-macosx_10_7_x86_64.whl |
|---|---|
| Size | 5.2 MB |
| Tags | CPython 3.11 macOS 10.7+ x86-64 |
|
SHA-256 checksum How to use checksums |
4f77180c3a7e3be8beda86d5e27eca37e1f140edd6eaa73c04373a5933dc4a96
|
|
BLAKE2b-256 checksum How to use checksums |
1cdceedcd10c3243c7449cd3450e81abc85c8a4f658f859a174d8b8ec9d82529
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | csvs_convert-0.7.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 6.5 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
690740845b01c7c2d020a732025fb05bf2163730d985eb7e0ba2e308666ce162
|
|
BLAKE2b-256 checksum How to use checksums |
e568a655644351488233cf8eaf13518d879aa2b05e76b27ec424a2640f3ffcf2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | csvs_convert-0.7.3-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 10.0 MB |
| Tags | CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5b2d337d8ce5222e0e5b14cba2119e478f1d5765d7ea57aa079c7a32c11dc643
|
|
BLAKE2b-256 checksum How to use checksums |
a8e7c2504a29ac481726d79c9143959a106fae0ee068502e0c43c34b80fe9874
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp310-cp310-macosx_10_7_x86_64.whl
| Download URL | csvs_convert-0.7.3-cp310-cp310-macosx_10_7_x86_64.whl |
|---|---|
| Size | 5.2 MB |
| Tags | CPython 3.10 macOS 10.7+ x86-64 |
|
SHA-256 checksum How to use checksums |
7b1967e8c04a6deab6cd6407f746a078f43f443b3c45b7b19b5321bf393d94ce
|
|
BLAKE2b-256 checksum How to use checksums |
4d786cdf00d0fe6737c64dbc0b91882dbc071821875739debe23ca5684081472
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp39-none-win_amd64.whl
| Download URL | csvs_convert-0.7.3-cp39-none-win_amd64.whl |
|---|---|
| Size | 4.4 MB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
e82e2b0c1d399c0d6a5c9b2fc289b36edeb39feb850ae88d7edee2cdb8932813
|
|
BLAKE2b-256 checksum How to use checksums |
a3dbcfbdc5d0cc8c842729f457896574a824e6118c1b39383025af76302fde96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp39-none-win32.whl
| Download URL | csvs_convert-0.7.3-cp39-none-win32.whl |
|---|---|
| Size | 4.1 MB |
| Tags | CPython 3.9 Windows x86-32 |
|
SHA-256 checksum How to use checksums |
cca8905798377330ef2444a85276e07736dc29c4b5d6c87c660d2759da7ffd5c
|
|
BLAKE2b-256 checksum How to use checksums |
f512bc37ad98d27900a7b809607bddfbb28e099ddcb61b2b8bcf6f58e8d28335
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | csvs_convert-0.7.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 6.5 MB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
6800f63568727fb570155702cdd4382baaa9ee84042c7390e15fc74ce465176c
|
|
BLAKE2b-256 checksum How to use checksums |
bd02e6057f64cd7d79c0cbd28b22d41d426701c29e36f4b75e03611e30f601c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | csvs_convert-0.7.3-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 10.0 MB |
| Tags | CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
0777bfcd67a6c91140d88f8b80ecb10c542388dec9d3379c44ef704bc933a2f2
|
|
BLAKE2b-256 checksum How to use checksums |
b363d999e6fd01a74e32cc210685a659e97f965cf5167901c5f795d9597be9a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp39-cp39-macosx_10_7_x86_64.whl
| Download URL | csvs_convert-0.7.3-cp39-cp39-macosx_10_7_x86_64.whl |
|---|---|
| Size | 5.2 MB |
| Tags | CPython 3.9 macOS 10.7+ x86-64 |
|
SHA-256 checksum How to use checksums |
39c5434d35066d03bc9eb00cb4b939c7a627118f6c390c4a36ba20ef6147f638
|
|
BLAKE2b-256 checksum How to use checksums |
061f0eff45a65bc3f3d0f28a36e5926a8d0ab2129b7e68e3444433d5a5bcc606
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | csvs_convert-0.7.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 6.5 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
e5e8829b5f5caba43e0849ca1c9aa1f4c85dc55b5cd62c8ce10efad0a7f05a66
|
|
BLAKE2b-256 checksum How to use checksums |
c274ad0391e4c61f73b7c78abe8c70a4343ba815edb408a59014b70ee9afbc7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | csvs_convert-0.7.3-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 10.0 MB |
| Tags | CPython 3.8 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2111584edf239a4fee5ddf8c7ae5930b44b0be50dcd921d5a4abea8851b4e755
|
|
BLAKE2b-256 checksum How to use checksums |
019e211e7116fc618ce92663a1d83760c37cf7e9d42c85ea51277d7f79ccfdbc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp38-cp38-macosx_10_7_x86_64.whl
| Download URL | csvs_convert-0.7.3-cp38-cp38-macosx_10_7_x86_64.whl |
|---|---|
| Size | 5.2 MB |
| Tags | CPython 3.8 macOS 10.7+ x86-64 |
|
SHA-256 checksum How to use checksums |
5b774aa1510c42f081cf7b8719f5a68680e9159fa82408f91aeb1601d5b131d3
|
|
BLAKE2b-256 checksum How to use checksums |
815a3a70099f4e41de0e167dfc0d9d3a71e49f4eb79ac98bdd6e44480d083252
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | csvs_convert-0.7.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 6.5 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
92955b4ee922996f88df1a5b782bd980f4d9f26c642c3b084e8d90c3278e62df
|
|
BLAKE2b-256 checksum How to use checksums |
1e37f3c315307beb59405ca76cec0d7ec858221e92b9894765b0e75af1b8ce0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
| Download URL | csvs_convert-0.7.3-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl |
|---|---|
| Size | 10.0 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f9fca69346ca5dfb46ae86ca7ef544487a666cea79405122aab4d06a0931ebe1
|
|
BLAKE2b-256 checksum How to use checksums |
94d64db3760916ddece74b9446655f103f0f81f86b18e5bdbf713802b7732362
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Release files / csvs_convert-0.7.3-cp37-cp37m-macosx_10_7_x86_64.whl
| Download URL | csvs_convert-0.7.3-cp37-cp37m-macosx_10_7_x86_64.whl |
|---|---|
| Size | 5.2 MB |
| Tags | CPython 3.7 CPython 3.7 pymalloc macOS 10.7+ x86-64 |
|
SHA-256 checksum How to use checksums |
0faeac81340e04cd591a8c7ae9e7a6349151951ed7684d9338c267c9299862e9
|
|
BLAKE2b-256 checksum How to use checksums |
771fd8c6d060d0aaad070114101d3fbb642e659e5d99119982de5facad87e3c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.15
|
Security for csvs-convert 0.7.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.