Skip to content

Commit

Permalink
0.1.5 - Changed dependencies, now requires pandas 0.16.2 - 0.18.1
Browse files Browse the repository at this point in the history
        - Changed Python support: 2.7, 3.3, 3.4, 3.5
        - Fixed a bug when trying to filter the first row
        - Transitioning to x.y.z version numbers
  • Loading branch information
DeepSpace2 committed Sep 30, 2016
1 parent 4528d17 commit fc8024c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
0.1.5 - Changed dependencies, now requires pandas 0.16.2 - 0.18.1
- Changed Python support: 2.7, 3.3, 3.4, 3.5
- Fixed a bug when trying to filter the first row
- Transitioning to x.y.z version numbers

0.1.4.2 - 'right_to_left' is now set to False as default in 'to_excel()'
- Most of the methods now return 'self', so for example, StyleFrame(..).rename(..).to_excel() is possible.

Expand Down
4 changes: 2 additions & 2 deletions StyleFrame/style_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def __len__(self):
return len(self.data_df)

def __getitem__(self, item):
if isinstance(item,pd.Series):
if isinstance(item, pd.Series):
return self.data_df.__getitem__(item).index
elif isinstance(item, list):
return StyleFrame(self.data_df.__getitem__(item))
Expand Down Expand Up @@ -234,7 +234,7 @@ def get_range_of_cells_for_specific_row(row_index):
except (TypeError, ValueError):
raise TypeError("row must be an index and not %s" % type(row_to_add_filters))

if columns_and_rows_to_freeze:
if columns_and_rows_to_freeze is not None:
if not isinstance(columns_and_rows_to_freeze, basestring if PY2 else str) or len(columns_and_rows_to_freeze) < 2:
raise TypeError("columns_and_rows_to_freeze must be a str for example: 'C3'")
if columns_and_rows_to_freeze[0] not in sheet.column_dimensions:
Expand Down
1 change: 1 addition & 0 deletions StyleFrame/styler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from openpyxl.styles import PatternFill, Style, Color, Border, Side, Font, Alignment, Protection, colors as op_colors
import re


class Styler(object):
"""
Creates openpyxl Style to be applied
Expand Down
2 changes: 1 addition & 1 deletion StyleFrame/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
_version_ = '0.1.4.2'
_version_ = '0.1.5'
9 changes: 3 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='0.1.4.2',
version='0.1.5',

description='A library that wraps pandas and openpyxl and allows easy styling of dataframes in excel. Documentation can be found at http://styleframe.readthedocs.org',
# long_description=long_description,
Expand Down Expand Up @@ -38,13 +38,10 @@

# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],

# What does your project relate to?
Expand All @@ -58,5 +55,5 @@
# your project is installed. For an analysis of "install_requires" vs pip's
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=['pandas<=0.16.2', 'openpyxl<=2.2.5'],
install_requires=['pandas>=0.16.2,<=0.18.1', 'openpyxl<=2.2.5'],
)
2 changes: 1 addition & 1 deletion tests/style_frame_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ def test_apply_column_style_test(self):

def test_apply_style_by_indexes_test(self):
self.df.apply_style_by_indexes(self.df[self.df['a'] == 2], cols_to_style=['a'], bg_color='blue')
self.assertTrue(all([self.df.ix[index, 'a'].style == Styler(bg_color='blue').create_style() for index in self.df.index if self.df.ix[index, 'a'] == 2]))
self.assertTrue(all([self.df.ix[index, 'a'].style == Styler(bg_color='blue').create_style() for index in self.df.index if self.df.ix[index, 'a'] == 2]))

0 comments on commit fc8024c

Please sign in to comment.