{"library":"pyexcel-ezodf","title":"pyexcel-ezodf: OpenDocumentFormat files","description":"pyexcel-ezodf is a Python package that serves as a pyexcel plugin, enabling it to read from and write to OpenDocumentFormat (ODF) files, commonly used by LibreOffice or OpenOffice. It provides an easy way to manipulate tabular data within ODS documents through the familiar pyexcel API. The current version is 0.3.4, with releases typically being maintenance updates rather than frequent feature additions.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install pyexcel-ezodf"],"cli":null},"imports":["import pyexcel","from pyexcel_ezodf import get_data, save_data"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pyexcel\nimport os\n\n# Data to write to an ODS file\ndata = [\n    [\"Item\", \"Quantity\", \"Price\"],\n    [\"Apple\", 10, 1.5],\n    [\"Banana\", 5, 0.75],\n    [\"Orange\", 8, 1.2]\n]\n\n# Define a temporary file name\nfile_name = \"example.ods\"\n\ntry:\n    # Save the data to an ODS file\n    pyexcel.save_as(array=data, dest_file_name=file_name)\n    print(f\"'{file_name}' created successfully.\")\n\n    # Read data from the ODS file\n    sheet = pyexcel.get_sheet(file_name=file_name)\n    print(\"\\nRead data from ODS file:\")\n    for row in sheet:\n        print(row)\n\n    # You can also get a dictionary or other formats\n    book_dict = pyexcel.get_book_dict(file_name=file_name)\n    print(\"\\nBook dictionary:\", book_dict)\n\nfinally:\n    # Clean up the created file\n    if os.path.exists(file_name):\n        os.remove(file_name)\n        print(f\"Cleaned up '{file_name}'.\")\n","lang":"python","description":"This quickstart demonstrates how to use `pyexcel-ezodf` as a `pyexcel` plugin to save Python data to an ODS file and then read it back. No explicit import from `pyexcel_ezodf` is needed for `pyexcel` to recognize and handle ODS files; simply installing the plugin is enough.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}