remove duplicated information
This commit is contained in:
parent
1cacb4d6e6
commit
63b0a85c39
|
@ -0,0 +1,20 @@
|
|||
{%extends 'README.rst.jj2' %}
|
||||
|
||||
{%block description%}
|
||||
**pyexcel-{{file_type}}** is a tiny wrapper library to read, manipulate and write data in {{file_type}} format and it can read xlsx and xlsm fromat. You are likely to use it with `pyexcel <https://github.com/pyexcel/pyexcel>`_.
|
||||
{%endblock%}
|
||||
|
||||
{%block extras %}
|
||||
Known Issues
|
||||
=============
|
||||
|
||||
* If a zero was typed in a DATE formatted field in xls, you will get "01/01/1900".
|
||||
* If a zero was typed in a TIME formatted field in xls, you will get "00:00:00".
|
||||
|
||||
Dependencies
|
||||
============
|
||||
|
||||
1. xlrd
|
||||
2. xlwt-future
|
||||
3. pyexcel-io >= 0.0.4
|
||||
{%endblock%}
|
|
@ -0,0 +1,3 @@
|
|||
{% for dependency in dependencies: %}
|
||||
{{dependency}}
|
||||
{% endfor %}
|
|
@ -0,0 +1,17 @@
|
|||
{% extends 'setup.py.jj2' %}
|
||||
|
||||
{%block additional_keywords %}
|
||||
'xls',
|
||||
'xlsx',
|
||||
'xlsm'
|
||||
{%endblock%}
|
||||
|
||||
{%block additional_classifiers%}
|
||||
'Development Status :: 3 - Alpha',
|
||||
'Programming Language :: Python :: 2.6',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Programming Language :: Python :: 3.3',
|
||||
'Programming Language :: Python :: 3.4',
|
||||
'Programming Language :: Python :: 3.5',
|
||||
'Programming Language :: Python :: Implementation :: PyPy'
|
||||
{%endblock%}
|
|
@ -0,0 +1,7 @@
|
|||
{% extends "travis.yml.jj2" %}
|
||||
{%block test_other_python_versions%} - 2.6
|
||||
- 3.3
|
||||
- 3.4
|
||||
- 3.5
|
||||
- pypy
|
||||
{%endblock%}
|
|
@ -5,18 +5,16 @@ notifications:
|
|||
env:
|
||||
global:
|
||||
python:
|
||||
- 2.6
|
||||
- 2.7
|
||||
- 2.6
|
||||
- 3.3
|
||||
- 3.4
|
||||
- 3.5
|
||||
- pypy
|
||||
install:
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == "2.6" ]]; then pip install ordereddict; fi
|
||||
- pip install git+https://github.com/chfw/pyexcel.git
|
||||
- pip install -r requirements.txt
|
||||
- pip install -r tests/requirements.txt
|
||||
script:
|
||||
make test
|
||||
after_success:
|
||||
codecov
|
||||
codecov
|
19
LICENSE
19
LICENSE
|
@ -1,21 +1,20 @@
|
|||
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
|
||||
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 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.
|
||||
* 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.
|
||||
* Neither the name of 'pyexcel-xls' nor 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
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
include README.rst
|
||||
include requirements.txt
|
||||
include VERSION
|
||||
|
|
42
README.rst
42
README.rst
|
@ -1,6 +1,6 @@
|
|||
=============================================================
|
||||
================================================================================
|
||||
pyexcel-xls - Let you focus on data, instead of xls format
|
||||
=============================================================
|
||||
================================================================================
|
||||
|
||||
.. image:: https://api.travis-ci.org/pyexcel/pyexcel-xls.png
|
||||
:target: http://travis-ci.org/pyexcel/pyexcel-xls
|
||||
|
@ -11,12 +11,12 @@ pyexcel-xls - Let you focus on data, instead of xls format
|
|||
**pyexcel-xls** is a tiny wrapper library to read, manipulate and write data in xls format and it can read xlsx and xlsm fromat. You are likely to use it with `pyexcel <https://github.com/pyexcel/pyexcel>`_.
|
||||
|
||||
Known constraints
|
||||
==================
|
||||
================================================================================
|
||||
|
||||
Fonts, colors and charts are not supported.
|
||||
|
||||
Installation
|
||||
============
|
||||
================================================================================
|
||||
|
||||
You can install it via pip:
|
||||
|
||||
|
@ -33,20 +33,21 @@ 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
|
||||
------------------------
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Write to an xls file
|
||||
*********************
|
||||
********************************************************************************
|
||||
|
||||
.. testcode::
|
||||
:hide:
|
||||
|
@ -70,7 +71,7 @@ Here's the sample code to write a dictionary to an xls file:
|
|||
>>> save_data("your_file.xls", data)
|
||||
|
||||
Read from an xls file
|
||||
**********************
|
||||
********************************************************************************
|
||||
|
||||
Here's the sample code:
|
||||
|
||||
|
@ -83,7 +84,7 @@ Here's the sample code:
|
|||
{"Sheet 1": [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], "Sheet 2": [["row 1", "row 2", "row 3"]]}
|
||||
|
||||
Write an xls to memory
|
||||
**********************
|
||||
********************************************************************************
|
||||
|
||||
Here's the sample code to write a dictionary to an xls file:
|
||||
|
||||
|
@ -99,9 +100,10 @@ Here's the sample code to write a dictionary to an xls file:
|
|||
>>> # In reality, you might give it to your http response
|
||||
>>> # object for downloading
|
||||
|
||||
|
||||
|
||||
|
||||
Read from an xls from memory
|
||||
*****************************
|
||||
********************************************************************************
|
||||
|
||||
Continue from previous example:
|
||||
|
||||
|
@ -109,14 +111,14 @@ Continue from previous example:
|
|||
|
||||
>>> # This is just an illustration
|
||||
>>> # In reality, you might deal with xls file upload
|
||||
>>> # where you will read from requests.FILES['YOUR_XL_FILE']
|
||||
>>> # where you will read from requests.FILES['YOUR_XLS_FILE']
|
||||
>>> data = get_data(io)
|
||||
>>> print(json.dumps(data))
|
||||
{"Sheet 1": [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]], "Sheet 2": [[7.0, 8.0, 9.0], [10.0, 11.0, 12.0]]}
|
||||
|
||||
|
||||
As a pyexcel plugin
|
||||
--------------------
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Import it in your file to enable this plugin:
|
||||
|
||||
|
@ -127,7 +129,7 @@ Import it in your file to enable this plugin:
|
|||
Please note only pyexcel version 0.0.4+ support this.
|
||||
|
||||
Reading from an xls file
|
||||
************************
|
||||
********************************************************************************
|
||||
|
||||
Here is the sample code:
|
||||
|
||||
|
@ -149,7 +151,7 @@ Here is the sample code:
|
|||
+-------+-------+-------+
|
||||
|
||||
Writing to an xls file
|
||||
**********************
|
||||
********************************************************************************
|
||||
|
||||
Here is the sample code:
|
||||
|
||||
|
@ -158,7 +160,7 @@ Here is the sample code:
|
|||
>>> sheet.save_as("another_file.xls")
|
||||
|
||||
Reading from a IO instance
|
||||
================================
|
||||
================================================================================
|
||||
|
||||
You got to wrap the binary content with stream to get xls working:
|
||||
|
||||
|
@ -186,7 +188,7 @@ You got to wrap the binary content with stream to get xls working:
|
|||
|
||||
|
||||
Writing to a StringIO instance
|
||||
================================
|
||||
================================================================================
|
||||
|
||||
You need to pass a StringIO instance to Writer:
|
||||
|
||||
|
@ -204,7 +206,7 @@ You need to pass a StringIO instance to Writer:
|
|||
>>> # object for downloading
|
||||
|
||||
License
|
||||
=========
|
||||
================================================================================
|
||||
|
||||
New BSD License
|
||||
|
||||
|
@ -226,4 +228,4 @@ Dependencies
|
|||
|
||||
>>> import os
|
||||
>>> os.unlink("your_file.xls")
|
||||
>>> os.unlink("another_file.xls")
|
||||
>>> os.unlink("another_file.xls")
|
|
@ -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 {1} -t LICENSE.jj2 -o LICENSE -c moban.yaml".format(config_dir, template_dir))
|
||||
system("moban -cd {0} -td {1} -t tests/requirements.txt.jj2 -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,26 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# pyexcel-xls documentation build configuration file, created by
|
||||
# sphinx-quickstart on Sun Nov 1 18:41:01 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,9 +16,14 @@ except:
|
|||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx.ext.doctest'
|
||||
'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']
|
||||
|
||||
|
@ -52,16 +38,16 @@ master_doc = 'index'
|
|||
|
||||
# General information about the project.
|
||||
project = u'pyexcel-xls'
|
||||
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.
|
||||
|
@ -112,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 = []
|
||||
|
||||
|
@ -205,7 +190,7 @@ latex_elements = {
|
|||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
('index', 'pyexcel-xls.tex', u'pyexcel-xls Documentation',
|
||||
u'C.W.', 'manual'),
|
||||
u'Onni Software Ltd.', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
|
@ -235,7 +220,7 @@ latex_documents = [
|
|||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
('index', 'pyexcel-xls', u'pyexcel-xls Documentation',
|
||||
[u'C.W.'], 1)
|
||||
[u'Onni Software Ltd.'], 1)
|
||||
]
|
||||
|
||||
# If true, show URL addresses after external links.
|
||||
|
@ -249,7 +234,7 @@ man_pages = [
|
|||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'pyexcel-xls', u'pyexcel-xls Documentation',
|
||||
u'C.W.', 'pyexcel-xls', 'One line description of project.',
|
||||
u'Onni Software Ltd.', 'pyexcel-xls', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
|
@ -263,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,11 @@
|
|||
overrides: "pyexcel.yaml"
|
||||
name: "pyexcel-xls"
|
||||
nick_name: xls
|
||||
version: 0.1.0
|
||||
file_type: xls
|
||||
dependencies:
|
||||
- pyexcel-io>=0.1.0
|
||||
- xlrd
|
||||
- xlwt-future
|
||||
description: |
|
||||
A wrapper library to read, manipulate and write data in xls format. It reads xlsx and xlsm format
|
32
setup.py
32
setup.py
|
@ -4,7 +4,6 @@ except ImportError:
|
|||
from ez_setup import use_setuptools
|
||||
use_setuptools()
|
||||
from setuptools import setup, find_packages
|
||||
import sys
|
||||
|
||||
with open("README.rst", 'r') as readme:
|
||||
README_txt = readme.read()
|
||||
|
@ -12,38 +11,43 @@ with open("README.rst", 'r') as readme:
|
|||
dependencies = [
|
||||
'pyexcel-io>=0.1.0',
|
||||
'xlrd',
|
||||
'xlwt-future'
|
||||
'xlwt-future',
|
||||
]
|
||||
|
||||
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-xls',
|
||||
author="C. W.",
|
||||
version=version_txt,
|
||||
author_email="wangc_2011@hotmail.com",
|
||||
url="https://github.com/chfw/pyexcel-xls",
|
||||
author='C. W.',
|
||||
version='0.1.0',
|
||||
author_email='wangc_2011 (at) hotmail.com',
|
||||
url='https://github.com/pyexcel/pyexcel-xls',
|
||||
description='A wrapper library to read, manipulate and write data in xls format. It reads xlsx and xlsm 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,
|
||||
tests_require=['nose'],
|
||||
keywords=['excel', 'xls', 'xlsx'],
|
||||
license='GNU GPLv3',
|
||||
keywords=[
|
||||
'excel',
|
||||
'python',
|
||||
'pyexcel',
|
||||
'xls',
|
||||
'xlsx',
|
||||
'xlsm'
|
||||
],
|
||||
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',
|
||||
'Development Status :: 3 - Alpha',
|
||||
'Programming Language :: Python :: 2.6',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Programming Language :: Python :: 3.3',
|
||||
|
@ -51,4 +55,4 @@ setup(
|
|||
'Programming Language :: Python :: 3.5',
|
||||
'Programming Language :: Python :: Implementation :: PyPy'
|
||||
]
|
||||
)
|
||||
)
|
Loading…
Reference in New Issue