• R/O
  • SSH

xtab: 提交

Default repository for xtab.py


Commit MetaInfo

修訂96963d568dbcf930c92bfdf00cb78bdc9ad2d892 (tree)
時間2018-08-27 06:07:00
作者Dreas Nielsen <dreas.nielsen@gmai...>
CommiterDreas Nielsen

Log Message

Updated documentation, now hosted at ReadTheDocs.org.

Change Summary

差異

diff -r c597a237b1b0 -r 96963d568dbc .hgignore
--- a/.hgignore Thu Aug 23 21:12:18 2018 -0700
+++ b/.hgignore Sun Aug 26 14:07:00 2018 -0700
@@ -1,4 +1,5 @@
11 syntax=glob
2+MANIFEST
23 xtab.py~
34 setup-compile.py
45 build/*
diff -r c597a237b1b0 -r 96963d568dbc CHANGELOG.rst
--- a/CHANGELOG.rst Thu Aug 23 21:12:18 2018 -0700
+++ b/CHANGELOG.rst Sun Aug 26 14:07:00 2018 -0700
@@ -1,6 +1,7 @@
11 ========== ========== =================================================================================
22 Date Version Features
33 ========== ========== =================================================================================
4+2018-08-26 0.10.2 Documentation revisions.
45 2018-08-21 0.10.1 Modified to delete the error message file if it was created but no errors occurred.
56 2018-03-05 0.10.0 Modified so that sorting is controlled by a new option, "-s".
67 2018-02-15 0.9.2 Modified to sort column and row header values in ascending order.
diff -r c597a237b1b0 -r 96963d568dbc MANIFEST.in
--- a/MANIFEST.in Thu Aug 23 21:12:18 2018 -0700
+++ b/MANIFEST.in Sun Aug 26 14:07:00 2018 -0700
@@ -1,2 +1,1 @@
1-include doc/xtab.htm
21 include LICENSE.txt
diff -r c597a237b1b0 -r 96963d568dbc README.txt
--- a/README.txt Thu Aug 23 21:12:18 2018 -0700
+++ b/README.txt Sun Aug 26 14:07:00 2018 -0700
@@ -4,6 +4,9 @@
44 xtab.py is a Python module and command-line program that rearranges data from
55 a normalized format to a crosstabulated format.
66
7+A summary of its capability and usage is shown below. Full documentation
8+is available at http://xtab.readthedocs.org/.
9+
710 Contents
811 ======================
912
diff -r c597a237b1b0 -r 96963d568dbc doc/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/Makefile Sun Aug 26 14:07:00 2018 -0700
@@ -0,0 +1,20 @@
1+# Minimal makefile for Sphinx documentation
2+#
3+
4+# You can set these variables from the command line.
5+SPHINXOPTS =
6+SPHINXBUILD = sphinx-build
7+SPHINXPROJ = xtab
8+SOURCEDIR = source
9+BUILDDIR = build
10+
11+# Put it first so that "make" without argument is like "make help".
12+help:
13+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+.PHONY: help Makefile
16+
17+# Catch-all target: route all unknown targets to Sphinx using the new
18+# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+%: Makefile
20+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
\ No newline at end of file
diff -r c597a237b1b0 -r 96963d568dbc doc/source/availability.rst
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/source/availability.rst Sun Aug 26 14:07:00 2018 -0700
@@ -0,0 +1,17 @@
1+.. _availability:
2+
3+Availability
4+================================================================
5+
6+.. index:: Installation
7+
8+The xtab program is available on `PyPi <https://pypi.org/project/xtab/>`_.
9+It can be installed with:
10+
11+.. code-block:: none
12+
13+ pip install xtab
14+
15+.. index:: Repository
16+
17+The latest code is available from the `Bibucket repository <https://bitbucket.org/rdnielsen/xtab>`_.
diff -r c597a237b1b0 -r 96963d568dbc doc/source/change_log.rst
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/source/change_log.rst Sun Aug 26 14:07:00 2018 -0700
@@ -0,0 +1,6 @@
1+.. _changelog:
2+
3+Change Log
4+==============================================================
5+
6+.. include:: ../../CHANGELOG.rst
diff -r c597a237b1b0 -r 96963d568dbc doc/source/conf.py
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/source/conf.py Sun Aug 26 14:07:00 2018 -0700
@@ -0,0 +1,169 @@
1+# -*- coding: utf-8 -*-
2+#
3+# xtab documentation build configuration file, created by
4+# sphinx-quickstart on Fri Aug 24 07:03:23 2018.
5+#
6+# This file is execfile()d with the current directory set to its
7+# containing dir.
8+#
9+# Note that not all possible configuration values are present in this
10+# autogenerated file.
11+#
12+# All configuration values have a default; values that are commented out
13+# serve to show the default.
14+
15+# If extensions (or modules to document with autodoc) are in another directory,
16+# add these directories to sys.path here. If the directory is relative to the
17+# documentation root, use os.path.abspath to make it absolute, like shown here.
18+#
19+# import os
20+# import sys
21+# sys.path.insert(0, os.path.abspath('.'))
22+
23+
24+# -- General configuration ------------------------------------------------
25+
26+# If your documentation needs a minimal Sphinx version, state it here.
27+#
28+# needs_sphinx = '1.0'
29+
30+# Add any Sphinx extension module names here, as strings. They can be
31+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32+# ones.
33+extensions = ['sphinx.ext.autodoc']
34+
35+# Add any paths that contain templates here, relative to this directory.
36+templates_path = ['_templates']
37+
38+# The suffix(es) of source filenames.
39+# You can specify multiple suffix as a list of string:
40+#
41+# source_suffix = ['.rst', '.md']
42+source_suffix = '.rst'
43+
44+# The master toctree document.
45+master_doc = 'index'
46+
47+# General information about the project.
48+project = u'xtab'
49+copyright = u'2018, Dreas Nielsen'
50+author = u'Dreas Nielsen'
51+
52+# The version info for the project you're documenting, acts as replacement for
53+# |version| and |release|, also used in various other places throughout the
54+# built documents.
55+#
56+# The short X.Y version.
57+version = u'0.10.1'
58+# The full version, including alpha/beta/rc tags.
59+release = u'0.10.1'
60+
61+# The language for content autogenerated by Sphinx. Refer to documentation
62+# for a list of supported languages.
63+#
64+# This is also used if you do content translation via gettext catalogs.
65+# Usually you set "language" from the command line for these cases.
66+language = None
67+
68+# List of patterns, relative to source directory, that match files and
69+# directories to ignore when looking for source files.
70+# This patterns also effect to html_static_path and html_extra_path
71+exclude_patterns = []
72+
73+# The name of the Pygments (syntax highlighting) style to use.
74+pygments_style = 'sphinx'
75+
76+# If true, `todo` and `todoList` produce output, else they produce nothing.
77+todo_include_todos = False
78+
79+
80+# -- Options for HTML output ----------------------------------------------
81+
82+# The theme to use for HTML and HTML Help pages. See the documentation for
83+# a list of builtin themes.
84+#
85+html_theme_path = ["themes"]
86+html_theme = 'sunwood'
87+
88+# Theme options are theme-specific and customize the look and feel of a theme
89+# further. For a list of options available for each theme, see the
90+# documentation.
91+#
92+# html_theme_options = {}
93+
94+# Add any paths that contain custom static files (such as style sheets) here,
95+# relative to this directory. They are copied after the builtin static files,
96+# so a file named "default.css" will overwrite the builtin "default.css".
97+html_static_path = ['_static']
98+
99+# Custom sidebar templates, must be a dictionary that maps document names
100+# to template names.
101+#
102+# This is required for the alabaster theme
103+# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
104+html_sidebars = {
105+ '**': [
106+ 'relations.html', # needs 'show_related': True theme option to display
107+ 'searchbox.html',
108+ ]
109+}
110+
111+
112+# -- Options for HTMLHelp output ------------------------------------------
113+
114+# Output file base name for HTML help builder.
115+htmlhelp_basename = 'xtabdoc'
116+
117+
118+# -- Options for LaTeX output ---------------------------------------------
119+
120+latex_elements = {
121+ # The paper size ('letterpaper' or 'a4paper').
122+ #
123+ # 'papersize': 'letterpaper',
124+
125+ # The font size ('10pt', '11pt' or '12pt').
126+ #
127+ # 'pointsize': '10pt',
128+
129+ # Additional stuff for the LaTeX preamble.
130+ #
131+ # 'preamble': '',
132+
133+ # Latex figure (float) alignment
134+ #
135+ # 'figure_align': 'htbp',
136+}
137+
138+# Grouping the document tree into LaTeX files. List of tuples
139+# (source start file, target name, title,
140+# author, documentclass [howto, manual, or own class]).
141+latex_documents = [
142+ (master_doc, 'xtab.tex', u'xtab Documentation',
143+ u'Dreas Nielsen', 'manual'),
144+]
145+
146+
147+# -- Options for manual page output ---------------------------------------
148+
149+# One entry per manual page. List of tuples
150+# (source start file, name, description, authors, manual section).
151+man_pages = [
152+ (master_doc, 'xtab', u'xtab Documentation',
153+ [author], 1)
154+]
155+
156+
157+# -- Options for Texinfo output -------------------------------------------
158+
159+# Grouping the document tree into Texinfo files. List of tuples
160+# (source start file, target name, title, author,
161+# dir menu entry, description, category)
162+texinfo_documents = [
163+ (master_doc, 'xtab', u'xtab Documentation',
164+ author, 'xtab', 'One line description of project.',
165+ 'Miscellaneous'),
166+]
167+
168+
169+
diff -r c597a237b1b0 -r 96963d568dbc doc/source/copyright.rst
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/source/copyright.rst Sun Aug 26 14:07:00 2018 -0700
@@ -0,0 +1,15 @@
1+.. _copyright:
2+
3+Copyright and License
4+================================
5+
6+Copyright (c) 2008-2018 R.Dreas Nielsen
7+
8+This program is free software: you can redistribute it and/or modify it
9+under the terms of the GNU General Public License as published by the
10+Free Software Foundation, either version 3 of the License, or (at your
11+option) any later version. This program is distributed in the hope that
12+it will be useful, but WITHOUT ANY WARRANTY; without even the implied
13+warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
14+the GNU General Public License for more details. The GNU General Public
15+License is available at http://www.gnu.org/licenses/.
diff -r c597a237b1b0 -r 96963d568dbc doc/source/examples.rst
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/source/examples.rst Sun Aug 26 14:07:00 2018 -0700
@@ -0,0 +1,147 @@
1+.. _examples:
2+
3+Program Examples
4+================================
5+
6+The following examples illustrate usage of xtab.py as a command-line program.
7+
8+.. _example1:
9+
10+Example 1: Single Columns for Row and Column Headers
11+-----------------------------------------------------------
12+
13+At least one column of the input file must be specified for each of the
14+three elements of the output file: a row heading, a column heading, and
15+a cell value. Therefore every input file must have at least three
16+columns, as illustrated by the following table.
17+
18+======= ========== =====
19+Station Date Value
20+======= ========== =====
21+WQ-01 2006-05-23 4.5
22+WQ-02 2006-05-23 3.7
23+WQ-03 2006-05-23 6.8
24+WQ-01 2006-06-15 9.7
25+WQ-02 2006-05-15 5.1
26+WQ-03 2006-06-15 7.2
27+WQ-01 2006-07-19 10
28+WQ-02 2006-07-19 6.1
29+WQ-03 2006-07-19 8.8
30+======= ========== =====
31+
32+.. index:: CSV
33+
34+The corresponding CSV file would look something like:
35+
36+.. code-block:: none
37+
38+ Station,Date,Value
39+ WQ-01,2006-05-23,4.5
40+ WQ-02,2006-05-23,3.7
41+ WQ-03,2006-05-23,6.8
42+ WQ-01,2006-06-15,9.7
43+ WQ-02,2006-05-15,5.1
44+ WQ-03,2006-06-15,7.2
45+ WQ-01,2006-07-19,10
46+ WQ-02,2006-07-19,6.1
47+ WQ-03,2006-07-19,8.8
48+
49+A command-line command to transform this file (*input.csv*) might look
50+like this:
51+
52+.. code-block:: sh
53+
54+ xtab.py -i input.csv -o output.csv -r Station -c Date -v Value
55+
56+And the resulting table (*output.csv*) would look like:
57+
58+======= ========== ========== ==========
59+Station 2006-05-23 2006-06-15 2006-07-19
60+======= ========== ========== ==========
61+WQ-01 4.5 3.7 6.8
62+WQ-02 9.7 5.1 7.2
63+WQ-03 10 6.1 8.8
64+======= ========== ========== ==========
65+
66+
67+.. _example2:
68+
69+Example 2: Multiple Row and Column Headers
70+-----------------------------------------------------------
71+
72+The input file may contain multiple columns with values that are to be
73+preserved as separate columns in the output (these are listed after the
74+*-r* command-line flag). The output file may have columns that
75+represent the combination of several columns in the input file (listed
76+after the *-c* command-line flag), and the output file may have
77+multiple columns in the crosstabbed result (listed after the *-v*
78+flag). This example illustrates all three of these features.
79+
80+For an input data file (*input.csv*) like the following,
81+
82+============= ============ ======== ======== ====== =========== =======
83+location_id sample_date analyte value units meas_basis quals
84+============= ============ ======== ======== ====== =========== =======
85+RM708B1 2005-04-07 Arsenic 3.9 mg/kg dry U
86+RM708B1 2005-04-07 Cadmium 1.6 mg/kg dry
87+RM708B1 2005-04-07 Copper 14.1 mg/kg dry
88+RM708B1 2005-04-07 Mercury 0.078 mg/kg dry J
89+RM708B1 2005-04-07 Arsenic 4.1 mg/kg dry U
90+RM708B1 2005-04-07 Cadmium 1.3 mg/kg dry
91+RM708B1 2005-04-07 Copper 14.6 mg/kg dry
92+RM708B1 2005-04-07 Mercury 0.061 mg/kg dry J
93+RM744X2 2005-04-08 Arsenic 29.1 mg/kg dry
94+RM744X2 2005-04-08 Cadmium 2.9 mg/kg dry
95+RM744X2 2005-04-08 Copper 2380.0 mg/kg dry
96+RM744X2 2005-04-08 Mercury 0.011 mg/kg dry J
97+RM744X2 2005-04-08 Arsenic 28.3 mg/kg dry
98+RM744X2 2005-04-08 Cadmium 2.6 mg/kg dry
99+RM744X2 2005-04-08 Copper 2330.0 mg/kg dry
100+RM744X2 2005-04-08 Mercury 0.015 mg/kg dry J
101+RM742B2 2005-04-09 Cadmium 1.2 mg/kg dry
102+RM742B2 2005-04-09 Arsenic 24.6 mg/kg dry
103+RM742B2 2005-04-09 Copper 2190.0 mg/kg dry
104+RM742B2 2005-04-09 Mercury 0.01 mg/kg dry J
105+RM742B2 2005-04-09 Arsenic 25.2 mg/kg dry
106+RM742B2 2005-04-09 Cadmium 1.2 mg/kg dry
107+RM742B2 2005-04-09 Copper 2240.0 mg/kg dry
108+RM742B2 2005-04-09 Mercury 0.03 mg/kg dry J
109+RM704X3 2005-04-08 Arsenic 10.0 mg/kg dry
110+RM704X3 2005-04-08 Cadmium 4.7 mg/kg dry
111+RM704X3 2005-04-08 Copper 42.4 mg/kg dry
112+RM704X3 2005-04-08 Mercury 0.62 mg/kg dry
113+RM704X3 2005-04-08 Arsenic 6.8 mg/kg dry
114+RM704X3 2005-04-08 Cadmium 4.0 mg/kg dry
115+RM704X3 2005-04-08 Copper 35.9 mg/kg dry
116+RM704X3 2005-04-08 Mercury 0.92 mg/kg dry
117+RM726X1 2005-04-08 Arsenic 10.6 mg/kg dry
118+RM726X1 2005-04-08 Cadmium 2.0 mg/kg dry
119+============= ============ ======== ======== ====== =========== =======
120+
121+the command:
122+
123+.. code-block:: sh
124+
125+ xtab.py -d3 -i input.csv -o output.csv -r location_id sample_date
126+ -c analyte units meas_basis -v value quals
127+
128+
129+(the command line is wrapped for readability) will produce the following
130+output (*output.csv*):
131+
132++---------------+---------------+-----------+---------+-----------+---------+----------+---------+-----------+---------+
133+| | | | Arsenic | | | Cadmium | | | Copper | | | Mercury | |
134+| | | | mg/kg | | | mg/kg | | | mg/kg | | | mg/kg | |
135+| | | | dry | | | dry | | | dry | | | dry | |
136+| | location_id | | sample_date | | value | | quals | | value | | quals | | value | | quals | | value | | quals |
137++===============+===============+===========+=========+===========+=========+==========+=========+===========+=========+
138+| RM708B1 | 2005-04-07 | 3.9 | U | 1.6 | | 14.1 | | 0.078 | J |
139++---------------+---------------+-----------+---------+-----------+---------+----------+---------+-----------+---------+
140+| RM744X2 | 2005-04-08 | 29.1 | | 2.9 | | 2380.0 | | 0.011 | J |
141++---------------+---------------+-----------+---------+-----------+---------+----------+---------+-----------+---------+
142+| RM742B2 | 2005-04-09 | 24.6 | | 1.2 | | 2190.0 | | 0.01 | J |
143++---------------+---------------+-----------+---------+-----------+---------+----------+---------+-----------+---------+
144+| RM704X3 | 2005-04-08 | 10.0 | | 4.7 | | 42.4 | | 0.62 | |
145++---------------+---------------+-----------+---------+-----------+---------+----------+---------+-----------+---------+
146+| RM726X1 | 2005-04-08 | 10.6 | | 2.0 | | | | | |
147++---------------+---------------+-----------+---------+-----------+---------+----------+---------+-----------+---------+
diff -r c597a237b1b0 -r 96963d568dbc doc/source/index.rst
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/source/index.rst Sun Aug 26 14:07:00 2018 -0700
@@ -0,0 +1,32 @@
1+.. xtab documentation master file, created by
2+
3+.. _home:
4+
5+Crosstabbing CSV Data Tables
6+================================
7+
8+.. toctree::
9+ :maxdepth: 3
10+ :hidden:
11+
12+ Home <self>
13+ syntax
14+ notes
15+ examples
16+ availability
17+ copyright
18+ change_log
19+
20+.. index:: CSV
21+
22+xtab.py is a Python module and command-line program that rearranges data
23+in a CSV file from a normalized format to a crosstabulated format. Typical
24+input and output formats are illustrated in the :ref:`examples <examples>`.
25+
26+You can use *xtab* as a program or a library to:
27+
28+ * Rearrange data exported from a database to better suit its subsequent usage in statistical, modeling, graphics, or other software, or for easier browsing.
29+
30+ * Convert a single file of data to a SQLite database.
31+
32+ * Check for multiple rows of data in a text file with the same key values.
diff -r c597a237b1b0 -r 96963d568dbc doc/source/notes.rst
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/source/notes.rst Sun Aug 26 14:07:00 2018 -0700
@@ -0,0 +1,63 @@
1+.. _notes:
2+
3+Program Usage Notes
4+========================================
5+
6+Following are a few details of the operation of xtab.py when it is used
7+as a command-line program.
8+
9+.. index:: Data summarization
10+ single: summarization
11+
12+Data summarization
13+ The xtab program does not carry out any summarization or calculation
14+ on the data values, and therefore there should be no more than one data
15+ value to be placed in each cell of the output table. More than one
16+ value per cell is regarded as an error, and in such cases only one of
17+ the multiple values will be put in the cell.
18+
19+Multiple data values
20+ Multiple data values can be crosstabbed, as specified by multiple
21+ column names supplied with the -c argument.
22+
23+.. index:: Case sensitivity
24+
25+Case sensitivity
26+ Column names should be specified on the command line in the same
27+ case as they appear in the input file.
28+
29+.. index:: SQLite
30+
31+SQLite file
32+ The -f option creates a temporary SQLite file in the same directory
33+ as the output file. This file has the same name as the input file,
34+ but an extension of '.sqlite'.
35+
36+.. index:: Number of rows
37+ single: Number of columns
38+
39+Number of rows and columns
40+ There are no inherent limits to the number of rows or columns in
41+ the input or output files. Consequently, the output may exceed the
42+ limits of some spreadsheets or other software.
43+
44+.. index:: Output format
45+
46+Missing arguments
47+ Missing required arguments will result in an exception rather than
48+ an error message, whatever the error logging option. If no error
49+ logging option is specified, then if there are multiple values to be
50+ put in a cell (the most likely data error), a single message will be
51+ printed on the console. If an error logging option is specified, then
52+ the SQL for all individual cases where there are multiple values per
53+ cell will be logged. The occurrence of multiple values for a cell can
54+ also be seen in the output from the -q option.
55+
56+.. index:: Required arguments
57+ single: Arguments
58+
59+Output format
60+ The -d2, -d3, and -d4 options produce output in formats that are
61+ intended to facilitate visual examination, rather than automated
62+ processing by subsequent software.
63+
diff -r c597a237b1b0 -r 96963d568dbc doc/source/syntax.rst
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/source/syntax.rst Sun Aug 26 14:07:00 2018 -0700
@@ -0,0 +1,124 @@
1+.. highlight:: sh
2+
3+.. index:: ! Command-line options
4+
5+.. _syntax:
6+
7+Command-Line Syntax
8+================================
9+
10+xtab.py should be run at the operating-system command line--i.e., at a
11+shell prompt in Linux or in a command window in Windows. Python may or
12+may not need to be explicitly invoked, and the .py extension may or may
13+not need to be included, depending on your operating system, operating
14+system seetings, and how xtab is :ref:`installed <availability>`.
15+
16+For Linux users: The xtab.py file contains a shebang line pointing to
17+/usr/bin/python, so there should be no need to invoke the Python
18+interpreter. Depending on how xtab.py was obtained and installed,
19+it may need to be made executable with the *chmod* command.
20+
21+For Windows users: If you are unfamiliar with running Python programs
22+at the command prompt, see https://docs.python.org/2/faq/windows.html.
23+
24+In the following syntax descriptions, angle brackets identify required
25+replaceable elements, and square brackets identify optional replaceable
26+elements.
27+
28+.. code-block:: sh
29+
30+ xtab.py [options] -i <input_file> -o <output_file> -r <row_headers> -c <column_headers> -v <value_headers>
31+
32+.. index:: Required arguments
33+ single: Arguments
34+
35+Required Arguments
36+-------------------------------
37+
38+.. code-block:: none
39+
40+ -i <filename>
41+ The name of the input file from which to read data.
42+ This must be a text file, with data in a normalized format.
43+ The first line of the file must contain column names.
44+ -o <filename>
45+ The name of the output file to create. The output file
46+ will be created as a .csv file.
47+ -r <column_name1> [column_name2 [...]]
48+ One or more column names to use as row headers. Multiple
49+ column names should be separated by a space. Unique values
50+ of these columns will appear at the beginning of every output
51+ line.
52+ -c <column_name1> [column_name2 [...]]
53+ One or more column names to use as column headers in the
54+ output. Multiple column names should be separated by a space.
55+ A crosstab column (or columns) will be created for every
56+ unique combination of values of these fields in the input.
57+ -v <column_name1> [column_name2 [...]]
58+ One or more column names with values to be used to fill the
59+ cells of the cross-table. If *n* columns names are specified,
60+ then there will be *n* columns in the output table for each
61+ of the column headers corresponding to values of the -c
62+ argument. The column names specified with the -v argument
63+ will be appended to the output column headers created from
64+ values of the -c argument. There should be only one value
65+ of the -v column(s) for each combination of the -r and -c
66+ columns; if there is more than one, a warning will be printed
67+ and only the first value will appear in the output. That is,
68+ values are not combined in any way when there are multiple
69+ values for each output cell.
70+
71+
72+.. index:: Optional arguments
73+ single: Arguments
74+
75+Optional Arguments
76+-------------------------------
77+
78+.. index:: Errors
79+ single: Output format
80+ single: SQLite
81+ single: Logging
82+
83+.. code-block:: none
84+
85+ -d[1|2|3|4]
86+ Controls the format of column headers. The four alternatives are:
87+ -d1 or no option specified
88+ One row of column headers, with elements joined by
89+ underscores to facilitate parsing by other programs.
90+ -d or -d2
91+ Two rows of column headers. The first row contains
92+ values of the columns specified by the -c argument,
93+ and the second row contains the column names specified
94+ by the -v argument.
95+ -d3
96+ One header row for each of the values of the columns
97+ specified by the -c argument, plus one row with the
98+ column names specified by the -v argument.
99+ -d4
100+ Like -d3, but the values of the columns specified by
101+ the -c argument are labeled with (preceded by) the
102+ column names.
103+ -f
104+ Use a temporary (sqlite) file instead of memory for intermediate
105+ storage.
106+ -n
107+ Use the specified default string in the output wherever an empty
108+ or null value would otherwise appear.
109+ -k
110+ Keep (i.e., do not delete) the sqlite file. Only useful with the
111+ "-f" option. Unless the "-t" option is also used, the table name
112+ will be "src".
113+ -t <tablename>
114+ Name to use for the table in the intermediate sqlite database.
115+ Only useful with the "-f" and "-k" options.
116+ -e [filename]
117+ Log all error messages, to a file if the filename is specified
118+ or to the console if the filename is not specified.
119+ -q <filename>
120+ Log the sequence of SQL commands used to extract data from the
121+ input file to write the output file, including the result of
122+ each command.
123+ -h
124+ Print this help and exit.
diff -r c597a237b1b0 -r 96963d568dbc doc/source/themes/sunwood/layout.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/source/themes/sunwood/layout.html Sun Aug 26 14:07:00 2018 -0700
@@ -0,0 +1,77 @@
1+{#
2+ sunwood/layout.html
3+ ~~~~~~~~~~~~~~~~~
4+
5+ Sphinx layout template for the sunwood theme.
6+ Modified from the agogo theme, written by Andi Albrecht.
7+
8+ :copyright: Copyright 2017, R. Dreas Nielsen
9+ :license: BSD
10+ agogo theme Copyright 2007-2016 by the Sphinx team, see AUTHORS.
11+#}
12+{%- extends "basic/layout.html" %}
13+
14+{% block header %}
15+ <div class="header-wrapper" role="banner">
16+ <div class="header">
17+ </div>
18+ {%- block headertitle %}
19+ <div class="headertitle"><a
20+ href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>
21+ </div>
22+ {%- endblock %}
23+ </div>
24+{% endblock %}
25+
26+{% block content %}
27+ <div class="content-wrapper">
28+ <div class="content">
29+ <div class="document">
30+ {%- block document %}
31+ {{ super() }}
32+ {%- endblock %}
33+ </div>
34+ <div class="sidebar">
35+ {%- block sidebartoc %}
36+ <h3>{{ _('Contents') }}</h3>
37+ {{ toctree(includehidden=True) }}
38+ {%- endblock %}
39+ {%- block sidebargoto %}
40+ <div class="sidebarnav" role="navigation">
41+ <h3 style="margin-top: 0.5em;">{{ _('Go To') }}</h3>
42+ <div class="sidebarnavlinks">
43+ {%- for rellink in rellinks|reverse %}
44+ <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}"
45+ {{ accesskey(rellink[2]) }}>{{ rellink[3]|title }}</a>
46+ {%- if not loop.last %}{{ reldelim2 }}{% endif %}
47+ {%- endfor %}
48+ </div>
49+ </div>
50+ {% endblock %}
51+ {%- block sidebarsearch %}
52+ <div role="search">
53+ <h3 style="margin-top: 0.5em;">{{ _('Search') }}</h3>
54+ <form class="search" action="{{ pathto('search') }}" method="get">
55+ <input type="text" name="q" />
56+ <input type="submit" value="{{ _('Search') }}" />
57+ <input type="hidden" name="check_keywords" value="yes" />
58+ <input type="hidden" name="area" value="default" />
59+ </form>
60+ </div>
61+ {%- endblock %}
62+ </div>
63+ <div class="clearer"></div>
64+ </div>
65+ </div>
66+{% endblock %}
67+
68+{% block footer %}
69+ <div class="footer-wrapper">
70+ <div class="footer">
71+ <div class="right">{{ super() }}</div>
72+ </div>
73+ </div>
74+{% endblock %}
75+
76+{% block relbar1 %}{% endblock %}
77+{% block relbar2 %}{% endblock %}
diff -r c597a237b1b0 -r 96963d568dbc doc/source/themes/sunwood/static/sunwood.css_t
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/source/themes/sunwood/static/sunwood.css_t Sun Aug 26 14:07:00 2018 -0700
@@ -0,0 +1,655 @@
1+/*
2+ * sunwood.css_t
3+ * ~~~~~~~~~~~
4+ *
5+ * Sphinx stylesheet -- sunwood theme.
6+ *
7+ * :copyright: Copyright 2017, R. Dreas Nielsen
8+ * :license: BSD
9+ *
10+ * Adapted from the agogo theme.
11+ * agogo theme copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
12+ * agogo license: BSD, see LICENSE for details.
13+ *
14+ */
15+
16+* {
17+ margin: 0px;
18+ padding: 0px;
19+}
20+
21+body {
22+ font-family: {{ theme_bodyfont }};
23+ line-height: 1.4em;
24+ color: black;
25+ background-color: #f2ecd1;
26+}
27+
28+
29+/* Page layout */
30+
31+div.header, div.content, div.footer {
32+ width: {{ theme_pagewidth }};
33+ margin-left: 1em;
34+ margin-right: 0;
35+ background-color: #f2ecd1;
36+}
37+
38+div.header-wrapper {
39+ background-color: #f2ecd1;
40+ height: 7em;
41+}
42+
43+
44+/* Default body styles */
45+a {
46+ color: {{ theme_linkcolor }};
47+ text-decoration: none;
48+}
49+a:link, a:visited, a:active {
50+ color: {{ theme_linkcolor }};
51+ text-decoration: none;
52+ }
53+a:hover {
54+ color: #4E2A16;
55+ }
56+
57+div.bodywrapper a, div.footer a {
58+ text-decoration: none;
59+}
60+
61+div.bodywrapper {
62+ background-color: #F3F1E2;
63+ padding: 0.5em 0.5em;
64+ padding-left: 3em;
65+ border: 1px solid #814324;
66+ }
67+div.bodywrapper h1, div.bodywrapper h2 {
68+ margin-top: 0;
69+ margin-left: -1.0em;
70+ }
71+
72+
73+.clearer {
74+ clear: both;
75+}
76+
77+.left {
78+ float: left;
79+}
80+
81+.right {
82+ float: right;
83+}
84+
85+.line-block {
86+ display: block;
87+ margin-top: 1em;
88+ margin-bottom: 1em;
89+}
90+
91+.line-block .line-block {
92+ margin-top: 0;
93+ margin-bottom: 0;
94+ margin-left: 1.5em;
95+}
96+
97+h1, h2, h3, h4 {
98+ font-family: {{ theme_headerfont }};
99+ font-weight: normal;
100+ color: {{ theme_headercolor2 }};
101+ margin-bottom: .8em;
102+}
103+
104+h1 {
105+ color: {{ theme_headercolor1 }};
106+ border-bottom: 2px solid {{ theme_headercolor1 }};
107+ font-size: 1.5em;
108+}
109+
110+h2 {
111+ padding-bottom: .5em;
112+ border-bottom: 1px solid {{ theme_headercolor2 }};
113+ font-size: 1.2em;
114+}
115+
116+a.headerlink {
117+ visibility: hidden;
118+ color: #dddddd;
119+ padding-left: .3em;
120+}
121+
122+h1:hover > a.headerlink,
123+h2:hover > a.headerlink,
124+h3:hover > a.headerlink,
125+h4:hover > a.headerlink,
126+h5:hover > a.headerlink,
127+h6:hover > a.headerlink,
128+dt:hover > a.headerlink,
129+caption:hover > a.headerlink,
130+p.caption:hover > a.headerlink,
131+div.code-block-caption:hover > a.headerlink {
132+ visibility: visible;
133+}
134+
135+img {
136+ margin-left: 2em;
137+ border: 1px dotted {{ theme_border_color }};
138+}
139+
140+div.admonition {
141+ margin-top: 10px;
142+ margin-bottom: 10px;
143+ padding: 2px 7px 1px 7px;
144+ border-left: 0.2em solid {{ theme_border_color }};
145+}
146+
147+p.admonition-title {
148+ margin: 0px 10px 5px 0px;
149+ font-weight: bold;
150+}
151+
152+dt:target, .highlighted {
153+ background-color: #fbe54e;
154+}
155+
156+table {
157+ font-family: "Liberation Sans", sans-serif;
158+ border-top: 2px solid #814324;
159+ border-bottom: 2px solid #814324;
160+ border-left: 1px dotted #814324;
161+ border-right: 1px dotted #814324;
162+ border-collapse: collapse;
163+ font-size: 0.9em;
164+ color: #814324;
165+ vertical-align: top;
166+ line-height: 120%;
167+ }
168+td {
169+ color: black;
170+ text-align: left;
171+ padding-left: 10px;
172+ padding-right: 10px;
173+ padding-top: 4px;
174+ padding-bottom: 4px;
175+ border-right: 1px dotted #814324;
176+ }
177+th {
178+ padding: 6px 6px;
179+ text-align: center;
180+ color: #814324;
181+ background-color: #e4d798;
182+ border-right: 1px dotted #814324;
183+ }
184+tr.hdr {
185+ font-weight: bold;
186+ }
187+thead tr {
188+ border-bottom: 1px solid #814324;
189+ background-color: #F3F1E2;
190+ }
191+tbody tr {
192+ border-bottom: 1px dotted #814324;
193+ }
194+
195+/* Header */
196+
197+div.header {
198+ position: absolute;
199+ top: 0; left: 10%; width: 65%;
200+ background-color: #FFE4B5;
201+ background-color: rgb(228, 215, 152);
202+ border-bottom: 4px solid #814324;
203+ border-left: 4px solid #814324;
204+ border-right: 4px solid #814324;
205+ height: 5em;
206+ }
207+
208+div.headertitle {
209+ position: relative;
210+ top: 0.5em; left: 5%; width: 75%;
211+ padding: 0.5em 3em 0.5em 0em;
212+ text-align: center;
213+ font-family: "Liberation Sans", "DejaVu Sans", "Bitstream Vera Sans", Arial, Helvetica, sans-serif;
214+ font-size: 1.5em;
215+ font-weight: bold;
216+ word-spacing: 0.05em;
217+ color: #814324;
218+ background-color: rgb(250, 250, 210);
219+ border: 1px solid #814324;
220+ opacity: 0.8;
221+ }
222+
223+
224+div.header .headertitle a {
225+ color: #814324;
226+}
227+
228+div.header div.rel {
229+ margin-top: 1em;
230+}
231+
232+div.header div.rel a {
233+ color: {{ theme_headerlinkcolor }};
234+ letter-spacing: .1em;
235+ text-transform: uppercase;
236+}
237+
238+p.logo {
239+ float: right;
240+}
241+
242+img.logo {
243+ border: 0;
244+}
245+
246+
247+/* Content */
248+div.content-wrapper {
249+ background-color: #f2ecd1;
250+ padding-bottom: 20px;
251+}
252+
253+div.document {
254+ width: {{ theme_documentwidth }};
255+ float: left;
256+ background-color: #f2ecd1;
257+}
258+
259+div.body {
260+ padding-right: 2em;
261+ text-align: {{ theme_textalign }};
262+}
263+
264+div.document h1 {
265+ line-height: 120%;
266+}
267+
268+div.document ul {
269+ margin: 1.5em;
270+ list-style-type: disc;
271+}
272+
273+div.document li::marker {
274+ color: #814324;
275+ }
276+
277+div.document dd {
278+ margin-left: 1.2em;
279+ margin-top: .4em;
280+ margin-bottom: 1em;
281+}
282+
283+div.document .section {
284+ margin-top: 1.7em;
285+}
286+div.document .section:first-child {
287+ margin-top: 0px;
288+}
289+
290+div.document div.highlight {
291+ margin: 0.5em 1em;
292+ padding: 0.5em 1.0em;
293+ border: 1px dotted rgb(123, 108, 34);
294+ min-width: 40em;
295+ max-width: 80%;
296+ overflow-x: auto;
297+ font-family: "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Lucida Console", "Courier New", Courier, fixed;
298+ font-size: 1.0em;
299+ line-height: 110%;
300+ background-color: #F5F4F0;
301+ color: #4C1200;
302+ white-space: pre;
303+ display: inline-block;
304+ }
305+
306+div.document div.literal-block-wrapper {
307+ margin-top: .8em;
308+ margin-bottom: .8em;
309+}
310+
311+div.document div.literal-block-wrapper div.highlight {
312+ margin: 0;
313+}
314+
315+div.document div.code-block-caption span.caption-number {
316+ padding: 0.1em 0.3em;
317+ font-style: italic;
318+}
319+
320+div.document div.code-block-caption span.caption-text {
321+}
322+
323+div.document h2 {
324+ margin-top: .7em;
325+}
326+
327+div.document p {
328+ margin-bottom: .5em;
329+}
330+
331+div.document li.toctree-l1 {
332+ margin-bottom: 1em;
333+}
334+
335+div.document .descname {
336+ font-weight: bold;
337+}
338+
339+div.document .sig-paren {
340+ font-size: larger;
341+}
342+
343+div.document .docutils.literal {
344+ background-color: #eeeeec;
345+ padding: 1px;
346+}
347+
348+div.document .docutils.xref.literal {
349+ background-color: transparent;
350+ padding: 0px;
351+}
352+
353+div.document blockquote {
354+ margin: 1em;
355+}
356+
357+div.document ol {
358+ margin: 1.5em;
359+}
360+
361+
362+/* Sidebar */
363+
364+div.sidebar {
365+ width: {{ theme_sidebarwidth }};
366+ float: right;
367+ font-family: "Liberation Sans", sans-serif;
368+ font-size: .9em;
369+ line-height: 120%;
370+ border: 1px solid #814324;
371+ color: #814324;
372+ /*background-color: #f2ecd1;*/
373+ /*background-color: #f3f1e2;*/
374+ background-color: #f3efda;
375+ /*box-shadow: 5px 5px 3px #AAAAAA;*/
376+ box-shadow: 5px 5px 3px #B8BF8F;
377+}
378+
379+div.sidebar a, div.header a {
380+ text-decoration: none;
381+}
382+
383+div.sidebar a:hover, div.header a:hover {
384+ text-decoration: underline;
385+ color: #4e2a16;
386+}
387+
388+
389+div.sidebar h3 {
390+ font-family: "Liberation Sans", sans-serif;
391+ color: #814324;
392+ font-weight: bold;
393+ background-color: #e4d798;
394+ border-bottom: 1px solid #814324;
395+ border-top: 1px solid #814324;
396+ margin-bottom: 5px;
397+ padding-left: 5px;
398+ padding-top: 5px;
399+ padding-bottom: 3px;
400+ letter-spacing: .1em;
401+}
402+
403+div.sidebar ul {
404+ list-style-type: none;
405+ margin-left: 3px;
406+}
407+
408+div.sidebar li.toctree-l1 a {
409+ display: block;
410+ color: #814324;
411+ background-color: transparent;
412+ margin-left: 3px;
413+ padding-left: 3px;
414+}
415+
416+div.sidebar li.toctree-l2 a {
417+ color: #814324;
418+ background-color: transparent;
419+ border: none;
420+ margin-left: 1em;
421+}
422+
423+div.sidebar li.toctree-l3 a {
424+ color: #814324;
425+ background-color: transparent;
426+ border: none;
427+ margin-left: 2em;
428+}
429+
430+div.sidebar li.toctree-l2:last-child a {
431+ border-bottom: none;
432+}
433+
434+div.sidebar input[type="text"] {
435+ font-size: 0.9em;
436+ width: 150px;
437+ margin-left: 6px;
438+ margin-bottom: 6px;
439+}
440+
441+div.sidebar input[type="submit"] {
442+ font-size: 0.9em;
443+ width: auto;
444+ padding-left: 3px;
445+ padding-right: 3px;
446+ text-align: center;
447+ margin-bottom: 6px;
448+}
449+
450+div.sidebar div.sidebarnavlinks {
451+ padding: 0.5em 1.0em;
452+ font-size: 0.9em;
453+ }
454+
455+
456+/* Footer */
457+
458+div.footer-wrapper {
459+ background: #e4d798;
460+ border-top: 4px solid {{ theme_border_color }};
461+ border-bottom: 2px solid {{ theme_border_color }};
462+ padding-top: 10px;
463+ padding-bottom: 10px;
464+ min-height: 2em;
465+}
466+
467+div.footer, div.footer a {
468+ background: #e4d798;
469+ color: #888a85;
470+}
471+
472+div.footer .right {
473+ text-align: right;
474+}
475+
476+div.footer .left {
477+ text-transform: uppercase;
478+}
479+
480+
481+/* Styles copied from basic theme */
482+
483+img.align-left, .figure.align-left, object.align-left {
484+ clear: left;
485+ float: left;
486+ margin-right: 1em;
487+}
488+
489+img.align-right, .figure.align-right, object.align-right {
490+ clear: right;
491+ float: right;
492+ margin-left: 1em;
493+}
494+
495+img.align-center, .figure.align-center, object.align-center {
496+ display: block;
497+ margin-left: auto;
498+ margin-right: auto;
499+}
500+
501+.align-left {
502+ text-align: left;
503+}
504+
505+.align-center {
506+ text-align: center;
507+}
508+
509+.align-right {
510+ text-align: right;
511+}
512+
513+table caption span.caption-number {
514+ font-style: italic;
515+}
516+
517+table caption span.caption-text {
518+}
519+
520+div.figure p.caption span.caption-number {
521+ font-style: italic;
522+}
523+
524+div.figure p.caption span.caption-text {
525+}
526+
527+/* -- search page ----------------------------------------------------------- */
528+
529+ul.search {
530+ margin: 10px 0 0 20px;
531+ padding: 0;
532+}
533+
534+ul.search li {
535+ padding: 5px 0 5px 20px;
536+ background-image: url(file.png);
537+ background-repeat: no-repeat;
538+ background-position: 0 7px;
539+}
540+
541+ul.search li a {
542+ font-weight: bold;
543+}
544+
545+ul.search li div.context {
546+ color: #888;
547+ margin: 2px 0 0 30px;
548+ text-align: left;
549+}
550+
551+ul.keywordmatches li.goodmatch a {
552+ font-weight: bold;
553+}
554+
555+/* -- index page ------------------------------------------------------------ */
556+
557+table.contentstable {
558+ width: 90%;
559+}
560+
561+table.contentstable p.biglink {
562+ line-height: 150%;
563+}
564+
565+a.biglink {
566+ font-size: 1.3em;
567+}
568+
569+span.linkdescr {
570+ font-style: italic;
571+ padding-top: 5px;
572+ font-size: 90%;
573+}
574+
575+/* -- general index --------------------------------------------------------- */
576+
577+table.indextable td {
578+ text-align: left;
579+ vertical-align: top;
580+}
581+
582+table.indextable ul {
583+ margin-top: 0;
584+ margin-bottom: 0;
585+ list-style-type: none;
586+}
587+
588+table.indextable > tbody > tr > td > ul {
589+ padding-left: 0em;
590+}
591+
592+table.indextable tr.pcap {
593+ height: 10px;
594+}
595+
596+table.indextable tr.cap {
597+ margin-top: 10px;
598+ background-color: #f2f2f2;
599+}
600+
601+img.toggler {
602+ margin-right: 3px;
603+ margin-top: 3px;
604+ cursor: pointer;
605+}
606+
607+/* -- domain module index --------------------------------------------------- */
608+
609+table.modindextable td {
610+ padding: 2px;
611+ border-collapse: collapse;
612+}
613+
614+/* -- viewcode extension ---------------------------------------------------- */
615+
616+.viewcode-link {
617+ float: right;
618+}
619+
620+.viewcode-back {
621+ float: right;
622+ font-family: {{ theme_bodyfont }};
623+}
624+
625+div.viewcode-block:target {
626+ margin: -1px -3px;
627+ padding: 0.5em 1.0em;
628+ background-color: #F5F4F0;
629+ border: 1px dotted {{ theme_border_color }};
630+}
631+
632+div.code-block-caption {
633+ background-color: #ddd;
634+ color: #333;
635+ padding: 2px 5px;
636+ font-size: small;
637+}
638+
639+/* -- math display ---------------------------------------------------------- */
640+
641+div.body div.math p {
642+ text-align: center;
643+}
644+
645+span.eqno {
646+ float: right;
647+}
648+
649+
650+/* -- other customization --------------------------------------------------- */
651+
652+dt {
653+ font-family: "Liberation Sans", "DejaVu Sans", "Bitstream Vera Sans", Arial, Helvetica, sans-serif;
654+ }
655+
diff -r c597a237b1b0 -r 96963d568dbc doc/source/themes/sunwood/theme.conf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/source/themes/sunwood/theme.conf Sun Aug 26 14:07:00 2018 -0700
@@ -0,0 +1,19 @@
1+[theme]
2+inherit = basic
3+stylesheet = sunwood.css
4+pygments_style = tango
5+
6+[options]
7+bodyfont = "Liberation Sans Regular", "Georgia", "Times New Roman", serif
8+headerfont = "Liberation Sans", "Verdana", Arial, sans-serif
9+pagewidth = 70em
10+documentwidth = 50em
11+sidebarwidth = 20em
12+bgcolor = #f3f1e2
13+headerbg = #f3f1e2
14+border_color = #814324
15+linkcolor = #4C1200
16+headercolor1 = #814324
17+headercolor2 = #814324
18+headerlinkcolor = #4C1200
19+textalign = justify
diff -r c597a237b1b0 -r 96963d568dbc setup.py
--- a/setup.py Thu Aug 23 21:12:18 2018 -0700
+++ b/setup.py Sun Aug 26 14:07:00 2018 -0700
@@ -1,7 +1,7 @@
11 from distutils.core import setup
22
33 setup(name='xtab',
4- version='0.10.1',
4+ version='0.10.2',
55 description="Crosstabulates data in a text file.",
66 author='Dreas Nielsen',
77 author_email='dreas.nielsen@gmail.com',
@@ -48,6 +48,9 @@
4848
4949 Input and output are both text (CSV) files.
5050
51+A summary of its capability and usage is shown below. Full documentation
52+is available at http://xtab.readthedocs.org/.
53+
5154
5255 Capabilities
5356 =============
Show on old repository browser