diff --git a/xlcompose/__init__.py b/xlcompose/__init__.py index c7b3f96..e500c73 100644 --- a/xlcompose/__init__.py +++ b/xlcompose/__init__.py @@ -1,3 +1,4 @@ __version__ = '0.1.3' from xlcompose.core import ( - DataFrame, Series, Row, Column, Tabs, CSpacer, RSpacer, Title, Image, Sheet) + DataFrame, Series, Row, Column, Tabs, CSpacer, RSpacer, Title, Image, + Sheet, VSpacer, HSpacer) diff --git a/xlcompose/core.py b/xlcompose/core.py index 6704837..4399c0a 100644 --- a/xlcompose/core.py +++ b/xlcompose/core.py @@ -456,7 +456,7 @@ def format_validation(self, formats): class RSpacer(DataFrame): - """ Convenience class to create a horizontal spacer """ + """ Convenience class to create a vertical spacer in a Row container""" def __init__(self, width=1, column_widths=2.25): data = pd.DataFrame(dict(zip(list(range(width)), [' '] * width)), index=[0]) @@ -466,8 +466,12 @@ def __init__(self, width=1, column_widths=2.25): self.column_widths = [column_widths] * width +class Vspacer(RSpacer): + pass + + class CSpacer(DataFrame): - """ Convenience class to create a vertical spacer """ + """ Convenience class to create a horizontal spacer in a Column container""" def __init__(self, height=1, column_widths=2.25): data = pd.DataFrame({' ': [' '] * height}) temp = DataFrame(data, index=False, header=False) @@ -476,6 +480,9 @@ def __init__(self, height=1, column_widths=2.25): self.column_widths = [column_widths] +class HSpacer(CSpacer): + pass + class _Container(): """ Base class for Row and Column """