diff options
| -rw-r--r-- | .gitignore | 4 | ||||
| -rw-r--r-- | .isort.cfg | 6 | ||||
| -rw-r--r-- | .travis.yml | 38 | ||||
| -rw-r--r-- | HACKING | 14 | ||||
| -rw-r--r-- | LICENSE | 3 | ||||
| -rw-r--r-- | MANIFEST.in | 7 | ||||
| -rw-r--r-- | Makefile | 6 | ||||
| -rw-r--r-- | docs/_templates/sidebarintro.html | 31 | ||||
| -rw-r--r-- | docs/_templates/sidebarlogo.html | 22 | ||||
| -rw-r--r-- | docs/_themes/.gitignore | 3 | ||||
| -rw-r--r-- | docs/_themes/LICENSE | 45 | ||||
| -rw-r--r-- | docs/_themes/README.rst | 24 | ||||
| -rw-r--r-- | docs/_themes/flask_theme_support.py | 86 | ||||
| -rw-r--r-- | docs/_themes/kr/layout.html | 54 | ||||
| -rw-r--r-- | docs/_themes/kr/relations.html | 19 | ||||
| -rw-r--r-- | docs/_themes/kr/static/flasky.css_t | 470 | ||||
| -rw-r--r-- | docs/_themes/kr/static/small_flask.css | 70 | ||||
| -rw-r--r-- | docs/_themes/kr/theme.conf | 7 | ||||
| -rw-r--r-- | docs/_themes/kr_small/layout.html | 22 | ||||
| -rw-r--r-- | docs/_themes/kr_small/static/flasky.css_t | 287 | ||||
| -rw-r--r-- | docs/_themes/kr_small/theme.conf | 10 | ||||
| -rw-r--r-- | docs/api.rst | 4 | ||||
| -rw-r--r-- | docs/conf.py | 34 | ||||
| -rw-r--r-- | docs/development.rst | 26 | ||||
| -rw-r--r-- | docs/tutorial.rst | 5 | ||||
| -rw-r--r-- | pytest.ini | 4 | ||||
| -rwxr-xr-x | setup.py | 37 | ||||
| -rw-r--r-- | src/tablib/__init__.py | 13 | ||||
| -rw-r--r-- | src/tablib/compat.py (renamed from tablib/compat.py) | 0 | ||||
| -rw-r--r-- | src/tablib/core.py (renamed from tablib/core.py) | 15 | ||||
| -rw-r--r-- | src/tablib/formats/__init__.py (renamed from tablib/formats/__init__.py) | 0 | ||||
| -rw-r--r-- | src/tablib/formats/_csv.py (renamed from tablib/formats/_csv.py) | 0 | ||||
| -rw-r--r-- | src/tablib/formats/_dbf.py (renamed from tablib/formats/_dbf.py) | 0 | ||||
| -rw-r--r-- | src/tablib/formats/_df.py (renamed from tablib/formats/_df.py) | 0 | ||||
| -rw-r--r-- | src/tablib/formats/_html.py (renamed from tablib/formats/_html.py) | 0 | ||||
| -rw-r--r-- | src/tablib/formats/_jira.py (renamed from tablib/formats/_jira.py) | 0 | ||||
| -rw-r--r-- | src/tablib/formats/_json.py (renamed from tablib/formats/_json.py) | 0 | ||||
| -rw-r--r-- | src/tablib/formats/_latex.py (renamed from tablib/formats/_latex.py) | 0 | ||||
| -rw-r--r-- | src/tablib/formats/_ods.py (renamed from tablib/formats/_ods.py) | 0 | ||||
| -rw-r--r-- | src/tablib/formats/_rst.py (renamed from tablib/formats/_rst.py) | 0 | ||||
| -rw-r--r-- | src/tablib/formats/_tsv.py (renamed from tablib/formats/_tsv.py) | 0 | ||||
| -rw-r--r-- | src/tablib/formats/_xls.py (renamed from tablib/formats/_xls.py) | 0 | ||||
| -rw-r--r-- | src/tablib/formats/_xlsx.py (renamed from tablib/formats/_xlsx.py) | 0 | ||||
| -rw-r--r-- | src/tablib/formats/_yaml.py (renamed from tablib/formats/_yaml.py) | 0 | ||||
| -rw-r--r-- | src/tablib/packages/__init__.py (renamed from tablib/packages/__init__.py) | 0 | ||||
| -rw-r--r-- | src/tablib/packages/dbfpy/__init__.py (renamed from tablib/packages/dbfpy/__init__.py) | 0 | ||||
| -rw-r--r-- | src/tablib/packages/dbfpy/dbf.py (renamed from tablib/packages/dbfpy/dbf.py) | 8 | ||||
| -rw-r--r-- | src/tablib/packages/dbfpy/dbfnew.py (renamed from tablib/packages/dbfpy/dbfnew.py) | 12 | ||||
| -rw-r--r-- | src/tablib/packages/dbfpy/fields.py (renamed from tablib/packages/dbfpy/fields.py) | 0 | ||||
| -rw-r--r-- | src/tablib/packages/dbfpy/header.py (renamed from tablib/packages/dbfpy/header.py) | 0 | ||||
| -rw-r--r-- | src/tablib/packages/dbfpy/record.py (renamed from tablib/packages/dbfpy/record.py) | 0 | ||||
| -rw-r--r-- | src/tablib/packages/dbfpy/utils.py (renamed from tablib/packages/dbfpy/utils.py) | 0 | ||||
| -rw-r--r-- | src/tablib/packages/dbfpy3/__init__.py (renamed from tablib/packages/dbfpy3/__init__.py) | 0 | ||||
| -rw-r--r-- | src/tablib/packages/dbfpy3/dbf.py (renamed from tablib/packages/dbfpy3/dbf.py) | 5 | ||||
| -rw-r--r-- | src/tablib/packages/dbfpy3/dbfnew.py (renamed from tablib/packages/dbfpy3/dbfnew.py) | 0 | ||||
| -rw-r--r-- | src/tablib/packages/dbfpy3/fields.py (renamed from tablib/packages/dbfpy3/fields.py) | 0 | ||||
| -rw-r--r-- | src/tablib/packages/dbfpy3/header.py (renamed from tablib/packages/dbfpy3/header.py) | 0 | ||||
| -rw-r--r-- | src/tablib/packages/dbfpy3/record.py (renamed from tablib/packages/dbfpy3/record.py) | 0 | ||||
| -rw-r--r-- | src/tablib/packages/dbfpy3/utils.py (renamed from tablib/packages/dbfpy3/utils.py) | 0 | ||||
| -rw-r--r-- | src/tablib/packages/statistics.py (renamed from tablib/packages/statistics.py) | 0 | ||||
| -rw-r--r-- | tablib/__init__.py | 7 | ||||
| -rw-r--r-- | tests/requirements.txt (renamed from requirements.txt) | 2 | ||||
| -rwxr-xr-x | tests/test_tablib.py (renamed from test_tablib.py) | 4 | ||||
| -rw-r--r-- | tox.ini | 38 |
64 files changed, 135 insertions, 1307 deletions
@@ -34,3 +34,7 @@ tablib.egg-info/* # Coverage .coverage htmlcov + +# setuptools noise +.eggs +*.egg-info diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000..ba2778d --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,6 @@ +[settings] +multi_line_output=3 +include_trailing_comma=True +force_grid_wrap=0 +use_parentheses=True +line_length=88 diff --git a/.travis.yml b/.travis.yml index 79a5175..9253828 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,20 +1,22 @@ language: python +python: +- 2.7 +- 3.6 +- 3.7 +- 3.8-dev cache: pip - -matrix: - include: - - python: 2.7 - - python: 3.5 - - python: 3.6 - - python: 3.7 - - python: 3.8-dev - -install: - - pip install -r requirements.txt - - pip install -U pytest pytest-cov - -script: pytest --cov tablib - -after_success: - - pip install -U codecov - - codecov +dist: xenial +install: travis_retry pip install tox-travis +script: tox +after_success: bash <(curl -s https://codecov.io/bash) +deploy: + provider: pypi + user: jazzband + server: https://jazzband.co/projects/tablib/upload + distributions: sdist bdist_wheel + password: + secure: svV4fYtodwW+iTyFOm5ISEfhVwcA+6vTskD3x6peznc40TdMV9Ek8nT3Q/NB4lCbXoUw2qR4H6uhLCjesnv/VvVk/qbitCyD8ySlgwOV5n7NzJs8lC8EYaHSjGQjatTwJAokfGVYkPawkI7HXDqtDggLUQBK+Ag8HDW+XBSbQIU= + on: + tags: true + repo: jazzband/tablib + python: 3.7 diff --git a/HACKING b/HACKING deleted file mode 100644 index ebbb24c..0000000 --- a/HACKING +++ /dev/null @@ -1,14 +0,0 @@ -Where possible, please follow PEP8 with regard to coding style. Sometimes the line -length restriction is too hard to follow, so don't bend over backwards there. - -Triple-quotes should always be """, single quotes are ' unless using " -would result in less escaping within the string. - -All modules, functions, and methods should be well documented reStructuredText for -Sphinx AutoDoc. - -All functionality should be available in pure Python. Optional C (via Cython) -implementations may be written for performance reasons, but should never -replace the Python implementation. - -Lastly, don't take yourself too seriously :)
\ No newline at end of file @@ -1,4 +1,5 @@ Copyright 2016 Kenneth Reitz +Copyright 2019 Jazzband Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -16,4 +17,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE.
\ No newline at end of file +THE SOFTWARE. diff --git a/MANIFEST.in b/MANIFEST.in index 65583dc..2f5f4f3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1,6 @@ -include HISTORY.md README.md LICENSE AUTHORS test_tablib.py +recursive-include docs * +recursive-include tests * +include pytest.ini tox.ini .isort.cfg .coveragerc HISTORY.md README.md LICENSE AUTHORS +prune docs/_build +prune *.pyc +prune __pycache__ diff --git a/Makefile b/Makefile deleted file mode 100644 index 35470bd..0000000 --- a/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -test: - python test_tablib.py -publish: - python setup.py register - python setup.py sdist upload - python setup.py bdist_wheel --universal upload diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index 6da5e19..376af42 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -2,37 +2,6 @@ <p> Tablib is an MIT Licensed format-agnostic tabular dataset library, written in Python. It allows you to import, export, and manipulate tabular data sets. Advanced features include, segregation, dynamic columns, tags & filtering, and seamless format import & export. </p> -<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" /> -<style> -.algolia-autocomplete{ - width: 100%; - height: 1.5em; - margin: 1em auto; -} -.algolia-autocomplete a{ - border-bottom: none !important; -} -#doc_search{ - width: 100%; - height: 100%; -} -</style> -<input id="doc_search" placeholder="Search the doc" autofocus/> -<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js" onload="docsearch({ - apiKey: 'fdf64af44731dc9838761b703228e4fd', - indexName: 'python-tablib', - inputSelector: '#doc_search', - debug: false // Set debug to true if you want to inspect the dropdown -})" async></script> - -<h3>Feedback</h3> -<p> - Feedback is greatly appreciated. If you have any questions, comments, - random praise, or anonymous threats, <a href="mailto:me@kennethreitz.com"> - shoot me an email</a>. -</p> - - <h3>Useful Links</h3> <ul> <li><a href="https://tablib.readthedocs.io">The Tablib Website</a></li> diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html index 32f382b..a755281 100644 --- a/docs/_templates/sidebarlogo.html +++ b/docs/_templates/sidebarlogo.html @@ -2,25 +2,3 @@ <p> Tablib is an MIT Licensed format-agnostic tabular dataset library, written in Python. It allows you to import, export, and manipulate tabular data sets. Advanced features include, segregation, dynamic columns, tags & filtering, and seamless format import & export. </p> -<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" /> -<style> -.algolia-autocomplete{ - width: 100%; - height: 1.5em; - margin: 1em auto; -} -.algolia-autocomplete a{ - border-bottom: none !important; -} -#doc_search{ - width: 100%; - height: 100%; -} -</style> -<input id="doc_search" placeholder="Search the doc" autofocus/> -<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js" onload="docsearch({ - apiKey: 'fdf64af44731dc9838761b703228e4fd', - indexName: 'python-tablib', - inputSelector: '#doc_search', - debug: false // Set debug to true if you want to inspect the dropdown -})" async></script>
\ No newline at end of file diff --git a/docs/_themes/.gitignore b/docs/_themes/.gitignore deleted file mode 100644 index 66b6e4c..0000000 --- a/docs/_themes/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -*.pyc -*.pyo -.DS_Store diff --git a/docs/_themes/LICENSE b/docs/_themes/LICENSE deleted file mode 100644 index 3d1e04a..0000000 --- a/docs/_themes/LICENSE +++ /dev/null @@ -1,45 +0,0 @@ -Modifications: - -Copyright (c) 2011 Kenneth Reitz. - - -Original Project: - -Copyright (c) 2010 by Armin Ronacher. - - -Some rights reserved. - -Redistribution and use in source and binary forms of the theme, with or -without modification, are permitted provided that the following conditions -are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - -* The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. - -We kindly ask you to only use these themes in an unmodified manner just -for Flask and Flask-related products, not for unrelated projects. If you -like the visual style and want to use it for your own projects, please -consider making some larger changes to the themes (such as changing -font faces, sizes, colors or margins). - -THIS THEME IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS THEME, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/docs/_themes/README.rst b/docs/_themes/README.rst deleted file mode 100644 index c97a9a5..0000000 --- a/docs/_themes/README.rst +++ /dev/null @@ -1,24 +0,0 @@ -krTheme Sphinx Style -==================== - -This repository contains sphinx styles Kenneth Reitz uses in most of -his projects. It is a drivative of Mitsuhiko's themes for Flask and Flask related -projects. To use this style in your Sphinx documentation, follow -this guide: - -1. put this folder as _themes into your docs folder. Alternatively - you can also use git submodules to check out the contents there. - -2. add this to your conf.py: :: - - sys.path.append(os.path.abspath('_themes')) - html_theme_path = ['_themes'] - html_theme = 'flask' - -The following themes exist: - -**kr** - the standard flask documentation theme for large projects - -**kr_small** - small one-page theme. Intended to be used by very small addon libraries. diff --git a/docs/_themes/flask_theme_support.py b/docs/_themes/flask_theme_support.py deleted file mode 100644 index 33f4744..0000000 --- a/docs/_themes/flask_theme_support.py +++ /dev/null @@ -1,86 +0,0 @@ -# flasky extensions. flasky pygments style based on tango style -from pygments.style import Style -from pygments.token import Keyword, Name, Comment, String, Error, \ - Number, Operator, Generic, Whitespace, Punctuation, Other, Literal - - -class FlaskyStyle(Style): - background_color = "#f8f8f8" - default_style = "" - - styles = { - # No corresponding class for the following: - #Text: "", # class: '' - Whitespace: "underline #f8f8f8", # class: 'w' - Error: "#a40000 border:#ef2929", # class: 'err' - Other: "#000000", # class 'x' - - Comment: "italic #8f5902", # class: 'c' - Comment.Preproc: "noitalic", # class: 'cp' - - Keyword: "bold #004461", # class: 'k' - Keyword.Constant: "bold #004461", # class: 'kc' - Keyword.Declaration: "bold #004461", # class: 'kd' - Keyword.Namespace: "bold #004461", # class: 'kn' - Keyword.Pseudo: "bold #004461", # class: 'kp' - Keyword.Reserved: "bold #004461", # class: 'kr' - Keyword.Type: "bold #004461", # class: 'kt' - - Operator: "#582800", # class: 'o' - Operator.Word: "bold #004461", # class: 'ow' - like keywords - - Punctuation: "bold #000000", # class: 'p' - - # because special names such as Name.Class, Name.Function, etc. - # are not recognized as such later in the parsing, we choose them - # to look the same as ordinary variables. - Name: "#000000", # class: 'n' - Name.Attribute: "#c4a000", # class: 'na' - to be revised - Name.Builtin: "#004461", # class: 'nb' - Name.Builtin.Pseudo: "#3465a4", # class: 'bp' - Name.Class: "#000000", # class: 'nc' - to be revised - Name.Constant: "#000000", # class: 'no' - to be revised - Name.Decorator: "#888", # class: 'nd' - to be revised - Name.Entity: "#ce5c00", # class: 'ni' - Name.Exception: "bold #cc0000", # class: 'ne' - Name.Function: "#000000", # class: 'nf' - Name.Property: "#000000", # class: 'py' - Name.Label: "#f57900", # class: 'nl' - Name.Namespace: "#000000", # class: 'nn' - to be revised - Name.Other: "#000000", # class: 'nx' - Name.Tag: "bold #004461", # class: 'nt' - like a keyword - Name.Variable: "#000000", # class: 'nv' - to be revised - Name.Variable.Class: "#000000", # class: 'vc' - to be revised - Name.Variable.Global: "#000000", # class: 'vg' - to be revised - Name.Variable.Instance: "#000000", # class: 'vi' - to be revised - - Number: "#990000", # class: 'm' - - Literal: "#000000", # class: 'l' - Literal.Date: "#000000", # class: 'ld' - - String: "#4e9a06", # class: 's' - String.Backtick: "#4e9a06", # class: 'sb' - String.Char: "#4e9a06", # class: 'sc' - String.Doc: "italic #8f5902", # class: 'sd' - like a comment - String.Double: "#4e9a06", # class: 's2' - String.Escape: "#4e9a06", # class: 'se' - String.Heredoc: "#4e9a06", # class: 'sh' - String.Interpol: "#4e9a06", # class: 'si' - String.Other: "#4e9a06", # class: 'sx' - String.Regex: "#4e9a06", # class: 'sr' - String.Single: "#4e9a06", # class: 's1' - String.Symbol: "#4e9a06", # class: 'ss' - - Generic: "#000000", # class: 'g' - Generic.Deleted: "#a40000", # class: 'gd' - Generic.Emph: "italic #000000", # class: 'ge' - Generic.Error: "#ef2929", # class: 'gr' - Generic.Heading: "bold #000080", # class: 'gh' - Generic.Inserted: "#00A000", # class: 'gi' - Generic.Output: "#888", # class: 'go' - Generic.Prompt: "#745334", # class: 'gp' - Generic.Strong: "bold #000000", # class: 'gs' - Generic.Subheading: "bold #800080", # class: 'gu' - Generic.Traceback: "bold #a40000", # class: 'gt' - } diff --git a/docs/_themes/kr/layout.html b/docs/_themes/kr/layout.html deleted file mode 100644 index 975b793..0000000 --- a/docs/_themes/kr/layout.html +++ /dev/null @@ -1,54 +0,0 @@ -{%- extends "basic/layout.html" %} -{%- block extrahead %} - {{ super() }} - {% if theme_touch_icon %} - <link rel="apple-touch-icon" href="{{ pathto('_static/' ~ theme_touch_icon, 1) }}" /> - {% endif %} - <link media="only screen and (max-device-width: 480px)" href="{{ - pathto('_static/small_flask.css', 1) }}" type= "text/css" rel="stylesheet" /> -{% endblock %} -{%- block relbar2 %}{% endblock %} -{%- block footer %} - <div class="footer"> - © Copyright {{ copyright }}. - </div> - <a href="https://github.com/jazzband/tablib"> - <img style="position: absolute; top: 0; right: 0; border: 0;" src="//s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /> - </a> - - <script type="text/javascript" src="//www.hellobar.com/hellobar.js"></script> - <script type="text/javascript"> - new HelloBar(36402,48802); - </script> - - <script type="text/javascript"> - - var _gaq = _gaq || []; - _gaq.push(['_setAccount', 'UA-8742933-9']); - _gaq.push(['_setDomainName', 'none']); - _gaq.push(['_setAllowLinker', true]); - _gaq.push(['_trackPageview']); - - (function() { - var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; - ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; - var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); - })(); - - </script> - - <script type="text/javascript"> - (function() { - var t = document.createElement('script'); - t.type = 'text/javascript'; - t.async = true; - t.id = 'gauges-tracker'; - t.setAttribute('data-site-id', - '4ddc284f613f5d2f1a000001'); - t.src = '//secure.gaug.es/track.js'; - var s = document.getElementsByTagName('script')[0]; - s.parentNode.insertBefore(t, s); - })(); - </script> - -{%- endblock %} diff --git a/docs/_themes/kr/relations.html b/docs/_themes/kr/relations.html deleted file mode 100644 index 3bbcde8..0000000 --- a/docs/_themes/kr/relations.html +++ /dev/null @@ -1,19 +0,0 @@ -<h3>Related Topics</h3> -<ul> - <li><a href="{{ pathto(master_doc) }}">Documentation overview</a><ul> - {%- for parent in parents %} - <li><a href="{{ parent.link|e }}">{{ parent.title }}</a><ul> - {%- endfor %} - {%- if prev %} - <li>Previous: <a href="{{ prev.link|e }}" title="{{ _('previous chapter') - }}">{{ prev.title }}</a></li> - {%- endif %} - {%- if next %} - <li>Next: <a href="{{ next.link|e }}" title="{{ _('next chapter') - }}">{{ next.title }}</a></li> - {%- endif %} - {%- for parent in parents %} - </ul></li> - {%- endfor %} - </ul></li> -</ul> diff --git a/docs/_themes/kr/static/flasky.css_t b/docs/_themes/kr/static/flasky.css_t deleted file mode 100644 index 1bc22de..0000000 --- a/docs/_themes/kr/static/flasky.css_t +++ /dev/null @@ -1,470 +0,0 @@ -/* - * flasky.css_t - * ~~~~~~~~~~~~ - * - * :copyright: Copyright 2010 by Armin Ronacher. Modifications by Kenneth Reitz. - * :license: Flask Design License, see LICENSE for details. - */ - -{% set page_width = '940px' %} -{% set sidebar_width = '220px' %} - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: 'goudy old style', 'minion pro', 'bell mt', Georgia, 'Hiragino Mincho Pro'; - font-size: 17px; - background-color: white; - color: #000; - margin: 0; - padding: 0; -} - -div.document { - width: {{ page_width }}; - margin: 30px auto 0 auto; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 {{ sidebar_width }}; -} - -div.sphinxsidebar { - width: {{ sidebar_width }}; -} - -hr { - border: 1px solid #B1B4B6; -} - -div.body { - background-color: #ffffff; - color: #3E4349; - padding: 0 30px 0 30px; -} - -img.floatingflask { - padding: 0 0 10px 10px; - float: right; -} - -div.footer { - width: {{ page_width }}; - margin: 20px auto 30px auto; - font-size: 14px; - color: #888; - text-align: right; -} - -div.footer a { - color: #888; -} - -div.related { - display: none; -} - -div.sphinxsidebar a { - color: #444; - text-decoration: none; - border-bottom: 1px dotted #999; -} - -div.sphinxsidebar a:hover { - border-bottom: 1px solid #999; -} - -div.sphinxsidebar { - font-size: 14px; - line-height: 1.5; -} - -div.sphinxsidebarwrapper { - padding: 18px 10px; -} - -div.sphinxsidebarwrapper p.logo { - padding: 0 0 20px 0; - margin: 0; - text-align: center; -} - -div.sphinxsidebar h3, -div.sphinxsidebar h4 { - font-family: 'Garamond', 'Georgia', serif; - color: #444; - font-size: 24px; - font-weight: normal; - margin: 0 0 5px 0; - padding: 0; -} - -div.sphinxsidebar h4 { - font-size: 20px; -} - -div.sphinxsidebar h3 a { - color: #444; -} - -div.sphinxsidebar p.logo a, -div.sphinxsidebar h3 a, -div.sphinxsidebar p.logo a:hover, -div.sphinxsidebar h3 a:hover { - border: none; -} - -div.sphinxsidebar p { - color: #555; - margin: 10px 0; -} - -div.sphinxsidebar ul { - margin: 10px 0; - padding: 0; - color: #000; -} - -div.sphinxsidebar input { - border: 1px solid #ccc; - font-family: 'Georgia', serif; - font-size: 1em; -} - -/* -- body styles ----------------------------------------------------------- */ - -a { - color: #004B6B; - text-decoration: underline; -} - -a:hover { - color: #6D4100; - text-decoration: underline; -} - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - margin: 30px 0px 10px 0px; - padding: 0; -} - -div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } -div.body h2 { font-size: 180%; } -div.body h3 { font-size: 150%; } -div.body h4 { font-size: 130%; } -div.body h5 { font-size: 100%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #ddd; - padding: 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - color: #444; - background: #eaeaea; -} - -div.body p, div.body dd, div.body li { - line-height: 1.4em; -} - -div.admonition { - background: #fafafa; - margin: 20px -30px; - padding: 10px 30px; - border-top: 1px solid #ccc; - border-bottom: 1px solid #ccc; -} - -div.admonition tt.xref, div.admonition a tt { - border-bottom: 1px solid #fafafa; -} - -dd div.admonition { - margin-left: -60px; - padding-left: 60px; -} - -div.admonition p.admonition-title { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - font-size: 24px; - margin: 0 0 10px 0; - padding: 0; - line-height: 1; -} - -div.admonition p.last { - margin-bottom: 0; -} - -div.highlight { - background-color: white; -} - -dt:target, .highlight { - background: #FAF3E8; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre, tt { - font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; - font-size: 0.9em; -} - -img.screenshot { -} - -tt.descname, tt.descclassname { - font-size: 0.95em; -} - -tt.descname { - padding-right: 0.08em; -} - -img.screenshot { - -moz-box-shadow: 2px 2px 4px #eee; - -webkit-box-shadow: 2px 2px 4px #eee; - box-shadow: 2px 2px 4px #eee; -} - -table.docutils { - border: 1px solid #888; - -moz-box-shadow: 2px 2px 4px #eee; - -webkit-box-shadow: 2px 2px 4px #eee; - box-shadow: 2px 2px 4px #eee; -} - -table.docutils td, table.docutils th { - border: 1px solid #888; - padding: 0.25em 0.7em; -} - -table.field-list, table.footnote { - border: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} - -table.footnote { - margin: 15px 0; - width: 100%; - border: 1px solid #eee; - background: #fdfdfd; - font-size: 0.9em; -} - -table.footnote + table.footnote { - margin-top: -15px; - border-top: none; -} - -table.field-list th { - padding: 0 0.8em 0 0; -} - -table.field-list td { - padding: 0; -} - -table.footnote td.label { - width: 0px; - padding: 0.3em 0 0.3em 0.5em; -} - -table.footnote td { - padding: 0.3em 0.5em; -} - -dl { - margin: 0; - padding: 0; -} - -dl dd { - margin-left: 30px; -} - -blockquote { - margin: 0 0 0 30px; - padding: 0; -} - -ul, ol { - margin: 10px 0 10px 30px; - padding: 0; -} - -pre { - background: #eee; - padding: 7px 30px; - margin: 15px -30px; - line-height: 1.3em; -} - -dl pre, blockquote pre, li pre { - margin-left: -60px; - padding-left: 60px; -} - -dl dl pre { - margin-left: -90px; - padding-left: 90px; -} - -tt { - background-color: #ecf0f3; - color: #222; - /* padding: 1px 2px; */ -} - -tt.xref, a tt { - background-color: #FBFBFB; - border-bottom: 1px solid white; -} - -a.reference { - text-decoration: none; - border-bottom: 1px dotted #004B6B; -} - -a.reference:hover { - border-bottom: 1px solid #6D4100; -} - -a.footnote-reference { - text-decoration: none; - font-size: 0.7em; - vertical-align: top; - border-bottom: 1px dotted #004B6B; -} - -a.footnote-reference:hover { - border-bottom: 1px solid #6D4100; -} - -a:hover tt { - background: #EEE; -} - - -@media screen and (max-width: 600px) { - - div.sphinxsidebar { - display: none; - } - - div.documentwrapper { - margin-left: 0; - margin-top: 0; - margin-right: 0; - margin-bottom: 0; - } - - div.bodywrapper { - margin-top: 0; - margin-right: 0; - margin-bottom: 0; - margin-left: 0; - } - - ul { - margin-left: 0; - } - - .document { - width: auto; - } - - .bodywrapper { - margin: 0; - } - - .footer { - width: auto; - } - - - -} - - - -/* scrollbars */ - -::-webkit-scrollbar { - width: 6px; - height: 6px; -} - -::-webkit-scrollbar-button:start:decrement, -::-webkit-scrollbar-button:end:increment { - display: block; - height: 10px; -} - -::-webkit-scrollbar-button:vertical:increment { - background-color: #fff; -} - -::-webkit-scrollbar-track-piece { - background-color: #eee; - -webkit-border-radius: 3px; -} - -::-webkit-scrollbar-thumb:vertical { - height: 50px; - background-color: #ccc; - -webkit-border-radius: 3px; -} - -::-webkit-scrollbar-thumb:horizontal { - width: 50px; - background-color: #ccc; - -webkit-border-radius: 3px; -} - -/* misc. */ - -.revsys-inline { - display: none!important; -}
\ No newline at end of file diff --git a/docs/_themes/kr/static/small_flask.css b/docs/_themes/kr/static/small_flask.css deleted file mode 100644 index 1c6df30..0000000 --- a/docs/_themes/kr/static/small_flask.css +++ /dev/null @@ -1,70 +0,0 @@ -/* - * small_flask.css_t - * ~~~~~~~~~~~~~~~~~ - * - * :copyright: Copyright 2010 by Armin Ronacher. - * :license: Flask Design License, see LICENSE for details. - */ - -body { - margin: 0; - padding: 20px 30px; -} - -div.documentwrapper { - float: none; - background: white; -} - -div.sphinxsidebar { - display: block; - float: none; - width: 102.5%; - margin: 50px -30px -20px -30px; - padding: 10px 20px; - background: #333; - color: white; -} - -div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, -div.sphinxsidebar h3 a { - color: white; -} - -div.sphinxsidebar a { - color: #aaa; -} - -div.sphinxsidebar p.logo { - display: none; -} - -div.document { - width: 100%; - margin: 0; -} - -div.related { - display: block; - margin: 0; - padding: 10px 0 20px 0; -} - -div.related ul, -div.related ul li { - margin: 0; - padding: 0; -} - -div.footer { - display: none; -} - -div.bodywrapper { - margin: 0; -} - -div.body { - min-height: 0; - padding: 0; -} diff --git a/docs/_themes/kr/theme.conf b/docs/_themes/kr/theme.conf deleted file mode 100644 index 07698f6..0000000 --- a/docs/_themes/kr/theme.conf +++ /dev/null @@ -1,7 +0,0 @@ -[theme] -inherit = basic -stylesheet = flasky.css -pygments_style = flask_theme_support.FlaskyStyle - -[options] -touch_icon = diff --git a/docs/_themes/kr_small/layout.html b/docs/_themes/kr_small/layout.html deleted file mode 100644 index cab20c7..0000000 --- a/docs/_themes/kr_small/layout.html +++ /dev/null @@ -1,22 +0,0 @@ -{% extends "basic/layout.html" %} -{% block header %} - {{ super() }} - {% if pagename == 'index' %} - <div class=indexwrapper> - {% endif %} -{% endblock %} -{% block footer %} - {% if pagename == 'index' %} - </div> - {% endif %} -{% endblock %} -{# do not display relbars #} -{% block relbar1 %}{% endblock %} -{% block relbar2 %} - {% if theme_github_fork %} - <a href="https://github.com/{{ theme_github_fork }}"><img style="position: fixed; top: 0; right: 0; border: 0;" - src="//s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub" /></a> - {% endif %} -{% endblock %} -{% block sidebar1 %}{% endblock %} -{% block sidebar2 %}{% endblock %} diff --git a/docs/_themes/kr_small/static/flasky.css_t b/docs/_themes/kr_small/static/flasky.css_t deleted file mode 100644 index 71961a2..0000000 --- a/docs/_themes/kr_small/static/flasky.css_t +++ /dev/null @@ -1,287 +0,0 @@ -/* - * flasky.css_t - * ~~~~~~~~~~~~ - * - * Sphinx stylesheet -- flasky theme based on nature theme. - * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: 'Georgia', serif; - font-size: 17px; - color: #000; - background: white; - margin: 0; - padding: 0; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 40px auto 0 auto; - width: 700px; -} - -hr { - border: 1px solid #B1B4B6; -} - -div.body { - background-color: #ffffff; - color: #3E4349; - padding: 0 30px 30px 30px; -} - -img.floatingflask { - padding: 0 0 10px 10px; - float: right; -} - -div.footer { - text-align: right; - color: #888; - padding: 10px; - font-size: 14px; - width: 650px; - margin: 0 auto 40px auto; -} - -div.footer a { - color: #888; - text-decoration: underline; -} - -div.related { - line-height: 32px; - color: #888; -} - -div.related ul { - padding: 0 0 0 10px; -} - -div.related a { - color: #444; -} - -/* -- body styles ----------------------------------------------------------- */ - -a { - color: #004B6B; - text-decoration: underline; -} - -a:hover { - color: #6D4100; - text-decoration: underline; -} - -div.body { - padding-bottom: 40px; /* saved for footer */ -} - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - margin: 30px 0px 10px 0px; - padding: 0; -} - -{% if theme_index_logo %} -div.indexwrapper h1 { - text-indent: -999999px; - background: url({{ theme_index_logo }}) no-repeat center center; - height: {{ theme_index_logo_height }}; -} -{% endif %} - -div.body h2 { font-size: 180%; } -div.body h3 { font-size: 150%; } -div.body h4 { font-size: 130%; } -div.body h5 { font-size: 100%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: white; - padding: 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - color: #444; - background: #eaeaea; -} - -div.body p, div.body dd, div.body li { - line-height: 1.4em; -} - -div.admonition { - background: #fafafa; - margin: 20px -30px; - padding: 10px 30px; - border-top: 1px solid #ccc; - border-bottom: 1px solid #ccc; -} - -div.admonition p.admonition-title { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - font-size: 24px; - margin: 0 0 10px 0; - padding: 0; - line-height: 1; -} - -div.admonition p.last { - margin-bottom: 0; -} - -div.highlight{ - background-color: white; -} - -dt:target, .highlight { - background: #FAF3E8; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -div.warning { - background-color: #ffe4e4; - border: 1px solid #f66; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre, tt { - font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; - font-size: 0.85em; -} - -img.screenshot { -} - -tt.descname, tt.descclassname { - font-size: 0.95em; -} - -tt.descname { - padding-right: 0.08em; -} - -img.screenshot { - -moz-box-shadow: 2px 2px 4px #eee; - -webkit-box-shadow: 2px 2px 4px #eee; - box-shadow: 2px 2px 4px #eee; -} - -table.docutils { - border: 1px solid #888; - -moz-box-shadow: 2px 2px 4px #eee; - -webkit-box-shadow: 2px 2px 4px #eee; - box-shadow: 2px 2px 4px #eee; -} - -table.docutils td, table.docutils th { - border: 1px solid #888; - padding: 0.25em 0.7em; -} - -table.field-list, table.footnote { - border: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} - -table.footnote { - margin: 15px 0; - width: 100%; - border: 1px solid #eee; -} - -table.field-list th { - padding: 0 0.8em 0 0; -} - -table.field-list td { - padding: 0; -} - -table.footnote td { - padding: 0.5em; -} - -dl { - margin: 0; - padding: 0; -} - -dl dd { - margin-left: 30px; -} - -pre { - padding: 0; - margin: 15px -30px; - padding: 8px; - line-height: 1.3em; - padding: 7px 30px; - background: #eee; - border-radius: 2px; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; -} - -dl pre { - margin-left: -60px; - padding-left: 60px; -} - -tt { - background-color: #ecf0f3; - color: #222; - /* padding: 1px 2px; */ -} - -tt.xref, a tt { - background-color: #FBFBFB; -} - -a:hover tt { - background: #EEE; -} diff --git a/docs/_themes/kr_small/theme.conf b/docs/_themes/kr_small/theme.conf deleted file mode 100644 index 542b462..0000000 --- a/docs/_themes/kr_small/theme.conf +++ /dev/null @@ -1,10 +0,0 @@ -[theme] -inherit = basic -stylesheet = flasky.css -nosidebar = true -pygments_style = flask_theme_support.FlaskyStyle - -[options] -index_logo = '' -index_logo_height = 120px -github_fork = '' diff --git a/docs/api.rst b/docs/api.rst index 942b69d..1792eb5 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -36,7 +36,7 @@ Functions --------- -.. autofunction:: detect +.. autofunction:: detect_format .. autofunction:: import_set @@ -61,4 +61,4 @@ Exceptions You're trying to add something that doesn't quite taste right. -Now, go start some :ref:`Tablib Development <development>`.
\ No newline at end of file +Now, go start some :ref:`Tablib Development <development>`. diff --git a/docs/conf.py b/docs/conf.py index c38dd06..96ab92b 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -10,18 +10,16 @@ # # All configuration values have a default; values that are commented out # serve to show the default. - -import sys, os +from pkg_resources import get_distribution # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath('..')) -import tablib +# sys.path.insert(0, os.path.abspath('..')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' +# needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. @@ -41,16 +39,17 @@ master_doc = 'index' # General information about the project. project = u'Tablib' -copyright = u'2016. A <a href="http://kennethreitz.org/">Kenneth Reitz</a> Project' +copyright = u'2019 Jazzband' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # -# The short X.Y version. -version = tablib.__version__ # The full version, including alpha/beta/rc tags. -release = version +release = get_distribution('tablib').version +# The short X.Y version. +version = '.'.join(release.split('.')[:2]) +# for example take major/minor # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -81,7 +80,7 @@ add_function_parentheses = True #show_authors = False # The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'flask_theme_support.FlaskyStyle' +# pygments_style = '' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] @@ -91,7 +90,7 @@ pygments_style = 'flask_theme_support.FlaskyStyle' # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -120,7 +119,7 @@ html_theme = 'default' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['static'] +# html_static_path = ['static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. @@ -183,7 +182,7 @@ htmlhelp_basename = 'Tablibdoc' # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'Tablib.tex', u'Tablib Documentation', - u'Kenneth Reitz', 'manual'), + u'Jazzband', 'manual'), ] latex_use_modindex = False @@ -196,9 +195,6 @@ latex_elements = { } latex_use_parts = True -latex_additional_files = ['krstyle.sty'] - - # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None @@ -229,9 +225,5 @@ latex_additional_files = ['krstyle.sty'] # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'tablib', u'Tablib Documentation', - [u'Kenneth Reitz'], 1) + [u'Jazzband'], 1) ] - -sys.path.append(os.path.abspath('_themes')) -html_theme_path = ['_themes'] -html_theme = 'kr'
\ No newline at end of file diff --git a/docs/development.rst b/docs/development.rst index 83fd159..c481d0d 100644 --- a/docs/development.rst +++ b/docs/development.rst @@ -150,31 +150,7 @@ the easiest way to test your changes for potential issues is to simply run the t .. code-block:: console - $ ./test_tablib.py - - -`Jenkins CI`_, amongst other tools, supports Java's xUnit testing report format. -Nose_ allows us to generate our own xUnit reports. - -Installing nose is simple. - -.. code-block:: console - - $ pip install nose - -Once installed, we can generate our xUnit report with a single command. - -.. code-block:: console - - $ nosetests test_tablib.py --with-xunit - -This will generate a **nosetests.xml** file, which can then be analyzed. - -.. _Nose: https://github.com/nose-devs/nose - - - -.. _jenkins: + $ tox ---------------------- Continuous Integration diff --git a/docs/tutorial.rst b/docs/tutorial.rst index 421954a..4189269 100644 --- a/docs/tutorial.rst +++ b/docs/tutorial.rst @@ -5,9 +5,6 @@ Quickstart ========== -.. module:: tablib - - Eager to get started? This page gives a good introduction in how to get started with Tablib. This assumes you already have Tablib installed. @@ -301,7 +298,7 @@ Now that we have extra meta-data on our rows, we can easily filter our :class:`D It's that simple. The original :class:`Dataset` is untouched. Open an Excel Workbook and read first sheet --------------------------------- +------------------------------------------- To open an Excel 2007 and later workbook with a single sheet (or a workbook with multiple sheets but you just want the first sheet), use the following: diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..f69d336 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,4 @@ +[pytest] +norecursedirs = .git .* +addopts = -rsxX --showlocals --tb=native --cov=tablib --cov-report xml --cov-report term --cov-report html +python_paths = . @@ -5,31 +5,9 @@ import os import re import sys -from setuptools import setup +from setuptools import find_packages, setup -if sys.argv[-1] == 'publish': - os.system("python setup.py sdist upload") - sys.exit() - - -if sys.argv[-1] == 'test': - try: - __import__('py') - except ImportError: - print('py.test required.') - sys.exit(1) - - errors = os.system('py.test test_tablib.py') - sys.exit(bool(errors)) - -packages = [ - 'tablib', 'tablib.formats', - 'tablib.packages', - 'tablib.packages.dbfpy', - 'tablib.packages.dbfpy3' -] - install = [ 'odfpy', 'openpyxl>=2.4.0', @@ -41,21 +19,21 @@ install = [ ] -with open('tablib/core.py', 'r') as fd: - version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', - fd.read(), re.MULTILINE).group(1) - setup( name='tablib', - version=version, + use_scm_version=True, + setup_requires=['setuptools_scm'], description='Format agnostic tabular data library (XLS, JSON, YAML, CSV)', long_description=(open('README.md').read() + '\n\n' + open('HISTORY.md').read()), long_description_content_type="text/markdown", author='Kenneth Reitz', author_email='me@kennethreitz.org', + maintainer='Jazzband', + maintainer_email='roadies@jazzband.co', url='https://tablib.readthedocs.io', - packages=packages, + packages=find_packages(where="src"), + package_dir={"": "src"}, license='MIT', classifiers=[ 'Development Status :: 5 - Production/Stable', @@ -71,7 +49,6 @@ setup( 'Programming Language :: Python :: 3.7', ], python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*', - tests_require=['pytest'], install_requires=install, extras_require={ 'pandas': ['pandas'], diff --git a/src/tablib/__init__.py b/src/tablib/__init__.py new file mode 100644 index 0000000..fafb569 --- /dev/null +++ b/src/tablib/__init__.py @@ -0,0 +1,13 @@ +""" Tablib. """ +from pkg_resources import get_distribution, DistributionNotFound + +from tablib.core import ( + Databook, Dataset, detect_format, import_set, import_book, + InvalidDatasetType, InvalidDimensions, UnsupportedFormat +) + +try: + __version__ = get_distribution(__name__).version +except DistributionNotFound: + # package is not installed + __version__ = None diff --git a/tablib/compat.py b/src/tablib/compat.py index 1582173..1582173 100644 --- a/tablib/compat.py +++ b/src/tablib/compat.py diff --git a/tablib/core.py b/src/tablib/core.py index 6c4a4bf..65dd901 100644 --- a/tablib/core.py +++ b/src/tablib/core.py @@ -5,7 +5,7 @@ This module implements the central Tablib objects. - :copyright: (c) 2016 by Kenneth Reitz. + :copyright: (c) 2016 by Kenneth Reitz. 2019 Jazzband. :license: MIT, see LICENSE for more details. """ @@ -19,11 +19,9 @@ from tablib.compat import unicode __title__ = 'tablib' -__version__ = '0.13.0' -__build__ = 0x001201 __author__ = 'Kenneth Reitz' __license__ = 'MIT' -__copyright__ = 'Copyright 2017 Kenneth Reitz' +__copyright__ = 'Copyright 2017 Kenneth Reitz. 2019 Jazzband.' __docformat__ = 'restructuredtext' @@ -817,12 +815,13 @@ class Dataset(object): # ---- def add_formatter(self, col, handler): - """Adds a :ref:`formatter` to the :class:`Dataset`. + """Adds a formatter to the :class:`Dataset`. .. versionadded:: 0.9.5 - :param col: column to. Accepts index int or header str. - :param handler: reference to callback function to execute - against each cell value. + + :param col: column to. Accepts index int or header str. + :param handler: reference to callback function to execute against + each cell value. """ if isinstance(col, unicode): diff --git a/tablib/formats/__init__.py b/src/tablib/formats/__init__.py index 52cf472..52cf472 100644 --- a/tablib/formats/__init__.py +++ b/src/tablib/formats/__init__.py diff --git a/tablib/formats/_csv.py b/src/tablib/formats/_csv.py index 5c03d6f..5c03d6f 100644 --- a/tablib/formats/_csv.py +++ b/src/tablib/formats/_csv.py diff --git a/tablib/formats/_dbf.py b/src/tablib/formats/_dbf.py index 0d1c87b..0d1c87b 100644 --- a/tablib/formats/_dbf.py +++ b/src/tablib/formats/_dbf.py diff --git a/tablib/formats/_df.py b/src/tablib/formats/_df.py index 0c7ebec..0c7ebec 100644 --- a/tablib/formats/_df.py +++ b/src/tablib/formats/_df.py diff --git a/tablib/formats/_html.py b/src/tablib/formats/_html.py index ac72bd6..ac72bd6 100644 --- a/tablib/formats/_html.py +++ b/src/tablib/formats/_html.py diff --git a/tablib/formats/_jira.py b/src/tablib/formats/_jira.py index 55fce52..55fce52 100644 --- a/tablib/formats/_jira.py +++ b/src/tablib/formats/_jira.py diff --git a/tablib/formats/_json.py b/src/tablib/formats/_json.py index 009fb3c..009fb3c 100644 --- a/tablib/formats/_json.py +++ b/src/tablib/formats/_json.py diff --git a/tablib/formats/_latex.py b/src/tablib/formats/_latex.py index 44ee101..44ee101 100644 --- a/tablib/formats/_latex.py +++ b/src/tablib/formats/_latex.py diff --git a/tablib/formats/_ods.py b/src/tablib/formats/_ods.py index dbf57c4..dbf57c4 100644 --- a/tablib/formats/_ods.py +++ b/src/tablib/formats/_ods.py diff --git a/tablib/formats/_rst.py b/src/tablib/formats/_rst.py index 4b53ad7..4b53ad7 100644 --- a/tablib/formats/_rst.py +++ b/src/tablib/formats/_rst.py diff --git a/tablib/formats/_tsv.py b/src/tablib/formats/_tsv.py index 1c6d6a1..1c6d6a1 100644 --- a/tablib/formats/_tsv.py +++ b/src/tablib/formats/_tsv.py diff --git a/tablib/formats/_xls.py b/src/tablib/formats/_xls.py index 88e8636..88e8636 100644 --- a/tablib/formats/_xls.py +++ b/src/tablib/formats/_xls.py diff --git a/tablib/formats/_xlsx.py b/src/tablib/formats/_xlsx.py index f8f21c2..f8f21c2 100644 --- a/tablib/formats/_xlsx.py +++ b/src/tablib/formats/_xlsx.py diff --git a/tablib/formats/_yaml.py b/src/tablib/formats/_yaml.py index 3d17baf..3d17baf 100644 --- a/tablib/formats/_yaml.py +++ b/src/tablib/formats/_yaml.py diff --git a/tablib/packages/__init__.py b/src/tablib/packages/__init__.py index e69de29..e69de29 100644 --- a/tablib/packages/__init__.py +++ b/src/tablib/packages/__init__.py diff --git a/tablib/packages/dbfpy/__init__.py b/src/tablib/packages/dbfpy/__init__.py index e69de29..e69de29 100644 --- a/tablib/packages/dbfpy/__init__.py +++ b/src/tablib/packages/dbfpy/__init__.py diff --git a/tablib/packages/dbfpy/dbf.py b/src/tablib/packages/dbfpy/dbf.py index add74da..8147d0e 100644 --- a/tablib/packages/dbfpy/dbf.py +++ b/src/tablib/packages/dbfpy/dbf.py @@ -31,9 +31,9 @@ Examples: dbf = Dbf(filename, True) for rec in dbf: for fldName in dbf.fieldNames: - print '%s:\t %s (%s)' % (fldName, rec[fldName], - type(rec[fldName])) - print + print('%s:\t %s (%s)' % (fldName, rec[fldName], + type(rec[fldName]))) + print() dbf.close() """ @@ -258,7 +258,7 @@ class Dbf(object): def demo_read(filename): _dbf = Dbf(filename, True) for _rec in _dbf: - print + print() print(repr(_rec)) _dbf.close() diff --git a/tablib/packages/dbfpy/dbfnew.py b/src/tablib/packages/dbfpy/dbfnew.py index 7a06d00..008d307 100644 --- a/tablib/packages/dbfpy/dbfnew.py +++ b/src/tablib/packages/dbfpy/dbfnew.py @@ -160,9 +160,9 @@ if __name__ == '__main__': dbfn.add_field("date", 'D', 8) dbfn.write("tst.dbf") # test new dbf - print "*** created tst.dbf: ***" + print("*** created tst.dbf: ***") dbft = Dbf('tst.dbf', readOnly=0) - print repr(dbft) + print(repr(dbft)) # add a record rec = DbfRecord(dbft) rec['name'] = 'something' @@ -177,13 +177,13 @@ if __name__ == '__main__': rec.store() # show the records - print "*** inserted 2 records into tst.dbf: ***" - print repr(dbft) + print("*** inserted 2 records into tst.dbf: ***") + print(repr(dbft)) for i1 in range(len(dbft)): rec = dbft[i1] for fldName in dbft.fieldNames: - print '%s:\t %s' % (fldName, rec[fldName]) - print + print('%s:\t %s' % (fldName, rec[fldName])) + print() dbft.close() # vim: set et sts=4 sw=4 : diff --git a/tablib/packages/dbfpy/fields.py b/src/tablib/packages/dbfpy/fields.py index 69cd436..69cd436 100644 --- a/tablib/packages/dbfpy/fields.py +++ b/src/tablib/packages/dbfpy/fields.py diff --git a/tablib/packages/dbfpy/header.py b/src/tablib/packages/dbfpy/header.py index 03a877c..03a877c 100644 --- a/tablib/packages/dbfpy/header.py +++ b/src/tablib/packages/dbfpy/header.py diff --git a/tablib/packages/dbfpy/record.py b/src/tablib/packages/dbfpy/record.py index 97bbfb3..97bbfb3 100644 --- a/tablib/packages/dbfpy/record.py +++ b/src/tablib/packages/dbfpy/record.py diff --git a/tablib/packages/dbfpy/utils.py b/src/tablib/packages/dbfpy/utils.py index cef8aa5..cef8aa5 100644 --- a/tablib/packages/dbfpy/utils.py +++ b/src/tablib/packages/dbfpy/utils.py diff --git a/tablib/packages/dbfpy3/__init__.py b/src/tablib/packages/dbfpy3/__init__.py index e69de29..e69de29 100644 --- a/tablib/packages/dbfpy3/__init__.py +++ b/src/tablib/packages/dbfpy3/__init__.py diff --git a/tablib/packages/dbfpy3/dbf.py b/src/tablib/packages/dbfpy3/dbf.py index 6fee457..218353e 100644 --- a/tablib/packages/dbfpy3/dbf.py +++ b/src/tablib/packages/dbfpy3/dbf.py @@ -31,9 +31,8 @@ Examples: dbf = Dbf(filename, True) for rec in dbf: for fldName in dbf.fieldNames: - print '%s:\t %s (%s)' % (fldName, rec[fldName], - type(rec[fldName])) - print + print('%s:\t %s (%s)' % (fldName, rec[fldName], + type(rec[fldName]))) dbf.close() """ diff --git a/tablib/packages/dbfpy3/dbfnew.py b/src/tablib/packages/dbfpy3/dbfnew.py index 8fab275..8fab275 100644 --- a/tablib/packages/dbfpy3/dbfnew.py +++ b/src/tablib/packages/dbfpy3/dbfnew.py diff --git a/tablib/packages/dbfpy3/fields.py b/src/tablib/packages/dbfpy3/fields.py index 87916fe..87916fe 100644 --- a/tablib/packages/dbfpy3/fields.py +++ b/src/tablib/packages/dbfpy3/fields.py diff --git a/tablib/packages/dbfpy3/header.py b/src/tablib/packages/dbfpy3/header.py index 6c0dc4f..6c0dc4f 100644 --- a/tablib/packages/dbfpy3/header.py +++ b/src/tablib/packages/dbfpy3/header.py diff --git a/tablib/packages/dbfpy3/record.py b/src/tablib/packages/dbfpy3/record.py index d301476..d301476 100644 --- a/tablib/packages/dbfpy3/record.py +++ b/src/tablib/packages/dbfpy3/record.py diff --git a/tablib/packages/dbfpy3/utils.py b/src/tablib/packages/dbfpy3/utils.py index 856ade8..856ade8 100644 --- a/tablib/packages/dbfpy3/utils.py +++ b/src/tablib/packages/dbfpy3/utils.py diff --git a/tablib/packages/statistics.py b/src/tablib/packages/statistics.py index e97a6c9..e97a6c9 100644 --- a/tablib/packages/statistics.py +++ b/src/tablib/packages/statistics.py diff --git a/tablib/__init__.py b/tablib/__init__.py deleted file mode 100644 index a217574..0000000 --- a/tablib/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -""" Tablib. """ - -from tablib.core import ( - Databook, Dataset, detect_format, import_set, import_book, - InvalidDatasetType, InvalidDimensions, UnsupportedFormat, - __version__ -) diff --git a/requirements.txt b/tests/requirements.txt index 1106193..cd43514 100644 --- a/requirements.txt +++ b/tests/requirements.txt @@ -1,3 +1,5 @@ +pytest +pytest-cov backports.csv; python_version < '3.0' MarkupPy odfpy diff --git a/test_tablib.py b/tests/test_tablib.py index 216ca88..c872e81 100755 --- a/test_tablib.py +++ b/tests/test_tablib.py @@ -1103,7 +1103,3 @@ class DocTests(unittest.TestCase): def test_rst_formatter_doctests(self): results = doctest.testmod(tablib.formats._rst) self.assertEqual(results.failed, 0) - - -if __name__ == '__main__': - unittest.main() @@ -1,8 +1,40 @@ [tox] +usedevelop = true minversion = 2.4 -envlist = py27, py35, py36, py37 +envlist = + py{27,35,36,37,38}-tests, + py37-{docs,lint} [testenv] -deps = pytest +basepython = + py27: python2.7 + py35: python3.5 + py36: python3.6 + py37: python3.7 + py38: python3.8 +deps = + tests: -rtests/requirements.txt + docs: sphinx extras = pandas -commands = python setup.py test +commands = + tests: pytest {posargs:tests} + docs: sphinx-build -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html + +[testenv:py37-lint] +basepython = python3.7 +deps = + flake8 + # flake8-black + # flake8-isort + twine + check-manifest +commands = + # flake8 src/tablib tests/ + check-manifest -v + python setup.py sdist + twine check dist/* + +[flake8] +exclude = + .tox +ignore=E501,E127,E128,E124 |
