Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexprengere/csv2xls
Put together some CSV files into a single Excel file, in different sheets.
https://github.com/alexprengere/csv2xls
csv excel python xls
Last synced: about 2 months ago
JSON representation
Put together some CSV files into a single Excel file, in different sheets.
- Host: GitHub
- URL: https://github.com/alexprengere/csv2xls
- Owner: alexprengere
- License: apache-2.0
- Created: 2014-03-25T14:42:00.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-09-24T07:19:00.000Z (about 8 years ago)
- Last Synced: 2024-10-12T18:57:46.496Z (2 months ago)
- Topics: csv, excel, python, xls
- Language: Python
- Homepage: http://alexprengere.github.io/csv2xls/
- Size: 129 KB
- Stars: 18
- Watchers: 6
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README
- License: LICENSE
Awesome Lists containing this project
README
csv2xls
=======Put together some CSV files into a single Excel file, in different sheets.
Installation
------------You can install directly after cloning:
.. code-block:: bash
$ python setup.py install --user
Or use the Python package:
.. code-block:: bash
$ pip install --user csv2xls
Dependency
----------Outside the standard library, the `xlwt `_ package is needed, and should be
automatically installed with setuptools. Otherwise:.. code-block:: bash
$ pip install --user xlwt
Example
-------.. code-block:: bash
$ csv2xls examples/sheet_alpha.csv examples/sheet_beta.csv -o output.xls
Processing examples/sheet_alpha.csv -> output.xls/alpha
Processing examples/sheet_beta.csv -> output.xls/betaUsage
-----.. code-block:: bash
$ csv2xls -h
usage: csv2xls [-h] [-o OUTPUT] [-c] [-d DELIMITER] [-q QUOTECHAR] [-n]
[-D FORMAT] [-k]
files [files ...]Put together some CSV files into a single Excel file. Basic types are inferred
automatically.positional arguments:
filesoptional arguments:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
Define name for output Excel file. Default is
"output.xls".
-c, --clean Delete input files afterwards, if successful.
-d DELIMITER, --delimiter DELIMITER
Change row delimiter. Default is ",".
-q QUOTECHAR, --quotechar QUOTECHAR
Change quoting character. Default way of quoting is
"that is, quoted".
-n, --no-type-inference
Do not try to infer int/float/date when writing. This
mode is faster and preserves input data.
-D FORMAT, --date-format FORMAT
Change date format used during date type inference.
Default is "%Y-%m-%d".
-k, --keep-prefix Keep common prefix when building sheet names. Default
is to remove the common prefix of input file names.Example: csv2xls examples/sheet_alpha.csv examples/sheet_beta.csv
Tests
-----To run the tests, you must install `xls2txt `_:
.. code-block:: bash
$ git clone https://github.com/hroptatyr/xls2txt.git
$ cd xls2txt
$ make
$ sudo make installThen run:
.. code-block:: bash
$ ./tests.sh