{"id":13806118,"url":"https://github.com/pyexcel-webwares/Flask-Excel","last_synced_at":"2025-05-13T21:32:29.547Z","repository":{"id":26162893,"uuid":"29608331","full_name":"pyexcel-webwares/Flask-Excel","owner":"pyexcel-webwares","description":"A flask extension using pyexcel to read, manipulate and write data in different excel formats: csv, ods, xls, xlsx and xlsm.","archived":false,"fork":false,"pushed_at":"2020-11-10T23:13:19.000Z","size":448,"stargazers_count":257,"open_issues_count":11,"forks_count":87,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-07-13T18:12:01.480Z","etag":null,"topics":["excel","flask-extensions"],"latest_commit_sha":null,"homepage":"http://flask.pyexcel.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyexcel-webwares.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"chfw","patreon":"chfw"}},"created_at":"2015-01-21T19:55:07.000Z","updated_at":"2024-05-13T05:37:32.000Z","dependencies_parsed_at":"2022-08-10T09:02:28.923Z","dependency_job_id":null,"html_url":"https://github.com/pyexcel-webwares/Flask-Excel","commit_stats":null,"previous_names":["pyexcel/flask-excel"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyexcel-webwares%2FFlask-Excel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyexcel-webwares%2FFlask-Excel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyexcel-webwares%2FFlask-Excel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyexcel-webwares%2FFlask-Excel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyexcel-webwares","download_url":"https://codeload.github.com/pyexcel-webwares/Flask-Excel/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":213870459,"owners_count":15650178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["excel","flask-extensions"],"created_at":"2024-08-04T01:01:08.033Z","updated_at":"2024-08-04T01:05:45.873Z","avatar_url":"https://github.com/pyexcel-webwares.png","language":"Python","funding_links":["https://github.com/sponsors/chfw","https://patreon.com/chfw","https://www.patreon.com/chfw","https://www.patreon.com/bePatron?u=5537627","https://www.patreon.com/pyexcel/posts"],"categories":["Third-Party Extensions","Python"],"sub_categories":["Databases"],"readme":"================================================================================\nFlask-Excel - Let you focus on data, instead of file formats\n================================================================================\n\n.. image:: https://raw.githubusercontent.com/pyexcel/pyexcel.github.io/master/images/patreon.png\n   :target: https://www.patreon.com/chfw\n\n.. image:: https://raw.githubusercontent.com/pyexcel/pyexcel-mobans/master/images/awesome-badge.svg\n   :target: https://awesome-python.com/#specific-formats-processing\n\n.. image:: https://travis-ci.org/pyexcel-webwares/Flask-Excel.svg?branch=master\n   :target: http://travis-ci.org/pyexcel-webwares/Flask-Excel\n\n.. image:: https://codecov.io/gh/pyexcel-webwares/Flask-Excel/branch/master/graph/badge.svg\n   :target: https://codecov.io/gh/pyexcel-webwares/Flask-Excel\n\n.. image:: https://badge.fury.io/py/Flask-Excel.svg\n   :target: https://pypi.org/project/Flask-Excel\n\n\n.. image:: https://pepy.tech/badge/Flask-Excel/month\n   :target: https://pepy.tech/project/Flask-Excel\n\n\n.. image:: https://img.shields.io/gitter/room/gitterHQ/gitter.svg\n   :target: https://gitter.im/pyexcel/Lobby\n\n.. image:: https://img.shields.io/static/v1?label=continuous%20templating\u0026message=%E6%A8%A1%E7%89%88%E6%9B%B4%E6%96%B0\u0026color=blue\u0026style=flat-square\n    :target: https://moban.readthedocs.io/en/latest/#at-scale-continous-templating-for-open-source-projects\n\n.. image:: https://img.shields.io/static/v1?label=coding%20style\u0026message=black\u0026color=black\u0026style=flat-square\n    :target: https://github.com/psf/black\n.. image:: https://readthedocs.org/projects/flask-excel/badge/?version=latest\n   :target: http://flask-excel.readthedocs.org/en/latest/\n\nSupport the project\n================================================================================\n\nIf your company has embedded pyexcel and its components into a revenue generating\nproduct, please support me on github, `patreon \u003chttps://www.patreon.com/bePatron?u=5537627\u003e`_\nor `bounty source \u003chttps://salt.bountysource.com/teams/chfw-pyexcel\u003e`_ to maintain\nthe project and develop it further.\n\nIf you are an individual, you are welcome to support me too and for however long\nyou feel like. As my backer, you will receive\n`early access to pyexcel related contents \u003chttps://www.patreon.com/pyexcel/posts\u003e`_.\n\nAnd your issues will get prioritized if you would like to become my patreon as `pyexcel pro user`.\n\nWith your financial support, I will be able to invest\na little bit more time in coding, documentation and writing interesting posts.\n\n\nKnown constraints\n==================\n\nFonts, colors and charts are not supported.\n\nNor to read password protected xls, xlsx and ods files.\n\nIntroduction\n================================================================================\nHere is a typical conversation between the developer and the user::\n\n User: \"I have uploaded an excel file\"\n       \"but your application says un-supported file format\"\n Developer: \"Did you upload an xlsx file or a csv file?\"\n User: \"Well, I am not sure. I saved the data using \"\n       \"Microsoft Excel. Surely, it must be in an excel format.\"\n Developer: \"OK. Here is the thing. I were not told to support\"\n            \"all available excel formats in day 1. Live with it\"\n            \"or delay the project x number of days.\"\n\n**Flask-Excel** is based on `pyexcel \u003chttps://github.com/pyexcel/pyexcel\u003e`_ and makes\nit easy to consume/produce information stored in excel files over HTTP protocol as\nwell as on file system. This library can turn the excel data into a list of lists,\na list of records(dictionaries), dictionaries of lists. And vice versa. Hence it\nlets you focus on data in Flask based web development, instead of file formats.\n\nThe idea originated from the common usability problem: when an excel file\ndriven web application is delivered for non-developer users (ie: team assistant,\nhuman resource administrator etc). The fact is that not everyone knows (or cares)\nabout the differences between various excel formats: csv, xls, xlsx are all\nthe same to them. Instead of training those users about file formats, this\nlibrary helps web developers to handle most of the excel file\nformats by providing a common programming interface. To add a specific excel\nfile format type to you application, all you need is to install an extra pyexcel\nplugin. Hence no code changes to your application and no issues with excel file\nformats any more. Looking at the community, this library and its associated ones\ntry to become a small and easy to install alternative to Pandas.\n\n\nThe highlighted features are:\n\n#. excel data import into and export from databases\n#. turn uploaded excel file directly into Python data structure\n#. pass Python data structures as an excel file download\n#. provide data persistence as an excel file in server side\n#. supports csv, tsv, csvz, tsvz by default and other formats are supported via\n   the following plugins:\n\n.. _file-format-list:\n.. _a-map-of-plugins-and-file-formats:\n\n.. table:: A list of file formats supported by external plugins\n\n   ======================== ======================= =================\n   Package name              Supported file formats  Dependencies\n   ======================== ======================= =================\n   `pyexcel-io`_            csv, csvz [#f1]_, tsv,\n                            tsvz [#f2]_\n   `pyexcel-xls`_           xls, xlsx(read only),   `xlrd`_,\n                            xlsm(read only)         `xlwt`_\n   `pyexcel-xlsx`_          xlsx                    `openpyxl`_\n   `pyexcel-ods3`_          ods                     `pyexcel-ezodf`_,\n                                                    lxml\n   `pyexcel-ods`_           ods                     `odfpy`_\n   ======================== ======================= =================\n\n.. table:: Dedicated file reader and writers\n\n   ======================== ======================= =================\n   Package name              Supported file formats  Dependencies\n   ======================== ======================= =================\n   `pyexcel-xlsxw`_         xlsx(write only)        `XlsxWriter`_\n   `pyexcel-libxlsxw`_      xlsx(write only)        `libxlsxwriter`_\n   `pyexcel-xlsxr`_         xlsx(read only)         lxml\n   `pyexcel-xlsbr`_         xlsb(read only)         pyxlsb\n   `pyexcel-odsr`_          read only for ods, fods lxml\n   `pyexcel-odsw`_          write only for ods      loxun\n   `pyexcel-htmlr`_         html(read only)         lxml,html5lib\n   `pyexcel-pdfr`_          pdf(read only)          camelot\n   ======================== ======================= =================\n\n\nPlugin shopping guide\n------------------------\n\nSince 2020, all pyexcel-io plugins have dropped the support for python version\nlower than 3.6. If you want to use any python verions, please use pyexcel-io\nand its plugins version lower than 0.6.0.\n\n\nExcept csv files, xls, xlsx and ods files are a zip of a folder containing a lot of\nxml files\n\nThe dedicated readers for excel files can stream read\n\n\nIn order to manage the list of plugins installed, you need to use pip to add or remove\na plugin. When you use virtualenv, you can have different plugins per virtual\nenvironment. In the situation where you have multiple plugins that does the same thing\nin your environment, you need to tell pyexcel which plugin to use per function call.\nFor example, pyexcel-ods and pyexcel-odsr, and you want to get_array to use pyexcel-odsr.\nYou need to append get_array(..., library='pyexcel-odsr').\n\n\n\n.. _pyexcel-io: https://github.com/pyexcel/pyexcel-io\n.. _pyexcel-xls: https://github.com/pyexcel/pyexcel-xls\n.. _pyexcel-xlsx: https://github.com/pyexcel/pyexcel-xlsx\n.. _pyexcel-ods: https://github.com/pyexcel/pyexcel-ods\n.. _pyexcel-ods3: https://github.com/pyexcel/pyexcel-ods3\n.. _pyexcel-odsr: https://github.com/pyexcel/pyexcel-odsr\n.. _pyexcel-odsw: https://github.com/pyexcel/pyexcel-odsw\n.. _pyexcel-pdfr: https://github.com/pyexcel/pyexcel-pdfr\n\n.. _pyexcel-xlsxw: https://github.com/pyexcel/pyexcel-xlsxw\n.. _pyexcel-libxlsxw: https://github.com/pyexcel/pyexcel-libxlsxw\n.. _pyexcel-xlsxr: https://github.com/pyexcel/pyexcel-xlsxr\n.. _pyexcel-xlsbr: https://github.com/pyexcel/pyexcel-xlsbr\n.. _pyexcel-htmlr: https://github.com/pyexcel/pyexcel-htmlr\n\n.. _xlrd: https://github.com/python-excel/xlrd\n.. _xlwt: https://github.com/python-excel/xlwt\n.. _openpyxl: https://bitbucket.org/openpyxl/openpyxl\n.. _XlsxWriter: https://github.com/jmcnamara/XlsxWriter\n.. _pyexcel-ezodf: https://github.com/pyexcel/pyexcel-ezodf\n.. _odfpy: https://github.com/eea/odfpy\n.. _libxlsxwriter: http://libxlsxwriter.github.io/getting_started.html\n\n.. table:: Other data renderers\n\n   ======================== ======================= ================= ==================\n   Package name              Supported file formats  Dependencies     Python versions\n   ======================== ======================= ================= ==================\n   `pyexcel-text`_          write only:rst,         `tabulate`_       2.6, 2.7, 3.3, 3.4\n                            mediawiki, html,                          3.5, 3.6, pypy\n                            latex, grid, pipe,\n                            orgtbl, plain simple\n                            read only: ndjson\n                            r/w: json\n   `pyexcel-handsontable`_  handsontable in html    `handsontable`_   same as above\n   `pyexcel-pygal`_         svg chart               `pygal`_          2.7, 3.3, 3.4, 3.5\n                                                                      3.6, pypy\n   `pyexcel-sortable`_      sortable table in html  `csvtotable`_     same as above\n   `pyexcel-gantt`_         gantt chart in html     `frappe-gantt`_   except pypy, same\n                                                                      as above\n   ======================== ======================= ================= ==================\n\n.. _pyexcel-text: https://github.com/pyexcel/pyexcel-text\n.. _tabulate: https://bitbucket.org/astanin/python-tabulate\n.. _pyexcel-handsontable: https://github.com/pyexcel/pyexcel-handsontable\n.. _handsontable: https://cdnjs.com/libraries/handsontable\n.. _pyexcel-pygal: https://github.com/pyexcel/pyexcel-chart\n.. _pygal: https://github.com/Kozea/pygal\n.. _pyexcel-matplotlib: https://github.com/pyexcel/pyexcel-matplotlib\n.. _matplotlib: https://matplotlib.org\n.. _pyexcel-sortable: https://github.com/pyexcel/pyexcel-sortable\n.. _csvtotable: https://github.com/vividvilla/csvtotable\n.. _pyexcel-gantt: https://github.com/pyexcel/pyexcel-gantt\n.. _frappe-gantt: https://github.com/frappe/gantt\n\n.. rubric:: Footnotes\n\n.. [#f1] zipped csv file\n.. [#f2] zipped tsv file\n\n\nThis library makes information processing involving various excel files as easy as\nprocessing array, dictionary when processing file upload/download, data import into\nand export from SQL databases, information analysis and persistence. It uses\n**pyexcel** and its plugins:\n\n#. to provide one uniform programming interface to handle csv, tsv, xls, xlsx, xlsm and ods formats.\n#. to provide one-stop utility to import the data in uploaded file into a database and to export tables in a database as excel files for file download.\n#. to provide the same interface for information persistence at server side: saving a uploaded excel file to and loading a saved excel file from file system.\n\n\n\nTested Flask Versions\n========================\n\nSince 2020 Auguest, latest pyexcel-io version 0.6.0 forced Flask-Excel to use\nPython 3.6+\n\n.. image:: https://img.shields.io/badge/Flask-1.1.2-green.svg\n    :target: http://travis-ci.org/pyexcel/Flask-Excel\n\n.. image:: https://img.shields.io/badge/Flask-1.0.4-green.svg\n    :target: http://travis-ci.org/pyexcel/Flask-Excel\n\nFor older Flask versions and lower Python version, please use\npyexcel-io\u003c=0.5.20.\n\n\nInstallation\n================================================================================\n\nYou can install Flask-Excel via pip:\n\n.. code-block:: bash\n\n    $ pip install Flask-Excel\n\n\nor clone it and install it:\n\n.. code-block:: bash\n\n    $ git clone https://github.com/pyexcel-webwares/Flask-Excel.git\n    $ cd Flask-Excel\n    $ python setup.py install\n\n\n\nUsage\n================================================================================\n\nHere are some example codes:\n\n.. code-block:: python\n\n    from flask import Flask, request, jsonify\n    import flask_excel\n\n    app=Flask(__name__)\n    flask_excel.init_excel(app)\n\n    @app.route(\"/upload\", methods=['GET', 'POST'])\n    def upload_file():\n        if request.method == 'POST':\n            return jsonify({\"result\": request.get_array(field_name='file')})\n        return '''\n        \u003c!doctype html\u003e\n        \u003ctitle\u003eUpload an excel file\u003c/title\u003e\n        \u003ch1\u003eExcel file upload (csv, tsv, csvz, tsvz only)\u003c/h1\u003e\n        \u003cform action=\"\" method=post enctype=multipart/form-data\u003e\n        \u003cp\u003e\u003cinput type=file name=file\u003e\u003cinput type=submit value=Upload\u003e\n       \u003c/form\u003e\n        '''\n\n    @app.route(\"/export\", methods=['GET'])\n    def export_records():\n        return excel.make_response_from_array([[1,2], [3, 4]], \"csv\",\n                                              file_name=\"export_data\")\n\n    if __name__ == \"__main__\":\n        app.run()\n\n\nDevelopment guide\n================================================================================\n\nDevelopment steps for code changes\n\n#. git clone https://github.com/pyexcel/Flask-Excel.git\n#. cd Flask-Excel\n\nUpgrade your setup tools and pip. They are needed for development and testing only:\n\n#. pip install --upgrade setuptools pip\n\nThen install relevant development requirements:\n\n#. pip install -r rnd_requirements.txt # if such a file exists\n#. pip install -r requirements.txt\n#. pip install -r tests/requirements.txt\n\nOnce you have finished your changes, please provide test case(s), relevant documentation\nand update CHANGELOG.rst.\n\n.. note::\n\n    As to rnd_requirements.txt, usually, it is created when a dependent\n    library is not released. Once the dependecy is installed\n    (will be released), the future\n    version of the dependency in the requirements.txt will be valid.\n\n\nHow to test your contribution\n------------------------------\n\nAlthough `nose` and `doctest` are both used in code testing, it is adviable that unit tests are put in tests. `doctest` is incorporated only to make sure the code examples in documentation remain valid across different development releases.\n\nOn Linux/Unix systems, please launch your tests like this::\n\n    $ make\n\nOn Windows systems, please issue this command::\n\n    \u003e test.bat\n\n\nBefore you commit\n------------------------------\n\nPlease run::\n\n    $ make format\n\nso as to beautify your code otherwise travis-ci may fail your unit test.\n\n\n\n\nLicense\n================================================================================\n\nNew BSD License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyexcel-webwares%2FFlask-Excel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyexcel-webwares%2FFlask-Excel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyexcel-webwares%2FFlask-Excel/lists"}