excel-storage
Excel Storage
Installation
pip install excel-storage
Usage
from excel_storage import ExcelStorage
def excelfunc():
data = [
{
'Column 1': 1,
'Column 2': 2,
},
{
'Column 1': 3,
'Column 2': 4,
}
]
fpath = ExcelStorage(data, 'my_data', font='name SimSum').save()
or
from excel_storage import ExcelStorage
def excelfunc():
data = [
['Column 1', 'Column 2'],
[1, 2],
[3, 4]
]
fpath = ExcelStorage(data, 'my_data', font='name SimSum').save()
or
from excel_storage import ExcelStorage
def excelfunc():
data = [
['Column 1', 'Column 2'],
[1, [2, 3]],
[3, 4]
]
fpath = ExcelStorage(data, 'my_data', font='name SimSum', merge_type='row_merge').save()
or
from excel_storage import ExcelStorage
def excelfunc():
headers = ['Column 1', 'Column 2', 'Column 3', 'Column 4', 'Column 5']
data = [['Value 1', [['Value 2 Row 1', [['Value 3', 'Value 4', [['Value 5']]]]], ['Value 2 Row 2', [['Value 3 Row 1', 'Value 4 Row 1', [['Value 5 Row 1']]], ['Value 3 Row 2', 'Value 4 Row 2', [['Value 5 Row 2']]]]]]]]
fpath = ExcelStorage(data, 'my_data', font='name SimSum', merge_type='list_row_merge', headers=headers).save()
or
from excel_storage import ExcelStorage
def excelfunc():
headers = ['Column 1', 'Column 2', 'Column 3', 'Column 4', 'Column 5']
mapping = {
'field_key': 'Column 1',
'data_key': 'Children 1',
'next': {
'field_key': 'Column 2',
'data_key': 'Children 2',
'next': {
'field_key': ['Column 3', 'Column 4'],
'data_key': 'Children 3',
'next': {
'field_key': 'Column 5',
}
}
}
}
data = [{
'Column 1': 'Value 1',
'Column 11': 'Value 11',
'Children 1': [{
'Column 2': 'Value 2 Row 1',
'Column 22': 'Value 22 Row 1',
'Children 2': [{
'Column 3': 'Value 3',
'Column 4': 'Value 4',
'Children 3': {
'Column 5': 'Value 5',
}
}]
}, {
'Column 2': 'Value 2 Row 2',
'Column 22': 'Value 22 Row 2',
'Children 2': [{
'Column 3': 'Value 3 Row 1',
'Column 4': 'Value 4 Row 1',
'Children 3': {
'Column 5': 'Value 5 Row 1',
}
}, {
'Column 3': 'Value 3 Row 2',
'Column 4': 'Value 4 Row 2',
'Children 3': {
'Column 5': 'Value 5 Row 2',
}
}]
}]
}]
fpath = ExcelStorage(data, 'my_data', font='name SimSum', merge_type='dict_row_merge', mapping=mapping, headers=headers).save()
Params
- font='name SimSum'
- Set Font as SimSum(宋体)
- force_csv=True
- CSV Format? True for Yes, False for No, Default is False
CSV
datas = [
[u'中文', ]
]
| Win Excel 2013 | Mac Excel 2011 | Mac Excel 2016 | Mac Numbers | |
|---|---|---|---|---|
| UTF8 | Messy | Messy | Messy | Normal |
| GB18030 | Normal | Normal | Normal | Messy |
| UTF8 + BOM_UTF8 | Normal | Messy | Normal | Normal |
| UTF16LE + BOM |
Metadata
Release files for excel-storage 1.0.4
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 | |
|---|---|---|---|---|
| excel-storage-1.0.4.tar.gz | 4.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| excel_storage-1.0.4-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 8.8 kB
Release files / excel-storage-1.0.4.tar.gz
| Download URL | excel-storage-1.0.4.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69f28334fedf90d5ec0c5357e1f17ae75c5b74395eedd490e663d2087485111b
|
|
BLAKE2b-256 checksum How to use checksums |
e3fa26d4c145d44cdd67a127daac3b16b35e8ce3432797a5df0a9f4e68a74085
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Release files / excel_storage-1.0.4-py2.py3-none-any.whl
| Download URL | excel_storage-1.0.4-py2.py3-none-any.whl |
|---|---|
| Size | 4.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
70650fc782a2766c53d13e272575239ee5ee14a741193c38a9aaced0d1381091
|
|
BLAKE2b-256 checksum How to use checksums |
29cd437c8bb5d0db5c2c6156b898eaf30993536c750196192c95d331fc49c3e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.1
|
Security for excel-storage 1.0.4
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.