Source, documentation, and distribution code for un-xtab.py
Revisión | 12e72acef901460bd853c62b8845550c8f51988b (tree) |
---|---|
Tiempo | 2021-08-17 23:03:46 |
Autor | rdnielsen |
Commiter | rdnielsen |
Modified setup script, and renamed to .rst.
@@ -1,4 +1,5 @@ | ||
1 | 1 | # file GENERATED by distutils, do NOT edit |
2 | 2 | LICENSE.txt |
3 | +README.rst | |
3 | 4 | setup.py |
4 | 5 | un-xtab/un-xtab.py |
@@ -1,82 +0,0 @@ | ||
1 | -un-xtab.py | |
2 | -Crosstabulate data in a text file. | |
3 | - | |
4 | -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: | |
5 | - | |
6 | -| Station | 2006-05-23 | 2006-06-15 | 2006-07-19 | | |
7 | -|---------|------------|------------|------------| | |
8 | -| WQ-01 | 4.5 | 3.7 | 6.8 | | |
9 | -| WQ-02 | 9.7 | 5.1 | 7.2 | | |
10 | -| WQ-03 | 10 | 6.1 | 8.8 | | |
11 | - | |
12 | -and rearranges it into this form: | |
13 | - | |
14 | -| Station | Date | Value | | |
15 | -| ------- | ---------- | ----- | | |
16 | -| WQ-01 | 2006-05-23 | 4.5 | | |
17 | -| WQ-02 | 2006-05-23 | 3.7 | | |
18 | -| WQ-03 | 2006-05-23 | 6.8 | | |
19 | -| WQ-01 | 2006-06-15 | 9.7 | | |
20 | -| WQ-02 | 2006-05-15 | 5.1 | | |
21 | -| WQ-03 | 2006-06-15 | 7.2 | | |
22 | -| WQ-01 | 2006-07-19 | 10 | | |
23 | -| WQ-02 | 2006-07-19 | 6.1 | | |
24 | -| WQ-03 | 2006-07-19 | 8.8 | | |
25 | - | |
26 | -Input and output are both text (CSV) files. | |
27 | - | |
28 | - | |
29 | -Syntax and Options | |
30 | -================================ | |
31 | - | |
32 | -``` | |
33 | - un-xtab.py [options] input_file_name output_file_name | |
34 | - | |
35 | -Arguments: | |
36 | - Input file name The name of a text (CSV) file with crosstabbed data. | |
37 | - Output file name The name of a text (CSV) to create with normalized data. | |
38 | - | |
39 | -Options: | |
40 | - --version Show program's version number and exit | |
41 | - -h, --help Show this help message and exit | |
42 | - -c CONFIGFILE, --configfile=CONFIGFILE | |
43 | - The name of the config file, with path if necessary. | |
44 | - The default is to look for a configuration file with | |
45 | - the same name as the input file, but with an extension | |
46 | - of cfg, in the same directory as the input file. | |
47 | - -d, --displayspecs Print the format specifications allowed in the | |
48 | - configuration file, then exit. | |
49 | - -e ENCODING, --encoding=ENCODING | |
50 | - Character encoding of the CSV file. It should be one of | |
51 | - the strings listed at http://docs.python.org/library/ | |
52 | - codecs.html#standard-encodings. | |
53 | - -n ROWSEQ, --number_rows=ROWSEQ | |
54 | - Add a sequential number to each output row, with a | |
55 | - column header of ROWSEQ. | |
56 | - -o, --outputheaders Print the output column headers, then exit. | |
57 | - -p, --printconfig Pretty-print the configuration data after reading the | |
58 | - configuration file, then exit. | |
59 | - -s SPECNAME, --specname=SPECNAME | |
60 | - The name of the section to use in the configuration | |
61 | - file. The default is to use the name of the input data file, | |
62 | - without its extension. | |
63 | -``` | |
64 | - | |
65 | -Complete documentation is available at `OSDN <http://un-xtab.osdn.io/>`_. | |
66 | - | |
67 | - | |
68 | - | |
69 | -Copyright and License | |
70 | -====================== | |
71 | - | |
72 | -Copyright (c) 2014, 2016, 2019, R.Dreas Nielsen | |
73 | - | |
74 | -This program is free software: you can redistribute it and/or modify it under | |
75 | -the terms of the GNU General Public License as published by the Free Software | |
76 | -Foundation, either version 3 of the License, or (at your option) any later | |
77 | -version. This program is distributed in the hope that it will be useful, but | |
78 | -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
79 | -FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | |
80 | -details. The GNU General Public License is available at | |
81 | -http://www.gnu.org/licenses/. | |
82 | - |
@@ -0,0 +1,83 @@ | ||
1 | +un-xtab.py | |
2 | + | |
3 | +Crosstabulate data in a text file. | |
4 | + | |
5 | +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: | |
6 | + | |
7 | +| Station | 2006-05-23 | 2006-06-15 | 2006-07-19 | | |
8 | +|---------|------------|------------|------------| | |
9 | +| WQ-01 | 4.5 | 3.7 | 6.8 | | |
10 | +| WQ-02 | 9.7 | 5.1 | 7.2 | | |
11 | +| WQ-03 | 10 | 6.1 | 8.8 | | |
12 | + | |
13 | +and rearranges it into this form: | |
14 | + | |
15 | +| Station | Date | Value | | |
16 | +| ------- | ---------- | ----- | | |
17 | +| WQ-01 | 2006-05-23 | 4.5 | | |
18 | +| WQ-02 | 2006-05-23 | 3.7 | | |
19 | +| WQ-03 | 2006-05-23 | 6.8 | | |
20 | +| WQ-01 | 2006-06-15 | 9.7 | | |
21 | +| WQ-02 | 2006-05-15 | 5.1 | | |
22 | +| WQ-03 | 2006-06-15 | 7.2 | | |
23 | +| WQ-01 | 2006-07-19 | 10 | | |
24 | +| WQ-02 | 2006-07-19 | 6.1 | | |
25 | +| WQ-03 | 2006-07-19 | 8.8 | | |
26 | + | |
27 | +Input and output are both text (CSV) files. | |
28 | + | |
29 | + | |
30 | +Syntax and Options | |
31 | +================================ | |
32 | + | |
33 | +``` | |
34 | + un-xtab.py [options] input_file_name output_file_name | |
35 | + | |
36 | +Arguments: | |
37 | + Input file name The name of a text (CSV) file with crosstabbed data. | |
38 | + Output file name The name of a text (CSV) to create with normalized data. | |
39 | + | |
40 | +Options: | |
41 | + --version Show program's version number and exit | |
42 | + -h, --help Show this help message and exit | |
43 | + -c CONFIGFILE, --configfile=CONFIGFILE | |
44 | + The name of the config file, with path if necessary. | |
45 | + The default is to look for a configuration file with | |
46 | + the same name as the input file, but with an extension | |
47 | + of cfg, in the same directory as the input file. | |
48 | + -d, --displayspecs Print the format specifications allowed in the | |
49 | + configuration file, then exit. | |
50 | + -e ENCODING, --encoding=ENCODING | |
51 | + Character encoding of the CSV file. It should be one of | |
52 | + the strings listed at http://docs.python.org/library/ | |
53 | + codecs.html#standard-encodings. | |
54 | + -n ROWSEQ, --number_rows=ROWSEQ | |
55 | + Add a sequential number to each output row, with a | |
56 | + column header of ROWSEQ. | |
57 | + -o, --outputheaders Print the output column headers, then exit. | |
58 | + -p, --printconfig Pretty-print the configuration data after reading the | |
59 | + configuration file, then exit. | |
60 | + -s SPECNAME, --specname=SPECNAME | |
61 | + The name of the section to use in the configuration | |
62 | + file. The default is to use the name of the input data file, | |
63 | + without its extension. | |
64 | +``` | |
65 | + | |
66 | +Complete documentation is available at `OSDN <http://un-xtab.osdn.io/>`_. | |
67 | + | |
68 | + | |
69 | + | |
70 | +Copyright and License | |
71 | +====================== | |
72 | + | |
73 | +Copyright (c) 2014, 2016, 2019, 2021, R.Dreas Nielsen | |
74 | + | |
75 | +This program is free software: you can redistribute it and/or modify it under | |
76 | +the terms of the GNU General Public License as published by the Free Software | |
77 | +Foundation, either version 3 of the License, or (at your option) any later | |
78 | +version. This program is distributed in the hope that it will be useful, but | |
79 | +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
80 | +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | |
81 | +details. The GNU General Public License is available at | |
82 | +http://www.gnu.org/licenses/. | |
83 | + |
@@ -17,7 +17,6 @@ | ||
17 | 17 | 'Operating System :: OS Independent', |
18 | 18 | 'Topic :: Office/Business' |
19 | 19 | ], |
20 | - long_description_content_type="text/markdown", | |
21 | 20 | long_description="""``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: |
22 | 21 | |
23 | 22 | +---------+------------+------------+------------+ |