# 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
```python
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 | | | | |
Raw data
{
"_id": null,
"home_page": "https://github.com/Brightcells/excel-storage",
"name": "excel-storage",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "Excel Storage",
"author": "Hackathon",
"author_email": "kimi.huang@brightcells.com",
"download_url": "https://files.pythonhosted.org/packages/e3/fa/26d4c145d44cdd67a127daac3b16b35e8ce3432797a5df0a9f4e68a74085/excel-storage-1.0.4.tar.gz",
"platform": null,
"description": "# excel-storage\nExcel Storage\n\n## Installation\n\n pip install excel-storage\n\n\n## Usage\n\n from excel_storage import ExcelStorage\n\n def excelfunc():\n data = [\n {\n 'Column 1': 1,\n 'Column 2': 2,\n },\n {\n 'Column 1': 3,\n 'Column 2': 4,\n }\n ]\n fpath = ExcelStorage(data, 'my_data', font='name SimSum').save()\n\n\nor\n\n from excel_storage import ExcelStorage\n\n def excelfunc():\n data = [\n ['Column 1', 'Column 2'],\n [1, 2],\n [3, 4]\n ]\n fpath = ExcelStorage(data, 'my_data', font='name SimSum').save()\n\n\nor\n\n from excel_storage import ExcelStorage\n\n def excelfunc():\n data = [\n ['Column 1', 'Column 2'],\n [1, [2, 3]],\n [3, 4]\n ]\n fpath = ExcelStorage(data, 'my_data', font='name SimSum', merge_type='row_merge').save()\n\n\nor\n\n from excel_storage import ExcelStorage\n\n def excelfunc():\n headers = ['Column 1', 'Column 2', 'Column 3', 'Column 4', 'Column 5']\n 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']]]]]]]]\n fpath = ExcelStorage(data, 'my_data', font='name SimSum', merge_type='list_row_merge', headers=headers).save()\n\n\nor\n\n from excel_storage import ExcelStorage\n\n def excelfunc():\n headers = ['Column 1', 'Column 2', 'Column 3', 'Column 4', 'Column 5']\n mapping = {\n 'field_key': 'Column 1',\n 'data_key': 'Children 1',\n 'next': {\n 'field_key': 'Column 2',\n 'data_key': 'Children 2',\n 'next': {\n 'field_key': ['Column 3', 'Column 4'],\n 'data_key': 'Children 3',\n 'next': {\n 'field_key': 'Column 5',\n }\n }\n }\n }\n data = [{\n 'Column 1': 'Value 1',\n 'Column 11': 'Value 11',\n 'Children 1': [{\n 'Column 2': 'Value 2 Row 1',\n 'Column 22': 'Value 22 Row 1',\n 'Children 2': [{\n 'Column 3': 'Value 3',\n 'Column 4': 'Value 4',\n 'Children 3': {\n 'Column 5': 'Value 5',\n }\n }]\n }, {\n 'Column 2': 'Value 2 Row 2',\n 'Column 22': 'Value 22 Row 2',\n 'Children 2': [{\n 'Column 3': 'Value 3 Row 1',\n 'Column 4': 'Value 4 Row 1',\n 'Children 3': {\n 'Column 5': 'Value 5 Row 1',\n }\n }, {\n 'Column 3': 'Value 3 Row 2',\n 'Column 4': 'Value 4 Row 2',\n 'Children 3': {\n 'Column 5': 'Value 5 Row 2',\n }\n }]\n }]\n }]\n fpath = ExcelStorage(data, 'my_data', font='name SimSum', merge_type='dict_row_merge', mapping=mapping, headers=headers).save()\n\n\n## Params\n\n * font='name SimSum'\n * Set Font as SimSum(\u5b8b\u4f53)\n * force_csv=True\n * CSV Format? True for Yes, False for No, Default is False\n\n\n## CSV\n\n ```python\n datas = [\n [u'\u4e2d\u6587', ]\n ]\n ```\n\n| | Win Excel 2013 | Mac Excel 2011 | Mac Excel 2016 | Mac Numbers |\n| --------------- | :------------: | :------------: | :------------: | :---------: |\n| UTF8 | Messy | Messy | Messy | Normal |\n| GB18030 | Normal | Normal | Normal | Messy |\n| UTF8 + BOM_UTF8 | Normal | Messy | Normal | Normal |\n| UTF16LE + BOM | | | | |\n",
"bugtrack_url": null,
"license": "",
"summary": "Excel Storage",
"version": "1.0.4",
"project_urls": {
"Homepage": "https://github.com/Brightcells/excel-storage"
},
"split_keywords": [
"excel",
"storage"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "29cd437c8bb5d0db5c2c6156b898eaf30993536c750196192c95d331fc49c3e0",
"md5": "26a02e671f2e0a2c11ac3eb9c9e55305",
"sha256": "70650fc782a2766c53d13e272575239ee5ee14a741193c38a9aaced0d1381091"
},
"downloads": -1,
"filename": "excel_storage-1.0.4-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "26a02e671f2e0a2c11ac3eb9c9e55305",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 4141,
"upload_time": "2023-09-14T06:51:26",
"upload_time_iso_8601": "2023-09-14T06:51:26.011203Z",
"url": "https://files.pythonhosted.org/packages/29/cd/437c8bb5d0db5c2c6156b898eaf30993536c750196192c95d331fc49c3e0/excel_storage-1.0.4-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e3fa26d4c145d44cdd67a127daac3b16b35e8ce3432797a5df0a9f4e68a74085",
"md5": "6023d949a047aab5d92f1fd6feb41a7e",
"sha256": "69f28334fedf90d5ec0c5357e1f17ae75c5b74395eedd490e663d2087485111b"
},
"downloads": -1,
"filename": "excel-storage-1.0.4.tar.gz",
"has_sig": false,
"md5_digest": "6023d949a047aab5d92f1fd6feb41a7e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4610,
"upload_time": "2023-09-14T06:51:27",
"upload_time_iso_8601": "2023-09-14T06:51:27.875305Z",
"url": "https://files.pythonhosted.org/packages/e3/fa/26d4c145d44cdd67a127daac3b16b35e8ce3432797a5df0a9f4e68a74085/excel-storage-1.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-14 06:51:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Brightcells",
"github_project": "excel-storage",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "excel-storage"
}