Skip to content

Commit 5d1fd56

Browse files
committed
Merge branch 'upstream'
2 parents df91144 + 8656067 commit 5d1fd56

21 files changed

+749
-225
lines changed

.moban.d/LICENSE

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Copyright (c) {{copyright_year}} by {{company}} and its contributors
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms of the software as well
5+
as documentation, with or without modification, are permitted provided
6+
that the following conditions are met:
7+
8+
* Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
11+
* Redistributions in binary form must reproduce the above
12+
copyright notice, this list of conditions and the following
13+
disclaimer in the documentation and/or other materials provided
14+
with the distribution.
15+
16+
* The names of the contributors may not be used to endorse or
17+
promote products derived from this software without specific
18+
prior written permission.
19+
20+
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
21+
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
22+
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
24+
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30+
SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
31+
DAMAGE.

.moban.d/README.rst

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{%extends 'WEB-README.rst.jj2' %}
2+
3+
{%block header %}
4+
Tested Django Versions
5+
========================
6+
7+
.. image:: https://img.shields.io/badge/django-1.9-green.svg
8+
:target: http://travis-ci.org/pyexcel/django-excel
9+
10+
.. image:: https://img.shields.io/badge/django-1.8.2-green.svg
11+
:target: http://travis-ci.org/pyexcel/django-excel
12+
13+
.. image:: https://img.shields.io/badge/django-1.7.8-green.svg
14+
:target: http://travis-ci.org/pyexcel/django-excel
15+
{%endblock%}
16+
17+
{%block setup%}
18+
Setup
19+
======
20+
21+
You will need to update your *settings.py*:
22+
23+
.. code-block:: python
24+
25+
FILE_UPLOAD_HANDLERS = ("django_excel.ExcelMemoryFileUploadHandler",
26+
"django_excel.TemporaryExcelFileUploadHandler")
27+
28+
{%endblock%}
29+
30+
31+
{% block usage %}
32+
Usage
33+
=========
34+
Here is the example viewing function codes:
35+
36+
.. code-block:: python
37+
38+
from django.shortcuts import render_to_response
39+
from django.http import HttpResponseBadRequest
40+
from django import forms
41+
from django.template import RequestContext
42+
import django_excel as excel
43+
44+
class UploadFileForm(forms.Form):
45+
file = forms.FileField()
46+
47+
def upload(request):
48+
if request.method == "POST":
49+
form = UploadFileForm(request.POST, request.FILES)
50+
if form.is_valid():
51+
filehandle = request.FILES['file']
52+
return excel.make_response(filehandle.get_sheet(), "csv")
53+
else:
54+
return HttpResponseBadRequest()
55+
else:
56+
form = UploadFileForm()
57+
return render_to_response('upload_form.html',
58+
{'form': form},
59+
context_instance=RequestContext(request))
60+
61+
def download(request):
62+
sheet = excel.pe.Sheet([[1, 2],[3, 4]])
63+
return excel.make_response(sheet, "csv")
64+
{% endblock %}

.moban.d/docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends 'docs/source/conf.py.jj2' %}

.moban.d/docs/source/index.rst.jj2

Lines changed: 431 additions & 0 deletions
Large diffs are not rendered by default.

.moban.d/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% for dependency in dependencies: %}
2+
{{dependency}}
3+
{% endfor %}

.moban.d/setup.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{% extends 'setup.py.jj2' %}
2+
{%block extras %}
3+
{%endblock %}
4+
{%block additional_keywords%}
5+
'API',
6+
'Django'
7+
{%endblock%}
8+
9+
{%block additional_classifers%}
10+
'Development Status :: 3 - Alpha',
11+
'Environment :: Web Environment',
12+
'Topic :: Internet :: WWW/HTTP',
13+
'Topic :: Software Development :: Libraries :: Python Modules',
14+
'Framework :: Django :: 1.7',
15+
'Framework :: Django :: 1.8',
16+
'Framework :: Django :: 1.9',
17+
'Programming Language :: Python :: 2',
18+
'Programming Language :: Python :: 2.7',
19+
'Programming Language :: Python :: 3',
20+
'Programming Language :: Python :: 3.3',
21+
'Programming Language :: Python :: 3.4',
22+
'Programming Language :: Python :: 3.5'
23+
{%endblock%}

.moban.d/tests/requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{% extends 'tests/requirements.txt.jj2' %}
2+
{%block extras %}
3+
lxml
4+
pyexcel-ods3>=0.1.0
5+
pyexcel-xls>=0.1.0
6+
pyexcel-xlsx>=0.1.0
7+
{%endblock%}

.moban.d/travis.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{% extends "travis.yml.jj2" %}
2+
{%block test_other_environments%}
3+
- DJANGO_VERSION=1.7.8
4+
- DJANGO_VERSION=1.8.2
5+
- DJANGO_VERSION=1.9
6+
{%endblock%}
7+
8+
{%block exclusion_matrix%}
9+
matrix:
10+
exclude:
11+
- python: 3.3
12+
env: DJANGO_VERSION=1.9
13+
- python: 3.5
14+
env: DJANGO_VERSION=1.7.8
15+
- python: 3.5
16+
env: DJANGO_VERSION=1.8.2
17+
{%endblock%}
18+
19+
{%block test_other_python_versions%} - 3.3
20+
- 3.4
21+
- 3.5
22+
{%endblock%}
23+
24+
{% block custom_install %} - pip install Django==$DJANGO_VERSION
25+
{% endblock%}

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@ matrix:
2020
- python: 3.5
2121
env: DJANGO_VERSION=1.8.2
2222
install:
23+
- rm applymoban.py
2324
- pip install Django==$DJANGO_VERSION
2425
- pip install -r requirements.txt
25-
- pip install -r test_requirements.txt
26+
- pip install -r tests/requirements.txt
2627
script:
2728
make test
2829
after_success:
29-
codecov
30+
codecov

LICENSE

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
Copyright (c) 2015, Onni Software Ltd.
1+
Copyright (c) 2015-2016 by Onni Software Ltd. and its contributors
22
All rights reserved.
33

4-
Redistribution and use in source and binary forms, with or without
5-
modification, are permitted provided that the following conditions are met:
4+
Redistribution and use in source and binary forms of the software as well
5+
as documentation, with or without modification, are permitted provided
6+
that the following conditions are met:
67

78
* Redistributions of source code must retain the above copyright notice, this
89
list of conditions and the following disclaimer.
@@ -11,18 +12,19 @@ modification, are permitted provided that the following conditions are met:
1112
this list of conditions and the following disclaimer in the documentation
1213
and/or other materials provided with the distribution.
1314

14-
* Neither the name of Flask-Excel nor the names of its
15-
contributors may be used to endorse or promote products derived from
16-
this software without specific prior written permission.
17-
18-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15+
* Neither the name of 'django-excel' nor the names of the contributors
16+
may not be used to endorse or promote products derived from this software
17+
without specific prior written permission.
2818

19+
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
20+
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
21+
NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
23+
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29+
SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
30+
DAMAGE.

MANIFEST.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
include requirements.txt
2-
include VERSION
1+
include README.rst

README.rst

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
==============================================================
1+
================================================================================
22
django-excel - Let you focus on data, instead of file formats
3-
==============================================================
3+
================================================================================
44

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

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

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

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

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

2929
The highlighted features are:
3030

@@ -36,15 +36,16 @@ The highlighted features are:
3636
Available Plugins
3737
=================
3838

39-
================ ========================================================================
40-
Plugins Supported file formats
41-
================ ========================================================================
39+
================ ==========================================
40+
Plugins Supported file formats
41+
================ ==========================================
4242
`pyexcel-xls`_ xls, xlsx(r), xlsm(r)
4343
`pyexcel-xlsx`_ xlsx
44-
`pyexcel-ods3`_ ods (python 2.7, 3.3, 3.4)
45-
`pyexcel-ods`_ ods (python 2.6, 2.7)
46-
`pyexcel-text`_ (write only)json, rst, mediawiki,latex, grid, pipe, orgtbl, plain simple
47-
================ ========================================================================
44+
`pyexcel-ods`_ ods (python 2.6, 2.7)
45+
`pyexcel-ods3`_ ods (python 2.7, 3.3, 3.4)
46+
`pyexcel-text`_ write only)json, rst, mediawiki,
47+
latex, grid, pipe, orgtbl, plain simple
48+
================ ==========================================
4849

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

5960
Fonts, colors and charts are not supported.
6061

61-
6262
Tested Django Versions
6363
========================
6464

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

74-
7574
Installation
7675
============
7776

7877
You can install it via pip:
7978

8079
.. code-block:: bash
8180
82-
$ pip install django-excel
81+
$ pip install django-excel
8382
8483
8584
or clone it and install it:
8685

8786
.. code-block:: bash
8887
89-
$ git clone http://github.com/pyexcel/django-pyexcel.git
88+
$ git clone http://github.com/pyexcel/django-excel.git
9089
$ cd django-excel
9190
$ python setup.py install
9291
@@ -104,8 +103,7 @@ You will need to update your *settings.py*:
104103
105104
106105
Usage
107-
======
108-
106+
=========
109107
Here is the example viewing function codes:
110108

111109
.. code-block:: python
@@ -138,8 +136,6 @@ Here is the example viewing function codes:
138136
return excel.make_response(sheet, "csv")
139137
140138
License
141-
=============
139+
==========
142140

143141
New BSD License
144-
145-

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

applymoban.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from os import path, system
2+
3+
config_dir = 'commons/config'
4+
template_dir = 'commons/templates'
5+
6+
if not path.exists("commons"):
7+
system("git clone https://github.com/pyexcel/pyexcel-commons.git commons")
8+
9+
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t README.rst -o README.rst -c moban.yaml")
10+
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t setup.py -o setup.py -c moban.yaml")
11+
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")
12+
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t travis.yml -o .travis.yml -c moban.yaml")
13+
system("moban -cd ../pyexcel-config/config -td .moban.d -t requirements.txt -o requirements.txt -c moban.yaml")
14+
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates -t LICENSE.jj2 -o LICENSE -c moban.yaml")
15+
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t tests/requirements.txt -o tests/requirements.txt -c moban.yaml")
16+
system("moban -cd ../pyexcel-config/config -td ../pyexcel-config/templates .moban.d -t MANIFEST.in.jj2 -o MANIFEST.in -c moban.yaml")
17+
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 commit comments

Comments
 (0)