Skip to content

Commit

Permalink
remove duplicated information
Browse files Browse the repository at this point in the history
  • Loading branch information
chfw committed Jan 23, 2016
1 parent dad9225 commit 8656067
Show file tree
Hide file tree
Showing 21 changed files with 749 additions and 225 deletions.
31 changes: 31 additions & 0 deletions .moban.d/LICENSE
@@ -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.
64 changes: 64 additions & 0 deletions .moban.d/README.rst
@@ -0,0 +1,64 @@
{%extends 'WEB-README.rst.jj2' %}

{%block header %}
Tested Django Versions
========================

.. image:: https://img.shields.io/badge/django-1.9-green.svg
:target: http://travis-ci.org/pyexcel/django-excel

.. image:: https://img.shields.io/badge/django-1.8.2-green.svg
:target: http://travis-ci.org/pyexcel/django-excel

.. image:: https://img.shields.io/badge/django-1.7.8-green.svg
:target: http://travis-ci.org/pyexcel/django-excel
{%endblock%}

{%block setup%}
Setup
======

You will need to update your *settings.py*:

.. code-block:: python
FILE_UPLOAD_HANDLERS = ("django_excel.ExcelMemoryFileUploadHandler",
"django_excel.TemporaryExcelFileUploadHandler")
{%endblock%}


{% block usage %}
Usage
=========
Here is the example viewing function codes:

.. code-block:: python
from django.shortcuts import render_to_response
from django.http import HttpResponseBadRequest
from django import forms
from django.template import RequestContext
import django_excel as excel
class UploadFileForm(forms.Form):
file = forms.FileField()
def upload(request):
if request.method == "POST":
form = UploadFileForm(request.POST, request.FILES)
if form.is_valid():
filehandle = request.FILES['file']
return excel.make_response(filehandle.get_sheet(), "csv")
else:
return HttpResponseBadRequest()
else:
form = UploadFileForm()
return render_to_response('upload_form.html',
{'form': form},
context_instance=RequestContext(request))
def download(request):
sheet = excel.pe.Sheet([[1, 2],[3, 4]])
return excel.make_response(sheet, "csv")
{% endblock %}
1 change: 1 addition & 0 deletions .moban.d/docs/source/conf.py
@@ -0,0 +1 @@
{% extends 'docs/source/conf.py.jj2' %}
431 changes: 431 additions & 0 deletions .moban.d/docs/source/index.rst.jj2

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions .moban.d/requirements.txt
@@ -0,0 +1,3 @@
{% for dependency in dependencies: %}
{{dependency}}
{% endfor %}
23 changes: 23 additions & 0 deletions .moban.d/setup.py
@@ -0,0 +1,23 @@
{% extends 'setup.py.jj2' %}
{%block extras %}
{%endblock %}
{%block additional_keywords%}
'API',
'Django'
{%endblock%}

{%block additional_classifers%}
'Development Status :: 3 - Alpha',
'Environment :: Web Environment',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Libraries :: Python Modules',
'Framework :: Django :: 1.7',
'Framework :: Django :: 1.8',
'Framework :: Django :: 1.9',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5'
{%endblock%}
7 changes: 7 additions & 0 deletions .moban.d/tests/requirements.txt
@@ -0,0 +1,7 @@
{% extends 'tests/requirements.txt.jj2' %}
{%block extras %}
lxml
pyexcel-ods3>=0.1.0
pyexcel-xls>=0.1.0
pyexcel-xlsx>=0.1.0
{%endblock%}
25 changes: 25 additions & 0 deletions .moban.d/travis.yml
@@ -0,0 +1,25 @@
{% extends "travis.yml.jj2" %}
{%block test_other_environments%}
- DJANGO_VERSION=1.7.8
- DJANGO_VERSION=1.8.2
- DJANGO_VERSION=1.9
{%endblock%}

{%block exclusion_matrix%}
matrix:
exclude:
- python: 3.3
env: DJANGO_VERSION=1.9
- python: 3.5
env: DJANGO_VERSION=1.7.8
- python: 3.5
env: DJANGO_VERSION=1.8.2
{%endblock%}

{%block test_other_python_versions%} - 3.3
- 3.4
- 3.5
{%endblock%}

{% block custom_install %} - pip install Django==$DJANGO_VERSION
{% endblock%}
5 changes: 3 additions & 2 deletions .travis.yml
Expand Up @@ -20,10 +20,11 @@ matrix:
- python: 3.5
env: DJANGO_VERSION=1.8.2
install:
- rm applymoban.py
- pip install Django==$DJANGO_VERSION
- pip install -r requirements.txt
- pip install -r test_requirements.txt
- pip install -r tests/requirements.txt
script:
make test
after_success:
codecov
codecov
36 changes: 19 additions & 17 deletions LICENSE
@@ -1,8 +1,9 @@
Copyright (c) 2015, 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, with or without
modification, are permitted provided that the following conditions are met:
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.
Expand All @@ -11,18 +12,19 @@ modification, are permitted provided that the following conditions are met:
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of Flask-Excel nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE 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 HOLDER 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, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* Neither the name of 'django-excel' 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
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.
3 changes: 1 addition & 2 deletions MANIFEST.in
@@ -1,2 +1 @@
include requirements.txt
include VERSION
include README.rst
54 changes: 25 additions & 29 deletions README.rst
@@ -1,30 +1,30 @@
==============================================================
================================================================================
django-excel - Let you focus on data, instead of file formats
==============================================================
================================================================================

.. image:: https://api.travis-ci.org/pyexcel/django-excel.svg?branch=master
:target: http://travis-ci.org/pyexcel/django-excel
:target: http://travis-ci.org/pyexcel/django-excel

.. image:: https://codecov.io/github/pyexcel/django-excel/coverage.png
:target: https://codecov.io/github/pyexcel/django-excel

.. image:: https://readthedocs.org/projects/django-excel/badge/?version=latest
:target: http://django-excel.readthedocs.org/en/latest/
:target: http://django-excel.readthedocs.org/en/latest/

**django-excel** is based on `pyexcel <https://github.com/pyexcel/pyexcel>`_ and makes
it easy to consume/produce information stored in excel files over HTTP protocol as
well as on file system. This library can turn the excel data into Pythonic a list of
lists, a list of records(dictionaries), dictionaries of lists. And vice versa. Hence
it lets you focus on data in Django web development, instead of file formats.
well as on file system. This library can turn the excel data into a list of lists,
a list of records(dictionaries), dictionaries of lists. And vice versa. Hence it
lets you focus on data in Django based web development, instead of file formats.

The idea originated from the problem of the illiteracy of excel file formats of
non-technical office workers: such as office assistant, human resource administrator.
There is nothing with the un-deniable fact that some people do not know the difference
among various excel formats. It becomes usability problem to those people when a web
service cannot parse the excel file that they saved using Microsoft Excel. Instead of
training those people about file formats, this library helps web developers to handle
most of the excel file formats by unifying the programming interface to most of the
excel readers and writers.
There is nothing with the un-deniable fact that some people do not know the
difference among various excel formats. It becomes usability problem to those
people when a web service cannot parse the excel file that they saved using
Microsoft Excel. Instead of training those people about file formats, this library
helps web developers to handle most of the excel file formats by unifying the
programming interface to most of the excel readers and writers.

The highlighted features are:

Expand All @@ -36,15 +36,16 @@ The highlighted features are:
Available Plugins
=================

================ ========================================================================
Plugins Supported file formats
================ ========================================================================
================ ==========================================
Plugins Supported file formats
================ ==========================================
`pyexcel-xls`_ xls, xlsx(r), xlsm(r)
`pyexcel-xlsx`_ xlsx
`pyexcel-ods3`_ ods (python 2.7, 3.3, 3.4)
`pyexcel-ods`_ ods (python 2.6, 2.7)
`pyexcel-text`_ (write only)json, rst, mediawiki,latex, grid, pipe, orgtbl, plain simple
================ ========================================================================
`pyexcel-ods`_ ods (python 2.6, 2.7)
`pyexcel-ods3`_ ods (python 2.7, 3.3, 3.4)
`pyexcel-text`_ write only)json, rst, mediawiki,
latex, grid, pipe, orgtbl, plain simple
================ ==========================================

.. _pyexcel-xls: https://github.com/pyexcel/pyexcel-xls
.. _pyexcel-xlsx: https://github.com/pyexcel/pyexcel-xlsx
Expand All @@ -58,7 +59,6 @@ Known constraints

Fonts, colors and charts are not supported.


Tested Django Versions
========================

Expand All @@ -71,22 +71,21 @@ Tested Django Versions
.. image:: https://img.shields.io/badge/django-1.7.8-green.svg
:target: http://travis-ci.org/pyexcel/django-excel


Installation
============

You can install it via pip:

.. code-block:: bash
$ pip install django-excel
$ pip install django-excel
or clone it and install it:

.. code-block:: bash
$ git clone http://github.com/pyexcel/django-pyexcel.git
$ git clone http://github.com/pyexcel/django-excel.git
$ cd django-excel
$ python setup.py install
Expand All @@ -104,8 +103,7 @@ You will need to update your *settings.py*:
Usage
======

=========
Here is the example viewing function codes:

.. code-block:: python
Expand Down Expand Up @@ -138,8 +136,6 @@ Here is the example viewing function codes:
return excel.make_response(sheet, "csv")
License
=============
==========

New BSD License


1 change: 0 additions & 1 deletion VERSION

This file was deleted.

17 changes: 17 additions & 0 deletions applymoban.py
@@ -0,0 +1,17 @@
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 ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t README.rst -o README.rst -c moban.yaml")
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t setup.py -o setup.py -c moban.yaml")
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t docs/source/conf.py -o doc/source/conf.py -c moban.yaml")
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t travis.yml -o .travis.yml -c moban.yaml")
system("moban -cd ../pyexcel-config/config -td .moban.d -t requirements.txt -o requirements.txt -c moban.yaml")
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates -t LICENSE.jj2 -o LICENSE -c moban.yaml")
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t tests/requirements.txt -o tests/requirements.txt -c moban.yaml")
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t MANIFEST.in.jj2 -o MANIFEST.in -c moban.yaml")
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t docs/source/index.rst.jj2 -o doc/source/index.rst -c moban.yaml")

0 comments on commit 8656067

Please sign in to comment.