Skip to content

Commit 03cf8de

Browse files
author
Peter Baumgartner
committed
python packaging nonsense
1 parent 0dac4ea commit 03cf8de

File tree

4 files changed

+99
-11
lines changed

4 files changed

+99
-11
lines changed

MANIFEST.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
include *.rst
2+
include *.py
3+
include tox.ini
4+
include Makefile
5+
include .gitignore
6+
include .travis.yml
7+
include appveyor.yml
8+
include .coveragerc
9+
include LICENSE
10+
include *.md

README.rst

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
Excelify
2+
========
3+
4+
Easily export ``pandas`` objects to Excel spreadsheets with IPython
5+
magic.
6+
7+
|Build Status| |codecov|
8+
9+
Example
10+
-------
11+
12+
``%excel``
13+
~~~~~~~~~~
14+
15+
.. code:: python
16+
17+
%load_ext excelify
18+
19+
data = [
20+
{'name' : 'Greg', 'age' : 30},
21+
{'name' : 'Alice', 'age' : 36}
22+
]
23+
df = pd.DataFrame(data)
24+
25+
%excel df -f spreadsheet.xlsx -s sample_data
26+
27+
Magics
28+
------
29+
30+
``%excel``
31+
~~~~~~~~~~
32+
33+
::
34+
35+
%excel [-f FILEPATH] [-s SHEETNAME] dataframe
36+
37+
Saves a DataFrame or Series to Excel
38+
39+
positional arguments:
40+
dataframe DataFrame or Series to Save
41+
42+
optional arguments:
43+
-f FILEPATH, --filepath FILEPATH
44+
Filepath to Excel spreadsheet.Default:
45+
'./{object}_{timestamp}.xlsx'
46+
-s SHEETNAME, --sheetname SHEETNAME
47+
Sheet name to output data.Default:
48+
{object}_{timestamp}
49+
50+
``%excel_all``
51+
~~~~~~~~~~~~~~
52+
53+
::
54+
55+
%excel_all [-f FILEPATH] [-n NOSORT]
56+
57+
Saves all Series or DataFrame objects in the namespace to Excel.
58+
Use at your own peril. Will not allow more than 100 objects.
59+
60+
optional arguments:
61+
-f FILEPATH, --filepath FILEPATH
62+
Filepath to excel spreadsheet.Default:
63+
'./all_data_{timestamp}.xlsx'
64+
-n NOSORT, --nosort NOSORT
65+
Turns off alphabetical sorting of objects for export
66+
to sheets
67+
68+
Dependencies
69+
------------
70+
71+
- IPython
72+
- Pandas
73+
- XlsxWriter ## Why?
74+
75+
I had several Jupyter notebooks that were outputting crosstabs or
76+
summary statistics that would eventually end up in a Word doc. Depending
77+
on the size and complexity of the table, I would either copy/paste or
78+
export to Excel. Due to the inconsistency, this made managing all these
79+
tables a pain. I figured a tool like this would make it easier to
80+
collect everything in a notebook as part of an analysis into one excel
81+
file, deal with formatting in excel, and review and insert into a doc
82+
from there.
83+
84+
.. |Build Status| image:: https://travis-ci.org/pmbaumgartner/excelify.svg?branch=master
85+
:target: https://travis-ci.org/pmbaumgartner/excelify
86+
.. |codecov| image:: https://codecov.io/gh/pmbaumgartner/excelify/branch/master/graph/badge.svg
87+
:target: https://codecov.io/gh/pmbaumgartner/excelify

excelify/__init__.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +0,0 @@
1-
import sys
2-
3-
__version__ = '0.2'
4-
5-
if sys.version_info >= (3, 0):
6-
from excelify.excelify import *
7-
else:
8-
from excelify import *
9-
10-
__all__ = ['excelify']

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
import excelify
44

5-
VERSION = excelify.__version__
5+
VERSION = 0.3
66

77
setup(
88
name='excelify',
@@ -14,4 +14,5 @@
1414
url='https://github.com/pbaumgartner/excelify',
1515
packages=find_packages(exclude=[]),
1616
install_requires=['ipython', 'pandas', 'XlsxWriter', 'xlrd'],
17+
include_package_data=True
1718
)

0 commit comments

Comments
 (0)