EZ Excel
A simple class based xlsx serialization system
Table of contents
Goals
This project has a few goals:
- Make OO projects easier to serialize to xlsx
- Make use of xlsx serialization and deserialization (coming soon) easier
- Write the simplest to use api for xlsx serialization
Installation
From PyPi
- Run
pip install ezexcelorsudo pip3 install ezexcel
From source
- Clone this repo: (https://github.com/Descent098/ez-excel)
- Run
pip install .orsudo pip3 install .in the root directory
Quick-start
Store some animal instances in a spreadsheet called 'animals.xlsx'
from ezexcel import Spreadsheet
class Animal():
def __init__(self, name:str, conservation_status:str):
self.name = name
self.conservation_status = conservation_status
leopard_gecko = Animal('Leopard Gecko', 'Least Concern')
philippine_eagle = Animal('Philippine Eagle', 'Threatened')
with Spreadsheet('animals.xlsx', Animal) as output_sheet:
output_sheet.store(leopard_gecko, philippine_eagle)
Store a list of instances into a spreadsheet called 'users.xlsx'
from ezexcel import Spreadsheet
import random
import string
from dataclasses import dataclass
@dataclass
class User():
Name:str
Age:int
Weight:int
Family: list # Note that Iterables will be flattened to a string with newline seperators
instances = []
ranstring = lambda: ''.join(random.choices(string.ascii_uppercase, k=10)) # Generates a random 10 character string
for i in range(1000):
instances.append(User(ranstring(), random.randint(12,100), random.randint(75,400), [ranstring(), ranstring(), ranstring()]))
with Spreadsheet('users.xlsx', User) as output_sheet:
output_sheet.store(instances)
Additional Documentation
Additional documentation can be found at https://kieranwood.ca/ezexcel
For details on how contributing to the project, please see CONTRIBUTING.md, for details on upcoming changes see our roadmap.
For most recent changes see CHANGELOG.md.
Changelog
0.1.1; September 25th
Fixed logo loading on PyPi
Bug fixes
- Fixed loading issue with logo on PyPi
0.1.0; September 25th
Initial release of EZ Excel
Features
- Ability to provide a class to instantiate a Spreadsheet
- Ability to pass instances in an iterable of class to Spreadsheet to be serialized
- Automatically flatten Iterable attributes within instances to endline delimited strings
- Added testing suite for all existing functionality
Documentation improvements
- Wrote all existing documentation :)
Metadata
Release files for ezexcel 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ezexcel-0.1.1.tar.gz | 5.7 kB | Without provenance | Details for ezexcel-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ezexcel-0.1.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for ezexcel-0.1.1-py2.py3-none-any.whl |
Total release size: 23.9 kB
Release files / ezexcel-0.1.1.tar.gz
| Download URL | ezexcel-0.1.1.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1c25a6a1c1d519ce8e29be7dd6be5545729ce8cf280b6d8df8e9d9f15f909eda
|
|
BLAKE2b-256 checksum How to use checksums |
32015d3b40ab9f78303fb3befae17fe2d06e30112273224915a67ccf63114ed3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
|
Release files / ezexcel-0.1.1-py2.py3-none-any.whl
| Download URL | ezexcel-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 18.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
2e95d48100c5ab98610948a693d6cc0a1064f05c177c6ed93983ad16bfc4d8de
|
|
BLAKE2b-256 checksum How to use checksums |
6e43b40c44715bde1b05d547a7f623a9c67ca2487f897e5801dbf0f90e403aad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.5
|
Security for ezexcel 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.