Skip to main content

Python SDK used to interact with the Fusion Platform(r)

Project description

Fusion Platform® Python SDK

This package contains the Python SDK used to interact with the Fusion Platform®. The Fusion Platform® provides enhanced remote monitoring services. By ingesting remotely sensed Earth Observation (EO) data, and data from other sources, the platform uses and fuses this data to execute algorithms which provide actionable knowledge to customers.

The Python SDK is designed to enable interaction with the Fusion Platform® via its API. As such, the SDK therefore allows software to login, upload files, create and execute processes, monitor their execution and then download the corresponding results. Additional functionality is available directly via the API, and this is defined within the corresponding OpenAPI 3.0 specification, which can be obtained via a support request.

© Digital Content Analysis Technology Ltd

Installation

The SDK has been built for Python 3, and is tested against Python 3.7, 3.8, 3.9 and 3.10. To install the SDK into a suitable Python environment containing pip, execute the following:

pip install fusion-platform-python-sdk

This will install the SDK and all its dependencies.

To update an existing installation to the latest version, execute the following:

pip install fusion-platform-python-sdk --upgrade

Example

The following shows a simple example of how to use the SDK to create a process, execute it and download the resulting data. This example assumes that a suitable user account has been created with an organisation which has sufficient credits to run the process, and that the SDK has been installed as above. To use a different user account, replace the email address me@org.com and password MyPassword123!.

The example uses a pre-defined region of interest for Glasgow, and then obtains spectral indices for the region. A range of spectral indices are built using ESA's Sentinel-2 multi-spectral data from the most recent date available for Glasgow.

import os
import fusion_platform

# Login with email address and password.
user = fusion_platform.login(email='me@org.com', password='MyPassword123!')

# Select the organisation which will own the file. This is
# the first organisation the user belongs to in this example,
# and which is therefore assumed to have sufficient credits.
organisation = next(user.organisations)

# Create a data item for the Glasgow region of interest:
glasgow = organisation.create_data(name='Glasgow', file_type=fusion_platform.FILE_TYPE_GEOJSON, files=[fusion_platform.EXAMPLE_GLASGOW_FILE], wait=True)

# Find the elevation service using its name.
service, _ = organisation.find_services(keyword='Elevation')

# Create a template process from the service.
process = organisation.new_process(name='Example', service=service)

# Configure the process to use Glasgow as the region of interest.
process.update(input_number=1, data=glasgow)

# Create the process, which will validate its options and inputs.
process.create()

# Before execution, review the price in credits.
print(f"Price: {process.price}")

# Now execute the process and wait for it to complete.
process.execute(wait=True)

# Get the corresponding execution of the process. This is assumed
# to be the most recently started execution.
execution = next(process.executions)

# Now download all the outputs.
for component in execution.components:
    print(f"Downloading {component.name}")
    component_dir = component.name[:60]

    for output in component.outputs:
        dir = os.path.join(component_dir, output.name[:60])

        for file in output.files:
            file.download(path=os.path.join(dir, file.file_name))

# Now tidy everything up by deleting the process and the region.
process.delete()
glasgow.delete()

Documentation

Details of the methods and attributes available from objects used within the SDK can be found https://www.d-cat.co.uk/public/fusion_platform_python_sdk/.

Full documentation can be found in fusion_platform_sdk.pdf.

Support

Support for the SDK can be obtained by contacting Digital Content Analysis Technology Ltd via support@d-cat.co.uk.

License

See LICENSE.txt.

Project details


Download files

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

Source Distribution

fusion-platform-python-sdk-1.0.9.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fusion_platform_python_sdk-1.0.9-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file fusion-platform-python-sdk-1.0.9.tar.gz.

File metadata

  • Download URL: fusion-platform-python-sdk-1.0.9.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1

File hashes

Hashes for fusion-platform-python-sdk-1.0.9.tar.gz
Algorithm Hash digest
SHA256 755be73091bf0953fad3d24fc34e5395b504dade330720c1e26abb28edbe3154
MD5 59e77b0ee31efa58089382d3ea78eee7
BLAKE2b-256 94c5ec5b9a9e4f29469c6ca0eaf9eb2fcdc9044dca0dff5bae956ad733d9dd46

See more details on using hashes here.

File details

Details for the file fusion_platform_python_sdk-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: fusion_platform_python_sdk-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.1

File hashes

Hashes for fusion_platform_python_sdk-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 d606f0a68855249e50bb0d6e3d67f9eb6e034633f5f612877dadc14774769e44
MD5 7be8da809b639ee3b3c8a9ab3b95a8cd
BLAKE2b-256 062f2a0d62b6b24a050eee825a721a32eefd213d4c46e03c8b5aa11fec1fcfb3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page