Skip to main content

Toolbelt to export metadata from the Isogeo REST API into Microsoft Excel workbooks (.xlsx).

Project description

Isogeo - XLSX Exporter

PyPI PyPI - Python Version

Build Status Azure DevOps coverage

Documentation Status Code style: black

Python package to export Isogeo metadata into Excel workshbook using the Python SDK and Openpyxl.

Usage in a nutshell

  1. Install:

    pip install isogeo-export-xl
    
  2. Authenticate

    # import
    from isogeo_pysdk import Isogeo
    # API client
    isogeo = Isogeo(
        auth_mode="group",
        client_id=ISOGEO_API_GROUP_CLIENT_ID,
        client_secret=ISOGEO_API_GROUP_CLIENT_SECRET,
        auto_refresh_url="{}/oauth/token".format(ISOGEO_ID_URL),
        platform=ISOGEO_PLATFORM,
    )
    
    # getting a token
    isogeo.connect()
    
  3. Make a search:

    search = isogeo.search(include="all",)
    # close session
    isogeo.close()
    
  4. Export:

    # import
    from isogeotoxlsx import Isogeo2xlsx
    # instanciate the final workbook
    out_workbook = Isogeo2xlsx(
        lang=isogeo.lang,
        url_base_edit=isogeo.app_url,
        url_base_view=isogeo.oc_url
    )
    # add needed worksheets
    out_workbook.set_worksheets(auto=search.tags.keys())
    
    # parse search results
    for md in map(Metadata.clean_attributes, search.results):
        out_workbook.store_metadatas(md)
    
    # save file
    out_workbook.save("./isogeo_export_to_xlsx.xlsx")
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for isogeo-export-xl, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size isogeo_export_xl-1.1.0-py3-none-any.whl (24.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size isogeo-export-xl-1.1.0.tar.gz (16.2 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page