Skip to main content

convert-fileformat-with-pandas

Convert file format with pandas.

Python application PyPI version Python Versions

Requirements

  • Python 3.12+

Install

$ pip install convpandas

https://pypi.org/project/convpandas/

Usage

csv2xlsx

Convert csv file to xlsx file.

$ convpandas csv2xlsx --help
usage: convpandas csv2xlsx [-h] [--sep SEP] [--encoding ENCODING] [--quotechar QUOTECHAR] [--numeric_to_string] [--sheet_name SHEET_NAME [SHEET_NAME ...]]
                           csv_files [csv_files ...] xlsx_file

positional arguments:
  csv_files

  xlsx_file

optional arguments:
  -h, --help            show this help message and exit

  --sep SEP             Delimiter to use when reading csv. (default: ,)

  --encoding ENCODING   Encoding to use when reading csv. List of Python standard encodings.
                        https://docs.python.org/3/library/codecs.html#standard-encodings (default: utf-8)

  --quotechar QUOTECHAR
                        The character used to denote the start and end of a quoted item when reading csv. (default: ")

  --numeric_to_string   If specified, write numeric value as string type. If not specified, write numeric value as numeric type. (default: False)

  --sheet_name SHEET_NAME [SHEET_NAME ...]

Convert in.csv to out.xlsx .

$ convpandas csv2xlsx in.csv out.xlsx

When CSV_FILE is - , STDIN is used for input.

$ convpandas csv2xlsx - out.xlsx < in.csv

Convert in1.csv and in2.csv to out.xlsx . Sheet name is csv filename without its' suffix.

$ convpandas csv2xlsx in1.csv in2.csv out.xlsx

If --sheet_name is specified, sheet name is set.

$ convpandas csv2xlsx in1.csv in2.csv out.xlsx --sheet_name foo bar

xlsx2csv

Convert xlsx file to csv file.

$ convpandas xlsx2csv --help
usage: convpandas xlsx2csv [-h] [--sheet_name SHEET_NAME] [--sep SEP] [--encoding ENCODING] [--quotechar QUOTECHAR] xlsx_file csv_file

positional arguments:
  xlsx_file

  csv_file

optional arguments:
  -h, --help            show this help message and exit

  --sheet_name SHEET_NAME
                        Sheet name when reading xlsx. If not specified, read 1st sheet. (default: None)

  --sep SEP             Field delimiter for the output file. (default: ,)

  --encoding ENCODING   A string representing the encoding to use in the output file. (default: utf-8)

  --quotechar QUOTECHAR
                        Character used to quote fields. (default: ")

Convert in.xlsx to out.csv .

$ convpandas csv2xlsx in.xlsx out.csv

When CSV_FILE is - , write to STDOUT.

$ convpandas csv2xlsx in.xlsx -
name,age
Alice,23

With specifying --sheet_name, you can select sheet name that you want to convert.

$ convpandas csv2xlsx in.xlsx out.csv --sheet_name sheet2

Usage for Developer

Refer to https://github.com/kurusugawa-computer/convert-fileformat-with-pandas/blob/main/README_for_developer.md .

Metadata

Release files for convpandas 0.3.7

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

Source distribution (sdist)

Source distribution for convpandas 0.3.7
File Size Uploaded Provenance Actions
convpandas-0.3.7.tar.gz 76.3 kB Without provenance Details for convpandas-0.3.7.tar.gz

Built distribution (wheel)

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

Total release size: 84.6 kB

Release files / convpandas-0.3.7.tar.gz

Download URL convpandas-0.3.7.tar.gz
Size 76.3 kB
Tags Source
SHA-256 checksum
How to use checksums
94819575db6a2645cd7c8f8c23d0822143573c8affe53f007832472636a502eb
BLAKE2b-256 checksum
How to use checksums
c3aa3f925f12e2e9106a3730acee954510b031d3d05cc9c54c645635d8005465
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / convpandas-0.3.7-py3-none-any.whl

Download URL convpandas-0.3.7-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63f57b5690f0b9c2ac412cea6aa91900f436100ddff592504b94b7f54e3a2228
BLAKE2b-256 checksum
How to use checksums
93c8e0c7539faefdc944e0ea57a57b1afdaf9bfacfa94e7aae9297ba8cccfe2b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for convpandas 0.3.7

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