Skip to main content

Resto_client: a client to access resto servers

PyPI license Python versions PyPI version shields.io PyPI - Format PyPI - Downloads GitHub contributors

resto_client is a python package which gives you access to several remote sensing image servers which are based on the resto open source server.

Once you have installed it, resto_client offers the possibility to interact with these servers by issuing commands from a simple terminal. Currently implemented commands allow to:

  • define and manage a list of well known servers,
  • select one of them and browse its collections and their characteristics,
  • search a collection by criteria for retrieving features (images for instance) and display their characteristics,
  • show : retrieve and display feature metadata when you know its identifier,
  • download files composing the feature: the product itself, but also its quicklook, thumbnail or annexes,
  • authentication is supported to provide access to restricted features or sign product licenses when necessary.

Well known resto servers

resto_client comes with a list of well known servers already configured, which can be accessed out of the box:

This list is augmented regularly, but you can of course add your own server by providing its configuration through resto_client.

Supported environment

resto_client runs on the following configurations:

  • Python 3.6, 3.7 or 3.8
  • Any Operating System supporting the above versions of Python (Windows, Linux, MacOS, etc.)

resto_client tests are done on Windows and Linux using the supported python versions.

Resto_client installation

The recommended way of installing resto_client is to simply use pip which will install the package from the Python Package Index in your python environment:

$ pip install resto_client

Once resto_client package is installed you can test it by issuing the following command in a terminal:

$ resto_client --help

Resto_client configuration

resto_client configuration is managed through the set, unset and configure_server commands (see help for each of them), except for the networking configuration which is parameterized by environment variables.

For network access we use the popular requests python package which directly takes into account several environment variables describing your networking configuration. Namely you might need to set the following environment variables:

The values to provide in these variables depends on the networking configuration of the machine where you are installing resto_client. Please refer to your system administrator for defining how to set them in your case.

How to use resto_client?

Firstly you can select the server to be used for all subsequent commands. This selection is not mandatory and you may prefer to specify the server in each command. But it is more convenient if you are using the same server for a long time.

You can use a well known server:

$ resto_client set server kalideos

Or configure a new one and set it:

$ resto_client configure_server create new_kalideos https://www.kalideos.fr/resto2 dotcloud https://www.kalideos.fr/resto2 default
$ resto_client set server new_kalideos

You can then show the server synthetic characteristics:

$ resto_client show server
Server URL: https://www.kalideos.fr/resto2/
+-----------------+--------+---------------------+------------+--------------+
| Collection name | Status |        Model        | License Id | License name |
+-----------------+--------+---------------------+------------+--------------+
|     KALCNES     | public | RestoModel_dotcloud | unlicensed |  No license  |
|     KALHAITI    | public | RestoModel_dotcloud | unlicensed |  No license  |
+-----------------+--------+---------------------+------------+--------------+

This shows you the server URL as well as its collections and their main characteristics. If you want the details of a collection, you can type in:

$ resto_client show collection KALCNES
+----------------------------------------------------------------------------+
|                        Collection's Characteristics                        |
+-----------------+--------+---------------------+------------+--------------+
| Collection name | Status |        Model        | License Id | License name |
+-----------------+--------+---------------------+------------+--------------+
|     KALCNES     | public | RestoModel_dotcloud | unlicensed |  No license  |
+-----------------+--------+---------------------+------------+--------------+

STATISTICS for KALCNES
+------------+-------------+
| collection | Nb products |
+------------+-------------+
| KALCNES    |        2599 |
| Total      |        2599 |
+------------+-------------+
+---------------+-------------+
| continent     | Nb products |
+---------------+-------------+
| Europe        |        2594 |
| North America |           1 |
| Total         |        2595 |
+---------------+-------------+
.

In fact the collection description contains much more statistics, but we have truncated the result for brevity.

You can search the collection for the features it contains, either by identifiers or by criteria. For instance:

$ resto_client search --criteria platform:"PLEIADES 1A" resolution:[0,1.5] startDate:2018-01-01 completionDate:2018-01-31 --collection=KALCNES
['1926127184714545', '6589984032241814', '1926091543104317', '1926059176484529']
4 results shown on a total of  4 results beginning at index 1

And you can get the details of some feature by specifying its identifier:

$ resto_client show feature 1926127184714545
Metadata available for product 1926127184714545
+--------------------+-------------------------------------------------------------------------------------------+
| Property           | Value                                                                                     |
+--------------------+-------------------------------------------------------------------------------------------+
| collection         | KALCNES                                                                                   |
| productIdentifier  | 1926127184714545                                                                          |
| parentIdentifier   | None                                                                                      |
| title              | PLEIADES 1A PAN L1A 2018-01-23 10:37:39Z                                                  |
| description        | L1A PAN image acquired by PLEIADES 1A on[...]                                             |
.

Here we have also truncated the result but there are much more metadata available for each feature.

Finally you may want to download some file associated to that feature : product, quicklook, thumbnail or annexes. The following example is for the quicklook of a feature:

$ resto_client download quicklook 1926127184714545
downloading file: c:\Users\xxxxxxx\Downloads\1926127184714545_ql.jpg
Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 128k/128k [00:09<00:00, 13.3kB/s]

Obviously you can also download the product, provided that you have the right credentials to access it if it is protected

$ resto_client download product 1926127184714545 --username=known_user
Please enter your password for kalideos server:***********
...

Every command has several options and there are also more commands to set different resto_client parameters or to define servers. You can discover their function and syntax by exploring the help on resto_client and on its subcommands :

$ resto_client --help
usage: resto_client [-h] {set,unset,show,download,search,configure_server} ...

A commmand line client to interact with resto servers.

optional arguments:
  -h, --help            show this help message and exit

subcommands:
  For more help: resto_client <sub_command> -h

  {set,unset,show,download,search,configure_server}
    set                 set application parameters: server, account,
                        collection, download_dir, region, verbosity
    unset               unset application parameters: server, account,
                        collection, download_dir, region, verbosity
    show                show resto_client entities: settings, server,
                        collection, feature
    download            download features files: product, quicklook, thumbnail
                        or annexes
    search              search feature(s) in collection
    configure_server    configure servers known by resto_client: create, edit,
                        delete.
$ resto_client show --help
usage: resto_client show [-h] {settings,server,collection,feature} ...

Show different resto_client entities.

optional arguments:
  -h, --help            show this help message and exit

subcommands:
  For more help: resto_client show <entity> -h

  {settings,server,collection,feature}
    settings            Show application settings
    server              Show the server details
    collection          Show the details of a collection
    feature             Show feature details

Documentation

More documentation available soon.

Metadata

Release files for resto-client 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for resto-client 0.5.0
File Size Uploaded Provenance
resto_client-0.5.0.tar.gz 141.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for resto-client 0.5.0
File Interpreter ABI Platform
resto_client-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 336.5 kB

Release files / resto_client-0.5.0.tar.gz

Download URL resto_client-0.5.0.tar.gz
Size 141.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5c5b1611e682161761c36bd5c9fb4031d42e8f238fad572bbe633fc0979ce386
BLAKE2b-256 checksum
How to use checksums
32da2c5baeeb55049b866d5941f883182429b208f95961491bf431895043c676
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

Release files / resto_client-0.5.0-py3-none-any.whl

Download URL resto_client-0.5.0-py3-none-any.whl
Size 195.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8afc774b288482f6f816e0b9aba4af565390dfa890a4f2dd3e29d881d2c901f
BLAKE2b-256 checksum
How to use checksums
82b6e153cf4b34b2b70ab57a5b45ec2a985af22638c4903d3db94fb5de952625
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

Security for resto-client 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page