Skip to content

Latest commit

 

History

History
77 lines (49 loc) · 1.29 KB

README.md

File metadata and controls

77 lines (49 loc) · 1.29 KB

Martes

Read an Excel workbook in Pandas and reference cells by coordinates

Installation

pip install git+https://github.com/pashri/martes

Documentation

This is it for now.

Overview

Martes is an extension onto pandas meant to allow access to DataFrame slices by their Excel Coordinates. It's good for reading in data from Excel. It's not good for saving data to Excel.

How to use it

You can load the extension like this:

from martes import PandasWorkbook

You can load your workbook like this:

workbook = PandasWorkbook(filepath)

See your worksheets like this:

print(workbook.sheets)  # Returns a list of sheet names

Access a sheet like this:

addresses_df = workbook['Addresses']

And access data from the worksheet like this:

workbook['Addresses'].xl['A2']
workbook['Addresses'].xl['A2:G50']
workbook['Addresses'].xl['A:A']
workbook['Addresses!A2']
workbook['Addresses!A2:G50']
workbook['Addresses!A:A']

It will always return a DataFrame for a range, and a single cell's value for a cell.

Why Martes?

It's Tuesday

Contributing

You can contribute with pull requests. Make sure to run pytest and add tests to your new functionality