Converts to Excel XLSX from a TSV or CSV text file.
Project description
text2excel
This program converts CSV Or TSV text files to Microsoft Excel format. It uses openpyxl to create Excel files.
As input it takes tab-separated *.txt
files (TSV), or any CSV files
(Comma-Separated Values) that can be auto-detected by the Python standard
library csv module.
- There is a GitHub page for text2excel
Example
$ printf "one\ttwo\tthree\n1\t2\t3\n" | tee my_data_file.txt
one two three
1 2 3
$ text2excel --numbers my_data_file.txt
Saved to file: my_data_file.xlsx
Installation
I recommend installing text2excel with pipx:
pipx install text2excel
If you don't already have it, a guide for how to install pipx is provided below on this page.
To upgrade text2excel to the latest version, simply run:
pipx upgrade text2excel
Or pipx upgrade-all
if you want to go crazy. 😉
If you want to bundle up text2excel into a single, standalone executable Python zipapp, I highly recommend shiv. For example:
shiv -o text2excel -p "/usr/bin/env python3" -c text2excel text2excel
If shiv doesn't work for you for some reason, you can also use PEX:
pex -o text2excel -c text2excel text2excel
Installing pipx
I suggest installing everything with pipx, because it is fantastic. 🙂
python3 -m pip install --user pipx
python3 -m pipx ensurepath
At this point, you may need to logout to refresh your shell $PATH
before
proceeding.
For further details, see the official pipx installation guide.
Installing shiv
I recommend that you use pipx to install shiv:
pipx install shiv
Alternatively, if you really don't want to use pipx for some reason, you can
simply run python3 -m pip install --user shiv
. Then, if necessary, manually
reconfigure your shell $PATH
to find any pip installed binaries.
News
Please see the changelog for more details.
Contributing
Do you want to help out with this project?
- Please check the CONTRIBUTING guide.
Credits
This project was originally based on a Gist by Konrad Förstner.
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
Built Distribution
Hashes for text2excel-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8b9fca3ce933a51d865609eaffa9dc718c09717e6eacd8c7832954c209be6a4 |
|
MD5 | ef90579d761423f4fd3797e16c86fe60 |
|
BLAKE2b-256 | 74037da0bc1399b5e9ca24c10288b3e211bbbdc5a97e65427b65ac2e7c304345 |