Skip to main content

A package to facilitate access to the Arlula Imagery Marketplace API

Project description

Arlula API Python Package

About

This package provides a core interface for interacting with the Arlula API. This package can be found on PyPI. Documentation for this package can be found below, but for extensive documentation see the wiki.

Prerequisites

This package requires an active Arlula account and access to the API credentials. If you don't have an account, you can create one at api.arlula.com/signup.

Installation

pip install arlulacore

Initiation

Instantiate a Session object using your API credentials as below. This will validate your credentials and store them for the remainder of the session. This can be re-used for numerous requests or be instantiated numerous times with different credentials for concurrent access to different sessions.

import arlulacore

"""opening a session"""
arlula_session = arlulacore.Session(key, secret)

API Endpoints

This package contains methods for each of the supported API endpoints, namespaced by API namespace. Each namespace inherits the session defined above

Archive

The Archive API provides the ability to search and order from Arlula and its supplier's historic imagery archives.

api = arlulacore.ArlulaAPI(arlula_session)

archive = api.archiveAPI()

# Search for imagery around sydney between 2020-Jan-1 and 2020-Feb-1
# With at least 10m resolution (gsd)
search_result = archive.search(
    arlulacore.SearchRequest(
        start=date(2020, 1, 1), 
        gsd=10,
    )
    .set_point_of_interest(-33.8688, 151.2093)
    .set_end(date(2020, 2, 1))
)

# Order a specific image from the archive, using the id from above, 
# the eula that applies to you, the bundle you want, and (optionally) 
# email jane.doe@gmail.com and john.smith@gmail.com when it is complete.
order_result = archive.order(
    arlulacore.OrderRequest(
        id="eyJhb...AYTqwM",
        eula="Supplier's EULA",
        bundle_key="default",
    )
    .set_emails(["john.smith@gmail.com", "jane.doe@gmail.com"])
)

Tasking

The Tasking API provides the ability to search and order future capturing opportunities from Arlula and it's suppliers.

tasking = api.taskingAPI()

# Search for capturing opportunities around sydney over the next 30 days
# With at least 1m resolution and at an off-nadir of less than 30 degrees.
search_result = tasking.search(
    arlulacore.TaskingSearchRequest(
        datetime.datetime.now(datetime.timezone.utc), 
        datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(days=30),
        1,
        30,
    )
    .set_point_of_interest(-33.8688, 151.2093)
)

# Order a future capture, using the ordering id from an above result, 
# the eula that applies to you, the bundle you want, and (optionally) 
# email jane.doe@gmail.com and john.smith@gmail.com when it is complete.
order_result = tasking.order(
    arlulacore.OrderRequest(
        id="eyJhb...AYTqwM",
        eula="Supplier's EULA",
        bundle_key="default",
    )
    .set_emails(["john.smith@gmail.com", "jane.doe@gmail.com"])
)

Orders

The Orders API provides the ability to list and get existing orders, as well as download resources associated with them.

orders = api.ordersAPI()

# Get the status and details of an order
order = orders.get(
    id="cade11f4-8b4d-43e1-8cb1-3bce85111a01",
)

# Get a specific resource, for example thumbnails, tiffs, json metadata.
# Streams to a file and returns the file handle.
with orders.get_resource_as_file(id="b7adb198-3e6e-4217-9e67-fb26eb355cc4", filepath="downloads/thumbnail.jpg") as f:
    f.read()

# Get a specific resource, for example thumbnails, tiffs, json metadata.
# Returns the memory buffer of the requested resource.
# Not recommended for large files.
b = orders.get_resource_as_memory(
    id="b7adb198-3e6e-4217-9e67-fb26eb355cc4",
)

# List the details and status of all orders made
order_list = orders.list_orders()

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

arlulacore-3.3.0.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

arlulacore-3.3.0-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file arlulacore-3.3.0.tar.gz.

File metadata

  • Download URL: arlulacore-3.3.0.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for arlulacore-3.3.0.tar.gz
Algorithm Hash digest
SHA256 7ab008ccbc8ca9dba9432faeb6925c1a8513bdf14abe568e4e984900f93aec05
MD5 f880bd14432f7e50fe6ae8b03dc55e6b
BLAKE2b-256 24d8775fde9d755c3405872f9d72695c783b7b6592a1fd419daaf080489c8fbc

See more details on using hashes here.

File details

Details for the file arlulacore-3.3.0-py3-none-any.whl.

File metadata

  • Download URL: arlulacore-3.3.0-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for arlulacore-3.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf9ed110c57f29c4cab9e3a6685c41274d931f8b216468d5e435fb559457f81b
MD5 29621a165bf9423bab0ab50abcab4491
BLAKE2b-256 cc7693eee415c01fdfc4e1378f731eb5ff113acd8cc62ef4158a8a4992df7b36

See more details on using hashes here.

Supported by

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