Skip to main content

EasyExcel

Build Status Coverage Status

Why Another Python-Excel Library?

For a project I found myself needing to interact with some old excel spreadsheets and the common alternatives such as pandas and openpyxl weren't enough for me. The biggest need this library fills for me is being able to easily append my work to existing spreadsheets. Other libraries would overwrite the whole spreadsheet which doesn't do much good when you are trying to preserve the original data. This library also excels (pun intended) at interacting with non-standard formatting in spreadsheets. Pandas is a great library if you are in control of the data formatting but often that's not possible. All-in-all this project aims to help you get up and running in as little time as possible while maintaining an extremely easy to use interface. Enjoy!

Getting started

Starting development using EasyExcel takes almost no time! Simply install via the pip command:

pip install EasyExcel

From here you can import it into your source file by calling:

import EasyExcel #you will call this by using EasyExcel.PythonExcelConverter(args*)

Documentation

  1. PythonExcelConverter(filename, extension, sheet_name, output_filename)

  • filename (string): The name of the file you want to read-in without the extension
  • extension (string): The file extension (.xlsx)
  • sheet_name (string): The name of the sheet you want to pull data from (Sheet1, Sheet2, etc...)
  • output_filename: This is the filename that EasyExcel will write to upon a save. To append data to your spreadsheet simply use the same name as your filename
  1. query_column(column_number)

  • column_number (int): The number of the column you want to grab data from (A=1, B=2, C=3, etc...)
  1. write_list_to_column(the_list, col_letter, title, start):

  • the_list (list): This is the list/array that you want to write as a column in the spreadsheet
  • col_letter (string): This is the letter of the column you want to write to
  • title (string): This will be your column header
  • start (int): This is the row number that your header will appear on and your data will appear below
  1. query_row(row_number):

  • row_number (int): The number of the row you want to get data from
  1. query_cell(col_letter, row_number):

  • col_letter (string): The letter of the column you want to grab data from
  • row_number (int): The number of the row you want to grab data from
  1. write_to_cell(col_letter, row_number, val):

  • col_letter (string): The letter of the column you want to write data to
  • row_number (int): The number of the row you want to write data to
  • val (string/int): The data you want written to the cell
  1. save_file()

  • Requires no arguments. Simply saves the file as ouput_name in your working directory

Contributions

Want to help contribute? This is just the start for a small project I needed but I would love to expand it. There is a need for better excel libraries in the Python ecosystem and I'd love to help! To contribute, open a pull request with a well-documented change-log and I'll merge it. I would request that if you do, please use Pylint to make sure that this project follows the PEP8 standards for readability and future collaboration.

Possible Additions

  • Query a section of data instead of a whole column
  • Make spreadsheet cell addressing consistent instead of currently using both letters and numbers for column heads
  • add more flexibility for opening and saving spreadsheets

Release files for EasyExcel 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for EasyExcel 1.1.0
File Size Uploaded
EasyExcel-1.1.0.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for EasyExcel 1.1.0
File Interpreter ABI Platform
EasyExcel-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / EasyExcel-1.1.0.tar.gz

Download URL EasyExcel-1.1.0.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ac8d9e582827b8945d2091f85b3569d75d949ac7b13b42a96be42986a18b5af5
BLAKE2b-256 checksum
How to use checksums
9291acbf5a2a97687a5c333e103f73c999ea5c4a718d759e49bf088c03678f27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15rc1

Release files / EasyExcel-1.1.0-py3-none-any.whl

Download URL EasyExcel-1.1.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ba000a4b5903b97a2daeeca77d14fe454236c618d04ca048a6700537c7db33d
BLAKE2b-256 checksum
How to use checksums
fd45bf2e5c6c14e243b351f5ba6373cc60910188e115ec56d486cf2ccfe3d6b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.15rc1

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page