Skip to main content

A small library to interact with python and excel

Project description

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

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

EasyExcel-1.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

EasyExcel-1.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file EasyExcel-1.1.0.tar.gz.

File metadata

  • Download URL: EasyExcel-1.1.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for EasyExcel-1.1.0.tar.gz
Algorithm Hash digest
SHA256 ac8d9e582827b8945d2091f85b3569d75d949ac7b13b42a96be42986a18b5af5
MD5 f9009f06792104803d2363583bb1cf83
BLAKE2b-256 9291acbf5a2a97687a5c333e103f73c999ea5c4a718d759e49bf088c03678f27

See more details on using hashes here.

File details

Details for the file EasyExcel-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: EasyExcel-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for EasyExcel-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5ba000a4b5903b97a2daeeca77d14fe454236c618d04ca048a6700537c7db33d
MD5 253df75130d1676eeb36adf55a5e5e16
BLAKE2b-256 fd45bf2e5c6c14e243b351f5ba6373cc60910188e115ec56d486cf2ccfe3d6b8

See more details on using hashes here.

Supported by

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