Package: resto-client
Resto_client: a client to access resto serversresto_clientis a python package which gives you access to several remote sensing image servers which are based on therestoopen source server.Once you have installed it,resto_clientoffers 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,searcha collection by criteria for retrieving features (images for instance) and display their characteristics,show: retrieve and display feature metadata when you know its identifier,downloadfiles 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 serversresto_clientcomes with a list of well known servers already configured, which can be accessed out of the box:kalideos : CNES Kalideos platformro : CEOS Recovery Observatorypleiades : CNES pleiades platformpeps : The French Sentinel Data Processing centertheia : The French Space Agency, THEIA land data centercreodias : Copernicus DIAS CREODIAScop_nci : Sentinel Australasia regional AccessThis list is augmented regularly, but you can of course add your own server by providing its configuration throughresto_client.Supported environmentresto_clientruns on the following configurations:Python 3.6, 3.7 or 3.8Any Operating System supporting the above versions of Python (Windows, Linux, MacOS, etc.)resto_clienttests are done on Windows and Linux using the supported python versions.Resto_client installationThe recommended way of installingresto_clientis to simply usepipwhich will install the package from thePython Package Indexin your python environment:$pipinstallresto_clientOnceresto_clientpackage is installed you can test it by issuing the following command in a terminal:$resto_client--helpResto_client configurationresto_clientconfiguration is managed through theset,unsetandconfigure_servercommands (see help for each of them), except for the networking configuration which is parameterized by environment variables.For network access we use the popularrequestspython package which directly takes into account several environment variables describing your networking configuration. Namely you might need to set the following environment variables:HTTP_PROXYandHTTPS_PROXYif your machine is behind a proxy: have a look atrequests Proxies configuration.REQUESTS_CA_BUNDLEbecause default policy is to enforce SSL certificates verification and your corporate policy might differ from this baseline: refer torequests SSL certificates verificationin that case.The values to provide in these variables depends on the networking configuration of the machine where you are installingresto_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_clientsetserverkalideosOr configure a new one and set it:$resto_clientconfigure_servercreatenew_kalideoshttps://www.kalideos.fr/resto2dotcloudhttps://www.kalideos.fr/resto2default$resto_clientsetservernew_kalideosYou can then show the server synthetic characteristics:$resto_clientshowserverServer 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_clientshowcollectionKALCNES+----------------------------------------------------------------------------+|                        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_clientsearch--criteriaplatform:"PLEIADES 1A"resolution:[0,1.5]startDate:2018-01-01completionDate:2018-01-31--collection=KALCNES['1926127184714545', '6589984032241814', '1926091543104317', '1926059176484529']4 results shown on a total of  4 results beginning at index 1And you can get the details of some feature by specifying its identifier:$resto_clientshowfeature1926127184714545Metadata 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_clientdownloadquicklook1926127184714545downloading file: c:\Users\xxxxxxx\Downloads\1926127184714545_ql.jpgDownloading: 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_clientdownloadproduct1926127184714545--username=known_userPlease enter your password for kalideos server:***********...Every command has several options and there are also more commands to set differentresto_clientparameters or to define servers.
You can discover their function and syntax by exploring the help onresto_clientand on its subcommands
:$resto_client--helpusage: 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 exitsubcommands: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, verbosityunset               unset application parameters: server, account,collection, download_dir, region, verbosityshow                show resto_client entities: settings, server,collection, featuredownload            download features files: product, quicklook, thumbnailor annexessearch              search feature(s) in collectionconfigure_server    configure servers known by resto_client: create, edit,delete.$resto_clientshow--helpusage: resto_client show [-h] {settings,server,collection,feature} ...Show different resto_client entities.optional arguments:-h, --help            show this help message and exitsubcommands:For more help: resto_client show <entity> -h{settings,server,collection,feature}settings            Show application settingsserver              Show the server detailscollection          Show the details of a collectionfeature             Show feature detailsDocumentationMore documentation available soon.