Skip to main content

C++ library (dll or so) to converts Excel worksheets to Pandas/Microsoft dataframes

Project description

excel_to_dataframe:

C++ Library to convert Excel worksheets to Pandas dataframes.

The code opens an Excel file, extracts data from selected worksheet and returns a formatted string semicolon separated-values (future version will include comma separated-values). This string can be easily handled by python/pandas.

This software is in testing phase. Feel free to test it out. If you want to share your experience, send me an email (nbittencourt@hotmail.com).

Performance:

On an old processor (Intel Core i7-4510U 2.60 GHz, 4 cores) and with 8Gb RAM, the dll was between 5 and 20 times faster than Pandas.

Python installation (Windows and Linux):

Python 3.9, 3.10,3.11 and 3.12 are supported.

PyPI:

pip install excel-to-dataframe

Anaconda/Miniconda:

conda install -c nbittencourt excel_to_dataframe

To force specific python version, run one of the following:

conda install -c nbittencourt excel_to_dataframe=0.2.60=py39_0
conda install -c nbittencourt excel_to_dataframe=0.2.60=py310_0
conda install -c nbittencourt excel_to_dataframe=0.2.60=py311_0
conda install -c nbittencourt excel_to_dataframe=0.2.60=py312_0

Basic usage:

This example uses 'excel_to_pandas.py' to encapsulates library functions. To access library functions directly, see the code in 'excel_to_pandas.py'. To a full functional example, see 'example.py'.

# Including library to our code:
import excel_to_dataframe.excel_to_pandas as etd   

# Test access to library printing version:
print(etd.version())

# Opening an Excel Workbook:
# Function 'open_excel' will return:
# 	 0 	- success;
#   -1 	- file not found or
#   -2 	- file found, but it isn't a Excel valid file.
ret = etd.open_excel(<excel_file_full_path>) 

# Loading data from worksheet:
# Function 'ws_to_df' will return:
# A Pandas dataframe if success or -1 otherwise
my_pandas_dataframe_1 = etd.ws_to_df(<excel_worksheet_name_1>) 
my_pandas_dataframe_2 = etd.ws_to_df(<excel_worksheet_name_2>) 

# Closing an Excel Workbook. This is mandatory to change from an Excel File to another.
etd.close_excel()

Personal site:

http://www.nrbenergia.somee.com/

or

https://nrbenergia.azurewebsites.net/

More info:

https://www.linkedin.com/in/nelsonrossibittencourt/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

excel_to_dataframe-0.2.60.tar.gz (1.4 MB view details)

Uploaded Source

File details

Details for the file excel_to_dataframe-0.2.60.tar.gz.

File metadata

  • Download URL: excel_to_dataframe-0.2.60.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.3

File hashes

Hashes for excel_to_dataframe-0.2.60.tar.gz
Algorithm Hash digest
SHA256 ee2d384bf5a03b9e616f63764ac8cc68e5cc79efe1e66c4d36d0877339bd3b92
MD5 73b69eae45005756cd4adce1bdecc271
BLAKE2b-256 166e45feaad91c27591b98f9fef56ba868f757398608bf42c8c48472e1813615

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page