{ "info": { "author": "Yuri", "author_email": "yuri@yuri-x.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Office/Business", "Topic :: Software Development :: Libraries", "Topic :: Utilities" ], "description": "================================================================================\r\npyexcel-yuri - Let you focus on data, instead of xlsx format\r\n================================================================================\r\n\r\n**pyexcel-yuri** is a tiny wrapper library to read, manipulate and write data in xlsx and xlsm format using `read_only` mode reader, `write_only` mode writer from Xlsxwriter. You are likely to use it with `pyexcel `__.\r\n\r\nPlease note:\r\n\r\n1. `auto_detect_int` flag will not take effect because openpyxl detect integer in python 3 by default.\r\n2. `skip_hidden_row_and_column` will get a penalty where `read_only` mode cannot be used.\r\n\r\n\r\n\r\nKnown constraints\r\n==================\r\n\r\nFonts, colors and charts are not supported.\r\n\r\nInstallation\r\n================================================================================\r\n\r\n\r\nYou can install pyexcel-yuri via pip:\r\n\r\n.. code-block:: bash\r\n\r\n $ pip install pyexcel-yuri\r\n\r\n\r\nor clone it and install it:\r\n\r\n.. code-block:: bash\r\n\r\n $ git clone https://github.com/Yuri-x/pyexcel-yuri.git\r\n $ cd pyexcel-yuri\r\n $ python setup.py install\r\n\r\n\r\nUsage\r\n================================================================================\r\n\r\nAs a standalone library\r\n--------------------------------------------------------------------------------\r\n\r\nWrite to an xlsx file\r\n********************************************************************************\r\n\r\n\r\n\r\nHere's the sample code to write a dictionary to an xlsx file:\r\n\r\n.. code-block:: python\r\n\r\n >>> from pyexcel_xlsxy import save_data\r\n >>> data = OrderedDict() # from collections import OrderedDict\r\n >>> data.update({\"Sheet 1\": [[1, 2, 3], [4, 5, 6]]})\r\n >>> data.update({\"Sheet 2\": [[\"row 1\", \"row 2\", \"row 3\"]]})\r\n >>> save_data(\"your_file.xlsx\", data)\r\n\r\n\r\nRead from an xlsx file\r\n********************************************************************************\r\n\r\nHere's the sample code:\r\n\r\n.. code-block:: python\r\n\r\n >>> from pyexcel_xlsxy import get_data\r\n >>> data = get_data(\"your_file.xlsx\")\r\n >>> import json\r\n >>> print(json.dumps(data))\r\n {\"Sheet 1\": [[1, 2, 3], [4, 5, 6]], \"Sheet 2\": [[\"row 1\", \"row 2\", \"row 3\"]]}\r\n\r\n\r\nWrite an xlsx to memory\r\n********************************************************************************\r\n\r\nHere's the sample code to write a dictionary to an xlsx file:\r\n\r\n.. code-block:: python\r\n\r\n >>> from pyexcel_xlsxy import save_data\r\n >>> data = OrderedDict()\r\n >>> data.update({\"Sheet 1\": [[1, 2, 3], [4, 5, 6]]})\r\n >>> data.update({\"Sheet 2\": [[7, 8, 9], [10, 11, 12]]})\r\n >>> io = StringIO()\r\n >>> save_data(io, data)\r\n >>> # do something with the io\r\n >>> # In reality, you might give it to your http response\r\n >>> # object for downloading\r\n\r\n\r\n\r\n\r\nRead from an xlsx from memory\r\n********************************************************************************\r\n\r\nContinue from previous example:\r\n\r\n.. code-block:: python\r\n\r\n >>> # This is just an illustration\r\n >>> # In reality, you might deal with xlsx file upload\r\n >>> # where you will read from requests.FILES['YOUR_XLSX_FILE']\r\n >>> data = get_data(io)\r\n >>> print(json.dumps(data))\r\n {\"Sheet 1\": [[1, 2, 3], [4, 5, 6]], \"Sheet 2\": [[7, 8, 9], [10, 11, 12]]}\r\n\r\n\r\nPagination feature\r\n********************************************************************************\r\n\r\n\r\n\r\nLet's assume the following file is a huge xlsx file:\r\n\r\n.. code-block:: python\r\n\r\n >>> huge_data = [\r\n ... [1, 21, 31],\r\n ... [2, 22, 32],\r\n ... [3, 23, 33],\r\n ... [4, 24, 34],\r\n ... [5, 25, 35],\r\n ... [6, 26, 36]\r\n ... ]\r\n >>> sheetx = {\r\n ... \"huge\": huge_data\r\n ... }\r\n >>> save_data(\"huge_file.xlsx\", sheetx)\r\n\r\nAnd let's pretend to read partial data:\r\n\r\n.. code-block:: python\r\n\r\n >>> partial_data = get_data(\"huge_file.xlsx\", start_row=2, row_limit=3)\r\n >>> print(json.dumps(partial_data))\r\n {\"huge\": [[3, 23, 33], [4, 24, 34], [5, 25, 35]]}\r\n\r\nAnd you could as well do the same for columns:\r\n\r\n.. code-block:: python\r\n\r\n >>> partial_data = get_data(\"huge_file.xlsx\", start_column=1, column_limit=2)\r\n >>> print(json.dumps(partial_data))\r\n {\"huge\": [[21, 31], [22, 32], [23, 33], [24, 34], [25, 35], [26, 36]]}\r\n\r\nObvious, you could do both at the same time:\r\n\r\n.. code-block:: python\r\n\r\n >>> partial_data = get_data(\"huge_file.xlsx\",\r\n ... start_row=2, row_limit=3,\r\n ... start_column=1, column_limit=2)\r\n >>> print(json.dumps(partial_data))\r\n {\"huge\": [[23, 33], [24, 34], [25, 35]]}\r\n\r\nAs a pyexcel plugin\r\n--------------------------------------------------------------------------------\r\n\r\nNo longer, explicit import is needed since pyexcel version 0.2.2. Instead,\r\nthis library is auto-loaded. So if you want to read data in xlsx format,\r\ninstalling it is enough.\r\n\r\n\r\nReading from an xlsx file\r\n********************************************************************************\r\n\r\nHere is the sample code:\r\n\r\n.. code-block:: python\r\n\r\n >>> import pyexcel as pe\r\n >>> sheet = pe.get_book(file_name=\"your_file.xlsx\")\r\n >>> sheet\r\n Sheet 1:\r\n +---+---+---+\r\n | 1 | 2 | 3 |\r\n +---+---+---+\r\n | 4 | 5 | 6 |\r\n +---+---+---+\r\n Sheet 2:\r\n +-------+-------+-------+\r\n | row 1 | row 2 | row 3 |\r\n +-------+-------+-------+\r\n\r\n\r\nWriting to an xlsx file\r\n********************************************************************************\r\n\r\nHere is the sample code:\r\n\r\n.. code-block:: python\r\n\r\n >>> sheet.save_as(\"another_file.xlsx\")\r\n\r\n\r\nReading from a IO instance\r\n********************************************************************************\r\n\r\nYou got to wrap the binary content with stream to get xlsx working:\r\n\r\n.. code-block:: python\r\n\r\n >>> # This is just an illustration\r\n >>> # In reality, you might deal with xlsx file upload\r\n >>> # where you will read from requests.FILES['YOUR_XLSX_FILE']\r\n >>> xlsxfile = \"another_file.xlsx\"\r\n >>> with open(xlsxfile, \"rb\") as f:\r\n ... content = f.read()\r\n ... r = pe.get_book(file_type=\"xlsx\", file_content=content)\r\n ... print(r)\r\n ...\r\n Sheet 1:\r\n +---+---+---+\r\n | 1 | 2 | 3 |\r\n +---+---+---+\r\n | 4 | 5 | 6 |\r\n +---+---+---+\r\n Sheet 2:\r\n +-------+-------+-------+\r\n | row 1 | row 2 | row 3 |\r\n +-------+-------+-------+\r\n\r\n\r\nWriting to a StringIO instance\r\n********************************************************************************\r\n\r\nYou need to pass a StringIO instance to Writer:\r\n\r\n.. code-block:: python\r\n\r\n >>> data = [\r\n ... [1, 2, 3],\r\n ... [4, 5, 6]\r\n ... ]\r\n >>> io = StringIO()\r\n >>> sheet = pe.Sheet(data)\r\n >>> io = sheet.save_to_memory(\"xlsx\", io)\r\n >>> # then do something with io\r\n >>> # In reality, you might give it to your http response\r\n >>> # object for downloading\r\n\r\n\r\nLicense\r\n================================================================================\r\n\r\nNew BSD License\r\n\r\nDeveloper guide\r\n==================\r\n\r\nDevelopment steps for code changes\r\n\r\n#. git clone https://github.com/pyexcel/pyexcel-xlsx.git\r\n#. cd pyexcel-xlsx\r\n\r\nUpgrade your setup tools and pip. They are needed for development and testing only:\r\n\r\n#. pip install --upgrade setuptools pip\r\n\r\nThen install relevant development requirements:\r\n\r\n#. pip install -r rnd_requirements.txt # if such a file exists\r\n#. pip install -r requirements.txt\r\n#. pip install -r tests/requirements.txt\r\n\r\nOnce you have finished your changes, please provide test case(s), relevant documentation\r\nand update CHANGELOG.rst.\r\n\r\n.. note::\r\n\r\n As to rnd_requirements.txt, usually, it is created when a dependent\r\n library is not released. Once the dependecy is installed\r\n (will be released), the future\r\n version of the dependency in the requirements.txt will be valid.\r\n\r\n\r\nHow to test your contribution\r\n------------------------------\r\n\r\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.\r\n\r\nOn Linux/Unix systems, please launch your tests like this::\r\n\r\n $ make\r\n\r\nOn Windows systems, please issue this command::\r\n\r\n > test.bat\r\n\r\nHow to update test environment and update documentation\r\n---------------------------------------------------------\r\n\r\nAdditional steps are required:\r\n\r\n#. pip install moban\r\n#. git clone https://github.com/moremoban/setupmobans.git # generic setup\r\n#. git clone https://github.com/pyexcel/pyexcel-commons.git commons\r\n#. make your changes in `.moban.d` directory, then issue command `moban`\r\n\r\nWhat is pyexcel-commons\r\n---------------------------------\r\n\r\nMany information that are shared across pyexcel projects, such as: this developer guide, license info, etc. are stored in `pyexcel-commons` project.\r\n\r\nWhat is .moban.d\r\n---------------------------------\r\n\r\n`.moban.d` stores the specific meta data for the library.\r\n\r\nAcceptance criteria\r\n-------------------\r\n\r\n#. Has Test cases written\r\n#. Has all code lines tested\r\n#. Passes all Travis CI builds\r\n#. Has fair amount of documentation if your change is complex\r\n#. Please update CHANGELOG.rst\r\n#. Please add yourself to CONTRIBUTORS.rst\r\n#. Agree on NEW BSD License for your contribution\r\n\r\n\r\n\nChange log\r\n================================================================================\r\n\r\n0.0.3 - 08.08.2018\r\n--------------------------------------------------------------------------------\r\n\r\nUpdated\r\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n\r\n#. Fix merged cells\r\n\r\n0.0.2 - 07.08.2018\r\n--------------------------------------------------------------------------------\r\n\r\nUpdated\r\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n\r\n#. Fix stream type\r\n\r\n0.0.1 - 06.08.2018\r\n--------------------------------------------------------------------------------\r\n\r\nAdded\r\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n\r\n#. Init Commit\r\n\r\n\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/Yuri-x/pyexcel-yuri/archive/0.0.3.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Yuri-x/pyexcel-yuri", "keywords": "xlsxpython", "license": "New BSD", "maintainer": "", "maintainer_email": "", "name": "pyexcel-yuri", "package_url": "https://pypi.org/project/pyexcel-yuri/", "platform": "", "project_url": "https://pypi.org/project/pyexcel-yuri/", "project_urls": { "Download": "https://github.com/Yuri-x/pyexcel-yuri/archive/0.0.3.tar.gz", "Homepage": "https://github.com/Yuri-x/pyexcel-yuri" }, "release_url": "https://pypi.org/project/pyexcel-yuri/0.0.3/", "requires_dist": null, "requires_python": "", "summary": "A wrapper library to read, manipulate and write data format", "version": "0.0.3" }, "last_serial": 4146882, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "c5b78f20ddc0e08ecb9a385b103188e1", "sha256": "854587364fe2985d399ba5be7a0ff2ccbe2214f361aab5df9637a70cd0bcce76" }, "downloads": -1, "filename": "pyexcel_yuri-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c5b78f20ddc0e08ecb9a385b103188e1", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 6552, "upload_time": "2018-08-07T05:04:11", "url": "https://files.pythonhosted.org/packages/2e/fa/0ee5ab0e739c978146430b45f7f646a084c653ce130f02705a50a2c365ef/pyexcel_yuri-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "946995787d846b39800121f1dbe0a7a9", "sha256": "31910f21e3ed5a2b3327c5c32134bfde45b261b49ac1f4a41551508890c8bca6" }, "downloads": -1, "filename": "pyexcel-yuri-0.0.1.tar.gz", "has_sig": false, "md5_digest": "946995787d846b39800121f1dbe0a7a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12068, "upload_time": "2018-08-07T05:04:08", "url": "https://files.pythonhosted.org/packages/5a/2f/361dcec252615dbd16b81b93315a8531191f852156578a3554d6d6cb9adb/pyexcel-yuri-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "dd2187c28e7d637794ece4986e660fef", "sha256": "bd852103a2b3ab5b26c5e827ca89f2e955cadf7c56ed0e17a6f9c0a1f188a5ad" }, "downloads": -1, "filename": "pyexcel_yuri-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "dd2187c28e7d637794ece4986e660fef", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 6545, "upload_time": "2018-08-07T06:52:18", "url": "https://files.pythonhosted.org/packages/9a/d4/42c6e989f5f46c6399a2c0ac8586570786983e9e6c7804acca4622b797db/pyexcel_yuri-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f2c56059f472628869a24a8e842623a8", "sha256": "32d771f0a2924f77562404dfe82a0fd77e3d665bc83d8ed2350ba89d1c3c84a3" }, "downloads": -1, "filename": "pyexcel-yuri-0.0.2.tar.gz", "has_sig": false, "md5_digest": "f2c56059f472628869a24a8e842623a8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12111, "upload_time": "2018-08-07T06:52:16", "url": "https://files.pythonhosted.org/packages/e5/b9/83e19d4432fc0aa61810bd7ba3afbf9ef3521b2d43a216c9448468b0fc7e/pyexcel-yuri-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "df021c6c26e80f8de701aa4d6614a01a", "sha256": "41aeb74dad44a76e61020c73fc9639e8c06e7bb43966e92ee97cdfde83592007" }, "downloads": -1, "filename": "pyexcel_yuri-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "df021c6c26e80f8de701aa4d6614a01a", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 6542, "upload_time": "2018-08-08T01:54:10", "url": "https://files.pythonhosted.org/packages/53/ea/bde09cecb4c957e8e6c1d5982e7bedd673d9013d7b72497956ba002aa0e4/pyexcel_yuri-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c3579d1062576654f8f267502602a4f", "sha256": "cfdeae6df10a4400c8fd4fc01f3e109cde4bfe389a2cd33275cccb1cae1d0d08" }, "downloads": -1, "filename": "pyexcel-yuri-0.0.3.tar.gz", "has_sig": false, "md5_digest": "8c3579d1062576654f8f267502602a4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12163, "upload_time": "2018-08-08T01:54:08", "url": "https://files.pythonhosted.org/packages/97/8a/8506bec90f6d55979972a21f8ac73c6e02c1a3db706fc189dc44d0429900/pyexcel-yuri-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "df021c6c26e80f8de701aa4d6614a01a", "sha256": "41aeb74dad44a76e61020c73fc9639e8c06e7bb43966e92ee97cdfde83592007" }, "downloads": -1, "filename": "pyexcel_yuri-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "df021c6c26e80f8de701aa4d6614a01a", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 6542, "upload_time": "2018-08-08T01:54:10", "url": "https://files.pythonhosted.org/packages/53/ea/bde09cecb4c957e8e6c1d5982e7bedd673d9013d7b72497956ba002aa0e4/pyexcel_yuri-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c3579d1062576654f8f267502602a4f", "sha256": "cfdeae6df10a4400c8fd4fc01f3e109cde4bfe389a2cd33275cccb1cae1d0d08" }, "downloads": -1, "filename": "pyexcel-yuri-0.0.3.tar.gz", "has_sig": false, "md5_digest": "8c3579d1062576654f8f267502602a4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12163, "upload_time": "2018-08-08T01:54:08", "url": "https://files.pythonhosted.org/packages/97/8a/8506bec90f6d55979972a21f8ac73c6e02c1a3db706fc189dc44d0429900/pyexcel-yuri-0.0.3.tar.gz" } ] }