Skip to main content

# Convert CSV object files to Apache Parquet with IBM Cloud Object Storage

This tool was developed to help users on IBM Cloud convert their CSV objects in IBM Cloud Object Storage (COS) to Apache Parquet objects. It’s developed using Python 3.6.6 and will work with Python 3 versions up to 3.6.6.

### Installation To install the tool, run pip with:

` pip install csvtoparquet `

After the tool’s installed, you must have an IBM Cloud API Key and IBM COS service to make the command line tool work. It requires that you insert your IBM Cloud API Key and a IBM COS service. You can find the API Key from your IBM Cloud management panel: Manage > Security > Platform API Keys. If you don’t have IBM COS as a service, you can find it in the cloud Catalog under Object Storage, which has a lite tier (free).

If you already have the COS service, you’ll need the name of the bucket where your CSV objects are located. Right now, the tool doesn’t support multiple buckets, so you can’t convert objects from one bucket and store them in another. Nonetheless, you can rename your converted objects to use prefixes such as:

[object name] - mycsvfile.csv [renamed object stored as parquet] - new/prefix/mycsvfile.parquet

The file extension .parquet will be automatically added to your new object name.

### Usage

Run csvtoparquet on the command line using the following required flags:

` csvtoparquet -a <IBM_CLOUD_API_KEY> -e <IBM_CLOUD_COS_ENDPOINT> -b <IBM_COS_BUCKET> `

  • -a or –apikey - IBM Cloud API Key

  • -e or –endpoint - COS bucket endpoint

  • -b or –bucket - COS bucket name where the CSV objects are stored

After using the flag you can append the following flags to the command:

  • -l or –list - Lists all the objects in the bucket

  • -c or –csv - Lists all CSV objects in the bucket

  • -cn or –csv-names - Lists only the names of CSV objects in the bucket

  • -f or –file - Name of the CSV object you want to convert - used with -n

  • -n or –name - Name of the new object - can include prefixes - used with -f

#### Converting objects

##### Convert one object

Input:

` csvtoparquet -a <IBM_CLOUD_API_KEY> -e <IBM_CLOUD_COS_ENDPOINT> -b <IBM_COS_BUCKET> \ -f csvfile.csv -n csvfile `

Output:

` Now Converting: csvfile.csv --> csvfile.parquet `

##### Convert more than one object

Input:

` csvtoparquet -a <IBM_CLOUD_API_KEY> -e <IBM_CLOUD_COS_ENDPOINT> -b <IBM_COS_BUCKET> \ -f csvfile.csv anothercsvfile.csv -n csvfile new/csvfile `

Output:

` Now Converting: csvfile.csv --> csvfile.parquet Now Converting: anothercsvfile.csv --> new/csvfile.parquet `

Metadata

Release files for csvtoparquet 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for csvtoparquet 0.1.5
File Size Uploaded Provenance Actions
csvtoparquet-0.1.5.tar.gz 6.2 kB Without provenance Details for csvtoparquet-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for csvtoparquet 0.1.5
File Interpreter ABI Platform Actions
csvtoparquet-0.1.5-py3-none-any.whl Python 3 none any Details for csvtoparquet-0.1.5-py3-none-any.whl

Total release size: 20.1 kB

Release files / csvtoparquet-0.1.5.tar.gz

Download URL csvtoparquet-0.1.5.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b6d1a1a6037c1351f549339843140cd0bf814eab34fee91338d953ad073274a5
BLAKE2b-256 checksum
How to use checksums
fc24e390619ed522ce8b1e7f10cbe710bc2fa6e6bbd5c54071a6dc5e78ce8d7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.6

Release files / csvtoparquet-0.1.5-py3-none-any.whl

Download URL csvtoparquet-0.1.5-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25a3b8d393843aa3cbb68e4a6d82482c527efce7752cffb0ce2c8fe5b85c3eac
BLAKE2b-256 checksum
How to use checksums
8a165e9042359af822f66bc0c9c85d6c440bd08db428ff9aba987f89cba8ecee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.1.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.6

Security for csvtoparquet 0.1.5

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page