python_excel2json
A simple way to parse an excel file and get the json that you want.
Install
pip install python_excel2json
Dependencies
xlrd
Usage
from python_excel2json import parse_excel_to_json
# Step 1: Define the format of your excel that you want to parse.
excel_sheets_format = {
'start_row_sheet_parsing': 1,
'start_column_sheet_parsing': 0,
'sheet_formats': [
{
'sheet_index': 0,
'column_names': [
{
'name': 'name1',
'type': 'str'
},
{
'name': 'name2',
'type': 'str'
},
{
'name': 'name3',
'type': 'str'
},
{
'name': 'name4',
'type': 'float'
}
],
'is_ordered': True
},
{
'sheet_index': 1,
'column_names': [
{
'name': 'name1',
'type': 'str'
},
{
'name': 'name2',
'type': 'str'
},
{
'name': 'name3',
'type': 'str'
},
{
'name': 'name4',
'type': 'float'
}
],
'is_ordered': True,
'start_row_sheet_parsing': 3,
'start_column_sheet_parsing': 5
}
]
}
# Step 2: Define your excel file input. Using 'xlrd' it can be from two ways:
file = '/my/path/my-file.xlsx'
result = parse_excel_to_json(excel_sheets_format, filename=file)
file = your-excel-content
result = parse_excel_to_json(excel_sheets_format, file_contents=file)
# Step 3: Obtain your specific json result.
[
{
'sheet_index': 0,
'results': [
{
'name1': 'value',
'name2': 'value',
'name3': 'value'
},
...
]
},
{
'sheet_index': 1,
'results': [
{
'name1': 'value',
'name2': 'value',
'name3': 'value',
'name4': 'value'
},
...
]
}
]
License
Metadata
Release files for python-excel2json 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_excel2json-0.2-py3-none-any.whl | Python 3 | none | any | Details for python_excel2json-0.2-py3-none-any.whl |
Release files / python_excel2json-0.2-py3-none-any.whl
| Download URL | python_excel2json-0.2-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8e70e0a20bc336ddaa8ef2c33afe40bac40eaff20fba4bf2c9ac3616e56754f5
|
|
BLAKE2b-256 checksum How to use checksums |
c225a132bdabeeef51f5322e0dd9ee0155fc589a5c2b1527748545320d7cc32e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5
|
Security for python-excel2json 0.2
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.