• R/O
  • SSH

un-xtab: Resumo do Repositório

Source, documentation, and distribution code for un-xtab.py


Recent Commits RSS

Rev. Hora Autor Mensagem
4bb4e6cc7398 2020-01-05 10:06:12 Dreas Nielsen tip Modified README and menu to reference OSDN instead of RTD.
ab240c76d2d7 2020-01-03 23:13:03 Dreas Nielsen Changed repository in documentation; changed version in s...
05201eb58057 2019-09-12 11:28:05 Dreas Nielsen Allowed the 'data_columns' setting to accept letter colum...
dffe7cec5444 2019-07-22 02:28:49 Dreas Nielsen Modification to documentation in setup.py.
497f3b11e2d3 2019-07-22 02:23:37 Dreas Nielsen Fixed Markdown tables in readme and setup files.
5ba55bef9419 2019-07-21 23:27:52 Dreas Nielsen Updated setup.py with link to RTD.
a8e2d26ad262 2019-07-21 23:19:32 Dreas Nielsen Added link to RTD to the README file.
9e607401eb77 2019-07-21 22:49:26 Dreas Nielsen Added documentation source for ReadTheDocs.
e9a71f069e8e 2016-03-05 23:35:35 Dreas Nielsen Changed extension of help file.
568a8c43ebda 2016-01-24 05:12:49 Dreas Nielsen Added the '-n' command-line option to include a sequence ...

Recently edited Tags

Nome Rev. Hora Autor
tip 4bb4e6cc7398 2020-01-05 10:06:12 Dreas Nielsen

Branches

Nome Rev. Hora Autor Mensagem
default 4bb4e6cc7398 2020-01-05 10:06:12 Dreas Nielsen Modified README and menu to...

README.md

un-xtab.py Crosstabulate data in a text file.

un-xtab.py is a Python module and command-line program that rearranges data from a crosstabulated format to a normalized format. It takes data in this form:

Station 2006-05-23 2006-06-15 2006-07-19
WQ-01 4.5 3.7 6.8
WQ-02 9.7 5.1 7.2
WQ-03 10 6.1 8.8

and rearranges it into this form:

Station Date Value
WQ-01 2006-05-23 4.5
WQ-02 2006-05-23 3.7
WQ-03 2006-05-23 6.8
WQ-01 2006-06-15 9.7
WQ-02 2006-05-15 5.1
WQ-03 2006-06-15 7.2
WQ-01 2006-07-19 10
WQ-02 2006-07-19 6.1
WQ-03 2006-07-19 8.8

Input and output are both text (CSV) files.

Syntax and Options

  un-xtab.py [options] input_file_name output_file_name 

Arguments: 
  Input file name     The name of a text (CSV) file with crosstabbed data. 
  Output file name    The name of a text (CSV) to create with normalized data. 

Options:
  --version           Show program's version number and exit 
  -h, --help          Show this help message and exit 
  -c CONFIGFILE, --configfile=CONFIGFILE 
                      The name of the config file, with path if necessary. 
                      The default is to look for a configuration file with 
                      the same name as the input file, but with an extension 
                      of cfg, in the same directory as the input file. 
  -d, --displayspecs  Print the format specifications allowed in the 
                      configuration file, then exit.
  -e ENCODING, --encoding=ENCODING 
                      Character encoding of the CSV file. It should be one of 
                      the strings listed at http://docs.python.org/library/
                      codecs.html#standard-encodings.
  -n ROWSEQ, --number_rows=ROWSEQ
                      Add a sequential number to each output row, with a
                      column header of ROWSEQ.
  -o, --outputheaders Print the output column headers, then exit.
  -p, --printconfig   Pretty-print the configuration data after reading the
                      configuration file, then exit.
  -s SPECNAME, --specname=SPECNAME 
                      The name of the section to use in the configuration 
                      file. The default is to use the name of the input data file,
                      without its extension.

Complete documentation is available at OSDN <http://un-xtab.osdn.io/>_.

Copyright and License

Copyright (c) 2014, 2016, 2019, R.Dreas Nielsen

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. The GNU General Public License is available at http://www.gnu.org/licenses/.

Show on old repository browser