aspose-cells-python


Nameaspose-cells-python JSON
Version 25.7.0 PyPI version JSON
download
home_pagehttps://products.aspose.com/cells/
SummaryAspose.Cells for Python via .NET is a powerful and efficient library for working with Excel files in Python. It supports a wide range of spreadsheet formats including XLS, XLSX, XLSB, ODS, CSV, and HTML, enabling you to programmatically manipulate and convert files with ease. The library also comes with free support.
upload_time2025-07-10 07:44:04
maintainerNone
docs_urlNone
authoraspose-cells
requires_python<3.14,>=3.6
licensehttps://company.aspose.com/legal/eula
keywords excel xls xlsx xlsb csv pdf jpg png html ods numbers xlsm ooxml spreadsheet markdown xps docx pptx mhtml txt json svg emf tiff
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Aspose.Cells for Python via .NET
==================================


`Product Page <https://products.aspose.com/cells/python-net>`_ | `Docs <https://docs.aspose.com/cells/python-net/>`_ | `API Reference <https://reference.aspose.com/cells/python-net/>`_ | `Demos <https://products.aspose.app/cells/family/>`_ | `Blog <https://blog.aspose.com/category/cells/>`_ | `Code Samples <https://github.com/aspose-cells/Aspose.Cells-for-Python-via-.NET>`_ | `Free Support <https://forum.aspose.com/c/cells>`_ | `Temporary License <https://purchase.aspose.com/temporary-license>`_ | `EULA <https://company.aspose.com/legal/eula>`_

Try our `free online apps <https://products.aspose.app/cells/family>`_ demonstrating some of the most popular Aspose.Cells functionality.

Overview
--------

Aspose.Cells for Python via .NET is a powerful spreadsheet management library that allows developers to create, format, and manipulate Excel files programmatically without the need for Microsoft Excel. It supports features like:

- Creating Pivot Tables
- Advanced conditional formatting
- Conversion to PDF, HTML, JSON
- Charts, Smart Markers, OLE objects
- Filtering data

Aspose.Cells API Features
-------------------------

- Spreadsheet generation & manipulation via API
- High-quality file format conversion & rendering
- Print Microsoft Excel® files to physical or virtual printers
- Combine, modify, protect, or parse Excel® sheets
- Apply worksheet formatting and page setup
- Create & customize Excel® charts, Pivot Tables, conditional formatting, slicers, tables & spark-lines
- Convert Excel® charts to images & PDF
- Formula calculation engine supporting basic and advanced Excel functions

Supported Read & Write Formats
------------------------------

- Microsoft Excel®: XLS, XLSX, XLSB, XLSM, XLT, XLTX, XLTM, SpreadsheetML
- OpenOffice: ODS, SXC, FODS
- Text: JSON, TXT, CSV, TSV, Tab-Delimited
- Web: HTML, MHTML
- iWork®: Numbers

Save Excel® Files As
--------------------

- Microsoft Word®: DOCX
- Microsoft PowerPoint®: PPTX
- Microsoft Excel®: XLAM
- Fixed Layout: PDF, XPS
- Text: JSON, TXT, CSV, TSV, Tab-Delimited, XML
- Image: TIFF, PNG, BMP, JPEG, GIF, SVG
- Metafile: EMF
- Markdown: MD

Examples
--------

**Create Excel file from scratch**

.. code-block:: python

    # import the python package
    import aspose.cells
    from aspose.cells import License, Workbook, FileFormatType

    # Instantiating a Workbook object
    workbook = Workbook()
    # Get the first worksheet
    worksheet = workbook.worksheets[0]
    # Get the "A1" cell
    cell = worksheet.cells.get("A1")
    # Write "Hello World" to  "A1" in the first sheet
    cell.put_value("Hello World!")
    # Saving this workbook to XLSX
    workbook.save("HelloWorld.xlsx")

**Convert Excel XLSX file to PDF**

.. code-block:: python

    # import the python package
    import aspose.cells
    from aspose.cells import Workbook

    # Instantiating a Workbook object
    workbook = Workbook("HelloWorld.xlsx")
    # Saving this workbook to PDF
    workbook.save("HelloWorld.pdf")

**Create a chart**

.. code-block:: python

    from aspose.cells import Workbook
    from aspose.cells.charts import ChartType

    # Instantiating a Workbook object
    workbook = Workbook()
    # Adding a new worksheet to the Excel object
    sheetIndex = workbook.worksheets.add()
    # Obtaining the reference of the newly added worksheet by passing its sheet index
    worksheet = workbook.worksheets[sheetIndex]
    # Adding sample values to cells
    worksheet.cells.get("A1").put_value(50)
    worksheet.cells.get("A2").put_value(100)
    worksheet.cells.get("A3").put_value(170)
    worksheet.cells.get("A4").put_value(300)
    worksheet.cells.get("B1").put_value(160)
    worksheet.cells.get("B2").put_value(32)
    worksheet.cells.get("B3").put_value(50)
    worksheet.cells.get("B4").put_value(40)
    # Adding sample values to cells as category data
    worksheet.cells.get("C1").put_value("Q1")
    worksheet.cells.get("C2").put_value("Q2")
    worksheet.cells.get("C3").put_value("Y1")
    worksheet.cells.get("C4").put_value("Y2")
    # Adding a chart to the worksheet
    chartIndex = worksheet.charts.add(ChartType.COLUMN, 5, 0, 15, 5)
    # Accessing the instance of the newly added chart
    chart = worksheet.charts[chartIndex]
    # Adding SeriesCollection (chart data source) to the chart ranging from "A1" cell to "B4"
    chart.n_series.add("A1:B4", True)
    # Setting the data source for the category data of SeriesCollection
    chart.n_series.category_data = "C1:C4"
    # Saving the Excel file
    workbook.save("Chart.xlsx")

**Convert Excel workbook to JSON**

.. code-block:: python

    from aspose.cells import Workbook

    # Instantiating a Workbook object
    workbook = Workbook()
    # Obtaining the reference of the newly added worksheet
    sheet = workbook.worksheets[0]
    cells = sheet.cells
    # Setting the value to the cells
    cells.get("A1").put_value("First name")
    cells.get("A2").put_value("Simon")
    cells.get("A3").put_value("Kevin")
    cells.get("A4").put_value("Leo")
    cells.get("A5").put_value("Johnson")

    cells.get("B1").put_value("Age")
    cells.get("B2").put_value(32)
    cells.get("B3").put_value(33)
    cells.get("B4").put_value(34)
    cells.get("B5").put_value(35)

    cells.get("C1").put_value("Value")
    cells.get("C2").put_value(123.546)
    cells.get("C3").put_value(56.78)
    cells.get("C4").put_value(34)
    cells.get("C5").put_value(9)
    # Saving the Excel file to json
    workbook.save("Out.json")

**Convert Excel to Pandas DataFrame**

.. code-block:: python

    import pandas as pd
    from aspose.cells import Workbook

    # Create a new Aspose.Cells Workbook
    workbook = Workbook()
    # Get the first worksheet
    worksheet = workbook.worksheets[0]
    # Get the cells
    cells = worksheet.cells
    # Add header and data values to specific cells
    cells.get("A1").value = "Name"
    cells.get("B1").value = "Age"
    cells.get("C1").value = "City"
    cells.get("A2").value = "Alice"
    cells.get("B2").value = 25
    cells.get("C2").value = "New York"
    cells.get("A3").value = "Bob"
    cells.get("B3").value = 30
    cells.get("C3").value = "San Francisco"
    cells.get("A4").value = "Charlie"
    cells.get("B4").value = 35
    cells.get("C4").value = "Los Angeles"

    rowCount = cells.max_data_row
    columnCount = cells.max_data_column

    # Read the header row (row 0) and store column names
    columnDatas = []
    for c in range(columnCount + 1):
        columnDatas.append(cells.get_cell(0, c).value)

    # Create an empty pandas DataFrame with column names from Excel
    result = pd.DataFrame(columns=columnDatas, dtype=object)

    # Read each data row (from row 1 onward) and add to the DataFrame
    for i in range(1, rowCount + 1):
        rowarray = [cells.get_cell(i, j).value for j in range(columnCount + 1)]
        result.loc[i - 1] = rowarray
	
    print(result)

**Combine two workbooks into one**

.. code-block:: python

	from aspose.cells import Workbook

	# Load the first Workbook
	SourceBook1 = Workbook("first.xlsx")
	# Load the second Workbook
	SourceBook2 = Workbook("second.xlsx")
	# Combine the second workbook into the first workbook
	SourceBook1.combine(SourceBook2)
	# Save the combined workbook to a new file
	SourceBook1.save("combined.xlsx")
	
`Product Page <https://products.aspose.com/cells/python-net>`_ | `Docs <https://docs.aspose.com/cells/python-net/>`_ | `API Reference <https://reference.aspose.com/cells/python-net/>`_ | `Demos <https://products.aspose.app/cells/family/>`_ | `Blog <https://blog.aspose.com/category/cells/>`_ | `Free Support <https://forum.aspose.com/c/cells>`_ | `Temporary License <https://purchase.aspose.com/temporary-license>`_ | `EULA <https://company.aspose.com/legal/eula>`_



            

Raw data

            {
    "_id": null,
    "home_page": "https://products.aspose.com/cells/",
    "name": "aspose-cells-python",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.14,>=3.6",
    "maintainer_email": null,
    "keywords": "Excel, XLS, XLSX, XLSB, CSV, PDF, JPG, PNG, HTML, ODS, Numbers, XLSM, OOXML, Spreadsheet, Markdown, XPS, DOCX, PPTX, MHTML, TXT, JSON, SVG, EMF, TIFF",
    "author": "aspose-cells",
    "author_email": null,
    "download_url": null,
    "platform": "win32",
    "description": "Aspose.Cells for Python via .NET\n==================================\n\n\n`Product Page <https://products.aspose.com/cells/python-net>`_ | `Docs <https://docs.aspose.com/cells/python-net/>`_ | `API Reference <https://reference.aspose.com/cells/python-net/>`_ | `Demos <https://products.aspose.app/cells/family/>`_ | `Blog <https://blog.aspose.com/category/cells/>`_ | `Code Samples <https://github.com/aspose-cells/Aspose.Cells-for-Python-via-.NET>`_ | `Free Support <https://forum.aspose.com/c/cells>`_ | `Temporary License <https://purchase.aspose.com/temporary-license>`_ | `EULA <https://company.aspose.com/legal/eula>`_\n\nTry our `free online apps <https://products.aspose.app/cells/family>`_ demonstrating some of the most popular Aspose.Cells functionality.\n\nOverview\n--------\n\nAspose.Cells for Python via .NET is a powerful spreadsheet management library that allows developers to create, format, and manipulate Excel files programmatically without the need for Microsoft Excel. It supports features like:\n\n- Creating Pivot Tables\n- Advanced conditional formatting\n- Conversion to PDF, HTML, JSON\n- Charts, Smart Markers, OLE objects\n- Filtering data\n\nAspose.Cells API Features\n-------------------------\n\n- Spreadsheet generation & manipulation via API\n- High-quality file format conversion & rendering\n- Print Microsoft Excel\u00ae files to physical or virtual printers\n- Combine, modify, protect, or parse Excel\u00ae sheets\n- Apply worksheet formatting and page setup\n- Create & customize Excel\u00ae charts, Pivot Tables, conditional formatting, slicers, tables & spark-lines\n- Convert Excel\u00ae charts to images & PDF\n- Formula calculation engine supporting basic and advanced Excel functions\n\nSupported Read & Write Formats\n------------------------------\n\n- Microsoft Excel\u00ae: XLS, XLSX, XLSB, XLSM, XLT, XLTX, XLTM, SpreadsheetML\n- OpenOffice: ODS, SXC, FODS\n- Text: JSON, TXT, CSV, TSV, Tab-Delimited\n- Web: HTML, MHTML\n- iWork\u00ae: Numbers\n\nSave Excel\u00ae Files As\n--------------------\n\n- Microsoft Word\u00ae: DOCX\n- Microsoft PowerPoint\u00ae: PPTX\n- Microsoft Excel\u00ae: XLAM\n- Fixed Layout: PDF, XPS\n- Text: JSON, TXT, CSV, TSV, Tab-Delimited, XML\n- Image: TIFF, PNG, BMP, JPEG, GIF, SVG\n- Metafile: EMF\n- Markdown: MD\n\nExamples\n--------\n\n**Create Excel file from scratch**\n\n.. code-block:: python\n\n    # import the python package\n    import aspose.cells\n    from aspose.cells import License, Workbook, FileFormatType\n\n    # Instantiating a Workbook object\n    workbook = Workbook()\n    # Get the first worksheet\n    worksheet = workbook.worksheets[0]\n    # Get the \"A1\" cell\n    cell = worksheet.cells.get(\"A1\")\n    # Write \"Hello World\" to  \"A1\" in the first sheet\n    cell.put_value(\"Hello World!\")\n    # Saving this workbook to XLSX\n    workbook.save(\"HelloWorld.xlsx\")\n\n**Convert Excel XLSX file to PDF**\n\n.. code-block:: python\n\n    # import the python package\n    import aspose.cells\n    from aspose.cells import Workbook\n\n    # Instantiating a Workbook object\n    workbook = Workbook(\"HelloWorld.xlsx\")\n    # Saving this workbook to PDF\n    workbook.save(\"HelloWorld.pdf\")\n\n**Create a chart**\n\n.. code-block:: python\n\n    from aspose.cells import Workbook\n    from aspose.cells.charts import ChartType\n\n    # Instantiating a Workbook object\n    workbook = Workbook()\n    # Adding a new worksheet to the Excel object\n    sheetIndex = workbook.worksheets.add()\n    # Obtaining the reference of the newly added worksheet by passing its sheet index\n    worksheet = workbook.worksheets[sheetIndex]\n    # Adding sample values to cells\n    worksheet.cells.get(\"A1\").put_value(50)\n    worksheet.cells.get(\"A2\").put_value(100)\n    worksheet.cells.get(\"A3\").put_value(170)\n    worksheet.cells.get(\"A4\").put_value(300)\n    worksheet.cells.get(\"B1\").put_value(160)\n    worksheet.cells.get(\"B2\").put_value(32)\n    worksheet.cells.get(\"B3\").put_value(50)\n    worksheet.cells.get(\"B4\").put_value(40)\n    # Adding sample values to cells as category data\n    worksheet.cells.get(\"C1\").put_value(\"Q1\")\n    worksheet.cells.get(\"C2\").put_value(\"Q2\")\n    worksheet.cells.get(\"C3\").put_value(\"Y1\")\n    worksheet.cells.get(\"C4\").put_value(\"Y2\")\n    # Adding a chart to the worksheet\n    chartIndex = worksheet.charts.add(ChartType.COLUMN, 5, 0, 15, 5)\n    # Accessing the instance of the newly added chart\n    chart = worksheet.charts[chartIndex]\n    # Adding SeriesCollection (chart data source) to the chart ranging from \"A1\" cell to \"B4\"\n    chart.n_series.add(\"A1:B4\", True)\n    # Setting the data source for the category data of SeriesCollection\n    chart.n_series.category_data = \"C1:C4\"\n    # Saving the Excel file\n    workbook.save(\"Chart.xlsx\")\n\n**Convert Excel workbook to JSON**\n\n.. code-block:: python\n\n    from aspose.cells import Workbook\n\n    # Instantiating a Workbook object\n    workbook = Workbook()\n    # Obtaining the reference of the newly added worksheet\n    sheet = workbook.worksheets[0]\n    cells = sheet.cells\n    # Setting the value to the cells\n    cells.get(\"A1\").put_value(\"First name\")\n    cells.get(\"A2\").put_value(\"Simon\")\n    cells.get(\"A3\").put_value(\"Kevin\")\n    cells.get(\"A4\").put_value(\"Leo\")\n    cells.get(\"A5\").put_value(\"Johnson\")\n\n    cells.get(\"B1\").put_value(\"Age\")\n    cells.get(\"B2\").put_value(32)\n    cells.get(\"B3\").put_value(33)\n    cells.get(\"B4\").put_value(34)\n    cells.get(\"B5\").put_value(35)\n\n    cells.get(\"C1\").put_value(\"Value\")\n    cells.get(\"C2\").put_value(123.546)\n    cells.get(\"C3\").put_value(56.78)\n    cells.get(\"C4\").put_value(34)\n    cells.get(\"C5\").put_value(9)\n    # Saving the Excel file to json\n    workbook.save(\"Out.json\")\n\n**Convert Excel to Pandas DataFrame**\n\n.. code-block:: python\n\n    import pandas as pd\n    from aspose.cells import Workbook\n\n    # Create a new Aspose.Cells Workbook\n    workbook = Workbook()\n    # Get the first worksheet\n    worksheet = workbook.worksheets[0]\n    # Get the cells\n    cells = worksheet.cells\n    # Add header and data values to specific cells\n    cells.get(\"A1\").value = \"Name\"\n    cells.get(\"B1\").value = \"Age\"\n    cells.get(\"C1\").value = \"City\"\n    cells.get(\"A2\").value = \"Alice\"\n    cells.get(\"B2\").value = 25\n    cells.get(\"C2\").value = \"New York\"\n    cells.get(\"A3\").value = \"Bob\"\n    cells.get(\"B3\").value = 30\n    cells.get(\"C3\").value = \"San Francisco\"\n    cells.get(\"A4\").value = \"Charlie\"\n    cells.get(\"B4\").value = 35\n    cells.get(\"C4\").value = \"Los Angeles\"\n\n    rowCount = cells.max_data_row\n    columnCount = cells.max_data_column\n\n    # Read the header row (row 0) and store column names\n    columnDatas = []\n    for c in range(columnCount + 1):\n        columnDatas.append(cells.get_cell(0, c).value)\n\n    # Create an empty pandas DataFrame with column names from Excel\n    result = pd.DataFrame(columns=columnDatas, dtype=object)\n\n    # Read each data row (from row 1 onward) and add to the DataFrame\n    for i in range(1, rowCount + 1):\n        rowarray = [cells.get_cell(i, j).value for j in range(columnCount + 1)]\n        result.loc[i - 1] = rowarray\n\t\n    print(result)\n\n**Combine two workbooks into one**\n\n.. code-block:: python\n\n\tfrom aspose.cells import Workbook\n\n\t# Load the first Workbook\n\tSourceBook1 = Workbook(\"first.xlsx\")\n\t# Load the second Workbook\n\tSourceBook2 = Workbook(\"second.xlsx\")\n\t# Combine the second workbook into the first workbook\n\tSourceBook1.combine(SourceBook2)\n\t# Save the combined workbook to a new file\n\tSourceBook1.save(\"combined.xlsx\")\n\t\n`Product Page <https://products.aspose.com/cells/python-net>`_ | `Docs <https://docs.aspose.com/cells/python-net/>`_ | `API Reference <https://reference.aspose.com/cells/python-net/>`_ | `Demos <https://products.aspose.app/cells/family/>`_ | `Blog <https://blog.aspose.com/category/cells/>`_ | `Free Support <https://forum.aspose.com/c/cells>`_ | `Temporary License <https://purchase.aspose.com/temporary-license>`_ | `EULA <https://company.aspose.com/legal/eula>`_\n\n\n",
    "bugtrack_url": null,
    "license": "https://company.aspose.com/legal/eula",
    "summary": "Aspose.Cells for Python via .NET is a powerful and efficient library for working with Excel files in Python. It supports a wide range of spreadsheet formats including XLS, XLSX, XLSB, ODS, CSV, and HTML, enabling you to programmatically manipulate and convert files with ease. The library also comes with free support.",
    "version": "25.7.0",
    "project_urls": {
        "Homepage": "https://products.aspose.com/cells/"
    },
    "split_keywords": [
        "excel",
        " xls",
        " xlsx",
        " xlsb",
        " csv",
        " pdf",
        " jpg",
        " png",
        " html",
        " ods",
        " numbers",
        " xlsm",
        " ooxml",
        " spreadsheet",
        " markdown",
        " xps",
        " docx",
        " pptx",
        " mhtml",
        " txt",
        " json",
        " svg",
        " emf",
        " tiff"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "53939078db96a490269148ec9ef612d8def8672295aed733194757014ebd9f52",
                "md5": "ee456d9c63e36b8eb2738f91c4ce7b47",
                "sha256": "3d8cffd9df20c9c365ca3122864e4b2271e1383d6ed90e1f19b08bbe5d956d1b"
            },
            "downloads": -1,
            "filename": "aspose_cells_python-25.7.0-py3-none-macosx_11_0_arm64.whl",
            "has_sig": false,
            "md5_digest": "ee456d9c63e36b8eb2738f91c4ce7b47",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.14,>=3.6",
            "size": 70192270,
            "upload_time": "2025-07-10T07:44:04",
            "upload_time_iso_8601": "2025-07-10T07:44:04.189995Z",
            "url": "https://files.pythonhosted.org/packages/53/93/9078db96a490269148ec9ef612d8def8672295aed733194757014ebd9f52/aspose_cells_python-25.7.0-py3-none-macosx_11_0_arm64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d17b23da2bcd2b5aa62b2602e882b1efd6693526c0c7bed96563f613aa26b82c",
                "md5": "abde9a1faf9f02f8a68c7d688dbd5096",
                "sha256": "795fc720c2533cec00d39fcfe11c11d36cb5f2ccb4d5094cd9a68187b85d9349"
            },
            "downloads": -1,
            "filename": "aspose_cells_python-25.7.0-py3-none-manylinux1_x86_64.whl",
            "has_sig": false,
            "md5_digest": "abde9a1faf9f02f8a68c7d688dbd5096",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.14,>=3.6",
            "size": 93747169,
            "upload_time": "2025-07-10T07:43:39",
            "upload_time_iso_8601": "2025-07-10T07:43:39.223801Z",
            "url": "https://files.pythonhosted.org/packages/d1/7b/23da2bcd2b5aa62b2602e882b1efd6693526c0c7bed96563f613aa26b82c/aspose_cells_python-25.7.0-py3-none-manylinux1_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "23634e58619c98a6e433812a437dee8ba8029c9d257af41b5242f8815b46b269",
                "md5": "3db3085b76ee6a2eae13f17457527d22",
                "sha256": "0b191ec8784e48a9b6f2dcd3413a1dbb615bc2c1b3969ccd62143da9f867f0c6"
            },
            "downloads": -1,
            "filename": "aspose_cells_python-25.7.0-py3-none-win32.whl",
            "has_sig": false,
            "md5_digest": "3db3085b76ee6a2eae13f17457527d22",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.14,>=3.6",
            "size": 53627176,
            "upload_time": "2025-07-10T07:41:43",
            "upload_time_iso_8601": "2025-07-10T07:41:43.640339Z",
            "url": "https://files.pythonhosted.org/packages/23/63/4e58619c98a6e433812a437dee8ba8029c9d257af41b5242f8815b46b269/aspose_cells_python-25.7.0-py3-none-win32.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-10 07:44:04",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "aspose-cells-python"
}
        
Elapsed time: 1.89791s