remove duplicated information
This commit is contained in:
parent
7bb75d03c0
commit
7be57ffabb
|
@ -0,0 +1,31 @@
|
|||
Copyright (c) {{copyright_year}} by {{company}} and its contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms of the software as well
|
||||
as documentation, 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.
|
||||
|
||||
THIS SOFTWARE AND DOCUMENTATION 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
|
||||
SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
|
@ -0,0 +1,16 @@
|
|||
{%extends 'README.rst.jj2' %}
|
||||
|
||||
{%block description%}
|
||||
**pyexcel-ods** is a tiny wrapper library to read, manipulate and write data in
|
||||
ods fromat using python 2.6 and python 2.7. You are likely to use it with
|
||||
`pyexcel <https://github.com/pyexcel/pyexcel>`_.
|
||||
`pyexcel-ods3 <https://github.com/pyexcel/pyexcel-ods3>`_ is a sister library that
|
||||
does the same thing but supports Python 3.3 and 3.4 and depends on lxml.
|
||||
{%endblock%}
|
||||
|
||||
{%block extras %}
|
||||
Credits
|
||||
================================================================================
|
||||
|
||||
ODSReader is originally written by `Marco Conti <https://github.com/marcoconti83/read-ods-with-odfpy>`_
|
||||
{%endblock%}
|
|
@ -0,0 +1,3 @@
|
|||
{% for dependency in dependencies: %}
|
||||
{{dependency}}
|
||||
{% endfor %}
|
|
@ -0,0 +1,11 @@
|
|||
{% extends 'setup.py.jj2' %}
|
||||
{%block extras %}
|
||||
if sys.version_info[0] == 2 and sys.version_info[1] < 7:
|
||||
dependencies.append('ordereddict')
|
||||
{%endblock %}
|
||||
|
||||
{%block additional_classifiers%}
|
||||
- 'Programming Language :: Python :: 2.6'
|
||||
- 'Programming Language :: Python :: 2.7'
|
||||
{%endblock%}}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
{% extends 'tests/requirements.txt.jj2' %}
|
||||
{%block extras %}
|
||||
pyexcel
|
||||
pyexcel-xls
|
||||
{%endblock%}
|
|
@ -0,0 +1,5 @@
|
|||
{% extends "travis.yml.jj2" %}
|
||||
|
||||
{%block test_other_python_versions%} - 2.6
|
||||
{%endblock%}
|
||||
|
|
@ -5,14 +5,13 @@ notifications:
|
|||
env:
|
||||
global:
|
||||
python:
|
||||
- 2.6
|
||||
- 2.7
|
||||
- 2.6
|
||||
install:
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == "2.6" ]]; then pip install ordereddict; fi
|
||||
- pip install https://github.com/chfw/pyexcel/archive/master.zip
|
||||
- pip install -r requirements.txt
|
||||
- pip install -r tests/requirements.txt
|
||||
script:
|
||||
make test
|
||||
after_success:
|
||||
codecov
|
||||
codecov
|
2
LICENSE
2
LICENSE
|
@ -1,4 +1,4 @@
|
|||
Copyright (c) 2015-2016 by Onni Software Ltd.
|
||||
Copyright (c) 2015-2016 by Onni Software Ltd. and its contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms of the software as well
|
||||
|
|
|
@ -1 +1 @@
|
|||
include VERSION
|
||||
include README.rst
|
||||
|
|
63
README.rst
63
README.rst
|
@ -8,7 +8,6 @@ pyexcel-ods - Let you focus on data, instead of ods format
|
|||
.. image:: https://codecov.io/github/pyexcel/pyexcel-ods/coverage.png
|
||||
:target: https://codecov.io/github/pyexcel/pyexcel-ods
|
||||
|
||||
|
||||
**pyexcel-ods** is a tiny wrapper library to read, manipulate and write data in
|
||||
ods fromat using python 2.6 and python 2.7. You are likely to use it with
|
||||
`pyexcel <https://github.com/pyexcel/pyexcel>`_.
|
||||
|
@ -16,12 +15,12 @@ ods fromat using python 2.6 and python 2.7. You are likely to use it with
|
|||
does the same thing but supports Python 3.3 and 3.4 and depends on lxml.
|
||||
|
||||
Known constraints
|
||||
==================
|
||||
================================================================================
|
||||
|
||||
Fonts, colors and charts are not supported.
|
||||
|
||||
Installation
|
||||
============
|
||||
================================================================================
|
||||
|
||||
You can install it via pip:
|
||||
|
||||
|
@ -29,7 +28,6 @@ You can install it via pip:
|
|||
|
||||
$ pip install pyexcel-ods
|
||||
|
||||
|
||||
or clone it and install it:
|
||||
|
||||
.. code-block:: bash
|
||||
|
@ -39,19 +37,23 @@ or clone it and install it:
|
|||
$ python setup.py install
|
||||
|
||||
Usage
|
||||
=====
|
||||
================================================================================
|
||||
|
||||
New feature
|
||||
-----------------
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
1. Passing "streaming=True" to get_data, you will get the two dimensional array as a generator
|
||||
2. Passing "data=your_generator" to save_data is acceptable too.
|
||||
|
||||
|
||||
As a standalone library
|
||||
------------------------
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
.. test-code::
|
||||
Write to an ods file
|
||||
********************************************************************************
|
||||
|
||||
.. testcode::
|
||||
:hide:
|
||||
|
||||
>>> import sys
|
||||
|
@ -62,21 +64,18 @@ As a standalone library
|
|||
>>> from pyexcel_io import OrderedDict
|
||||
|
||||
|
||||
Write to an ods file
|
||||
*********************
|
||||
|
||||
Here's the sample code to write a dictionary to an ods file:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
>>> from pyexcel_ods import save_data
|
||||
>>> data = OrderedDict()
|
||||
>>> data = OrderedDict() # from collections import OrderedDict
|
||||
>>> data.update({"Sheet 1": [[1, 2, 3], [4, 5, 6]]})
|
||||
>>> data.update({"Sheet 2": [["row 1", "row 2", "row 3"]]})
|
||||
>>> save_data("your_file.ods", data)
|
||||
|
||||
Read from an ods file
|
||||
**********************
|
||||
********************************************************************************
|
||||
|
||||
Here's the sample code:
|
||||
|
||||
|
@ -88,8 +87,8 @@ Here's the sample code:
|
|||
>>> print(json.dumps(data))
|
||||
{"Sheet 1": [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], "Sheet 2": [["row 1", "row 2", "row 3"]]}
|
||||
|
||||
Write an ods file to memory
|
||||
******************************
|
||||
Write an ods to memory
|
||||
********************************************************************************
|
||||
|
||||
Here's the sample code to write a dictionary to an ods file:
|
||||
|
||||
|
@ -106,10 +105,11 @@ Here's the sample code to write a dictionary to an ods file:
|
|||
>>> # object for downloading
|
||||
|
||||
|
||||
Read from an ods from memory
|
||||
*****************************
|
||||
|
||||
Here's the sample code:
|
||||
Read from an ods from memory
|
||||
********************************************************************************
|
||||
|
||||
Continue from previous example:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
@ -122,7 +122,7 @@ Here's the sample code:
|
|||
|
||||
|
||||
As a pyexcel plugin
|
||||
--------------------
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Import it in your file to enable this plugin:
|
||||
|
||||
|
@ -133,7 +133,7 @@ Import it in your file to enable this plugin:
|
|||
Please note only pyexcel version 0.0.4+ support this.
|
||||
|
||||
Reading from an ods file
|
||||
************************
|
||||
********************************************************************************
|
||||
|
||||
Here is the sample code:
|
||||
|
||||
|
@ -155,7 +155,7 @@ Here is the sample code:
|
|||
+-------+-------+-------+
|
||||
|
||||
Writing to an ods file
|
||||
**********************
|
||||
********************************************************************************
|
||||
|
||||
Here is the sample code:
|
||||
|
||||
|
@ -164,9 +164,9 @@ Here is the sample code:
|
|||
>>> sheet.save_as("another_file.ods")
|
||||
|
||||
Reading from a IO instance
|
||||
================================
|
||||
================================================================================
|
||||
|
||||
You got to wrap the binary content with StringIO to get odf working:
|
||||
You got to wrap the binary content with stream to get ods working:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
@ -192,7 +192,7 @@ You got to wrap the binary content with StringIO to get odf working:
|
|||
|
||||
|
||||
Writing to a StringIO instance
|
||||
================================
|
||||
================================================================================
|
||||
|
||||
You need to pass a StringIO instance to Writer:
|
||||
|
||||
|
@ -210,25 +210,18 @@ You need to pass a StringIO instance to Writer:
|
|||
>>> # object for downloading
|
||||
|
||||
License
|
||||
=========
|
||||
================================================================================
|
||||
|
||||
New BSD License
|
||||
|
||||
|
||||
Dependencies
|
||||
============
|
||||
|
||||
1. odfpy == 0.9.6
|
||||
2. pyexcel-io >= 0.0.4
|
||||
|
||||
Credits
|
||||
=======
|
||||
================================================================================
|
||||
|
||||
ODSReader is originally written by `Marco Conti <https://github.com/marcoconti83/read-ods-with-odfpy>`_
|
||||
|
||||
.. test-code::
|
||||
.. testcode::
|
||||
:hide:
|
||||
|
||||
>>> import os
|
||||
>>> os.unlink("your_file.ods")
|
||||
>>> os.unlink("another_file.ods")
|
||||
>>> os.unlink("another_file.ods")
|
|
@ -0,0 +1,15 @@
|
|||
from os import path, system
|
||||
|
||||
config_dir = 'commons/config'
|
||||
template_dir = 'commons/templates'
|
||||
|
||||
if not path.exists("commons"):
|
||||
system("git clone https://github.com/pyexcel/pyexcel-commons.git commons")
|
||||
system("moban -cd {0} -td {1} -t docs/source/conf.py.jj2 -o docs/source/conf.py -c moban.yaml".format(config_dir, template_dir))
|
||||
system("moban -cd {0} -td {1} .moban.d -t README.rst -o README.rst -c moban.yaml".format(config_dir, template_dir))
|
||||
system("moban -cd {0} -td {1} .moban.d -t setup.py -o setup.py -c moban.yaml".format(config_dir, template_dir))
|
||||
system("moban -cd {0} -td {1} .moban.d -t travis.yml -o .travis.yml -c moban.yaml".format(config_dir, template_dir))
|
||||
system("moban -cd {0} -td .moban.d -t requirements.txt -o requirements.txt -c moban.yaml".format(config_dir))
|
||||
system("moban -cd {0} -td .moban.d -t LICENSE -o LICENSE -c moban.yaml".format(config_dir))
|
||||
system("moban -cd {0} -td {1} .moban.d -t tests/requirements.txt -o tests/requirements.txt -c moban.yaml".format(config_dir, template_dir))
|
||||
system("moban -cd {0} -td {1} .moban.d -t MANIFEST.in.jj2 -o MANIFEST.in -c moban.yaml".format(config_dir, template_dir))
|
|
@ -1,27 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# pyexcel-ods documentation build configuration file, created by
|
||||
# sphinx-quickstart on Tue Sep 08 23:32:58 2015.
|
||||
#
|
||||
# This file is execfile()d with the current directory set to its
|
||||
# containing dir.
|
||||
#
|
||||
# Note that not all possible configuration values are present in this
|
||||
# autogenerated file.
|
||||
#
|
||||
# All configuration values have a default; values that are commented out
|
||||
# serve to show the default.
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
try:
|
||||
with open(os.path.join("..", "..", "VERSION"), "r") as version:
|
||||
version_txt = version.read().rstrip()
|
||||
except:
|
||||
version_txt = "not_in_sphinx"
|
||||
|
||||
|
||||
# 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.
|
||||
|
@ -35,7 +15,14 @@ except:
|
|||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = []
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.doctest',
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.viewcode',
|
||||
]
|
||||
|
||||
intersphinx_mapping = {'pyexcel': ('http://pyexcel.readthedocs.org/en/latest/', None)}
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
|
@ -51,16 +38,16 @@ master_doc = 'index'
|
|||
|
||||
# General information about the project.
|
||||
project = u'pyexcel-ods'
|
||||
copyright = u'2015-2016, Onni Software Ltd.'
|
||||
copyright = u'2015-2016 Onni Software Ltd.'
|
||||
|
||||
# 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 = version_txt
|
||||
version = '0.1.0'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = version_txt
|
||||
release = '0.1.0'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
@ -111,7 +98,6 @@ html_theme = 'default'
|
|||
# further. For a list of options available for each theme, see the
|
||||
# documentation.
|
||||
#html_theme_options = {}
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
#html_theme_path = []
|
||||
|
||||
|
@ -262,4 +248,4 @@ texinfo_documents = [
|
|||
#texinfo_show_urls = 'footnote'
|
||||
|
||||
# If true, do not generate a @detailmenu in the "Top" node's menu.
|
||||
#texinfo_no_detailmenu = False
|
||||
#texinfo_no_detailmenu = False
|
|
@ -0,0 +1,12 @@
|
|||
overrides: "pyexcel.yaml"
|
||||
name: "pyexcel-ods"
|
||||
nick_name: ods
|
||||
version: 0.1.0
|
||||
file_type: ods
|
||||
keywords:
|
||||
- 'ods'
|
||||
dependencies:
|
||||
- pyexcel-io>=0.1.0
|
||||
- odfpy==0.9.6
|
||||
description: |
|
||||
A wrapper library to read, manipulate and write data in ods format
|
|
@ -1,3 +1,2 @@
|
|||
pyexcel_io>=0.1.0
|
||||
pyexcel-io>=0.1.0
|
||||
odfpy==0.9.6
|
||||
|
||||
|
|
31
setup.py
31
setup.py
|
@ -9,43 +9,42 @@ import sys
|
|||
with open("README.rst", 'r') as readme:
|
||||
README_txt = readme.read()
|
||||
|
||||
with open("VERSION", "r") as version:
|
||||
version_txt = version.read().rstrip()
|
||||
|
||||
dependencies = [
|
||||
'pyexcel-io>=0.1.0',
|
||||
'odfpy==0.9.6',
|
||||
'pyexcel-io>=0.1.0'
|
||||
]
|
||||
]
|
||||
|
||||
with open("VERSION", "r") as version:
|
||||
version_txt = version.read().rstrip()
|
||||
extra_dependencies = {}
|
||||
|
||||
if sys.version_info[0] == 2 and sys.version_info[1] < 7:
|
||||
dependencies.append('ordereddict')
|
||||
|
||||
setup(
|
||||
name='pyexcel-ods',
|
||||
author="C. W.",
|
||||
version=version_txt,
|
||||
author_email="wangc_2011@hotmail.com",
|
||||
url="https://github.com/chfw/pyexcel-ods",
|
||||
author='C. W.',
|
||||
version='0.1.0',
|
||||
author_email='wangc_2011 (at) hotmail.com',
|
||||
url='https://github.com/pyexcel/pyexcel-ods',
|
||||
description='A wrapper library to read, manipulate and write data in ods format',
|
||||
install_requires=dependencies,
|
||||
extras_require=extras,
|
||||
packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
|
||||
include_package_data=True,
|
||||
long_description=README_txt,
|
||||
zip_safe=False,
|
||||
license='New BSD License',
|
||||
tests_require=['nose'],
|
||||
keywords=[
|
||||
'excel',
|
||||
'python',
|
||||
'pyexcel',
|
||||
],
|
||||
license='New BSD',
|
||||
classifiers=[
|
||||
'Development Status :: 3 - Alpha',
|
||||
'Topic :: Office/Business',
|
||||
'Topic :: Utilities',
|
||||
'Topic :: Software Development :: Libraries',
|
||||
'Programming Language :: Python',
|
||||
'License :: OSI Approved :: BSD License',
|
||||
'Intended Audience :: Developers',
|
||||
'Programming Language :: Python :: 2.6',
|
||||
'Programming Language :: Python :: 2.7'
|
||||
]
|
||||
)
|
||||
)
|
|
@ -1,7 +1,7 @@
|
|||
pyexcel-io
|
||||
pyexcel-xls
|
||||
nose
|
||||
rednose
|
||||
nose-cov
|
||||
codecov
|
||||
coverage
|
||||
pyexcel
|
||||
pyexcel-xls
|
||||
|
|
Loading…
Reference in New Issue