Skip to content

Commit 74472ff

Browse files
Merge pull request #20 from GermanoGuerrini/master
Autodoc fixes
2 parents 0c186e8 + f5dd8ce commit 74472ff

File tree

8 files changed

+23
-82
lines changed

8 files changed

+23
-82
lines changed

README.md

+2-75
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,12 @@
11
# WEkEO HDA API Client
2+
23
This package provides a fully compliant Python 3 client that can be used to search and download products using the Harmonized Data Access WEkEO API.
34

45
HDA is a RESTful interface allowing users to search and download WEkEO datasets.
56

67
Documentation about its usage can be found at https://www.wekeo.eu/.
78

8-
## Requirements
9-
- Python 3
10-
- requests
11-
- tqdm
12-
13-
## Install the WEkEO HDA Key
14-
15-
1) If you don't have a WEkEO account, please self register at the WEkEO registration page https://www.wekeo.eu/web/guest/user-registration and go to the steps below.
16-
17-
2) Copy the code below in the file `$HOME/.hdarc` in your Unix/Linux environment. Adapt the following template with the credentials of your WEkEO account:
18-
19-
url: https://wekeo-broker.apps.mercator.dpi.wekeo.eu/databroker
20-
user: [username]
21-
password: [password]
22-
23-
24-
## Install the WEkEO HDA client
25-
26-
The WEkEO HDA client is a python based library. It provides support for both Python 2.7.x and Python 3.
27-
28-
You can Install the WEkEO HDA client via the package management system pip, by running on Unix/Linux the command shown below.
29-
30-
pip install hda
31-
32-
This will also install the required dependencies.
33-
34-
35-
## Use the WEkEO HDA client for data access
36-
37-
Once the WEkEO HDA API client is installed, it can be used to request data from the datasets listed in the WEkEO catalogue.
38-
39-
On the WEkEO portal, under DATA, each dataset search has a 'Show API request' button, it displays the json request to be used. The request can be formatted using the interactive form. The API call must follow the syntax.
40-
41-
The client can be used directly into another python script as in the following example:
42-
43-
```python
44-
from hda import Client
45-
46-
c = Client(debug=True)
47-
48-
query = {
49-
"datasetId": "EO:CODA:DAT:SENTINEL-3:OL_1_EFR___",
50-
"dateRangeSelectValues": [{
51-
"end": "2019-07-03T14:03:00.000Z",
52-
"name": "dtrange",
53-
"start": "2019-07-03T13:59:00.000Z"
54-
}],
55-
"stringChoiceValues": []
56-
}
57-
matches = c.search(query)
58-
print(matches)
59-
matches.download()
60-
```
61-
62-
Note that the query must be a json valid object. Please refer to the official documentation of the HDA for instructions on how to get the list of the available parameters.
63-
64-
Alternatively, it can be wrapped into a script to be executed from the command line. Please refer to the ``demos/demo.py`` file for a simple demostration.
65-
66-
## Reference
67-
There are a number of options the drives the `Client` instance:
68-
- `url`: The HDA URL. Normally set in the `.hdarc` file, can be overwritten directly by passing a value to the client.
69-
- `user`: The HDA user. Normally set in the `.hdarc` file, can be overwritten directly by passing a value to the client.
70-
- `password`: The HDA password. Normally set in the `.hdarc` file, can be overwritten directly by passing a value to the client.
71-
- `token`: Credentials can be passed directly with a valid JWT Token that will take precedence over user and password. Normally unused, as the client will require a fresh token upon any API call.
72-
- `quiet`: Pass `True` to disable logging. Default: `False`.
73-
- `debug`: Pass `True` to enable debug. Requires `quiet` to be `False`. Default: `False`.
74-
- `verify`: Whether to verify for SSL certificate of the HDA or not. Normally there is no need to modify the default value. Default: `None`.
75-
- `timeout`: The time, in seconds, before the client should stop waiting for a response. Default: `None`.
76-
- `retry_max`: The number of retries before the client should stop trying to get a successful response. Default: 500.
77-
- `sleep_max`: The time, in seconds, to wait between two attempts. Default: 120.
78-
- `info_callback`: A callback function that can be attached to the `info` logging level messages. Will replace the default logging. Default: `None`.
79-
- `warning_callback`: A callback function that can be attached to the `warning` logging level messages. Will replace the default logging. Default: `None`.
80-
- `error_callback`: A callback function that can be attached to the `error` logging level messages. Will replace the default logging. Default: `None`.
81-
- `debug_callback`: A callback function that can be attached to the `debug` logging level messages. Will replace the default logging. Default: `None`.
82-
- `progress`: Whether to show or hide a progress bar. Default: `True`.
9+
The documentation for this package can be found at: https://hda.readthedocs.io/en/latest/
8310

8411
## Contribution
8512
Contribute to the development of this client by creating an account on GitHub. You can follow this guidelines for a general overview of the needed steps: https://github.com/firstcontributions/first-contributions.

demos/sentinel.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"datasetId": "EO:CODA:DAT:SENTINEL-3:OL_1_EFR___",
2+
"datasetId": "EO:EUM:DAT:SENTINEL-3:OL_1_EFR___",
33
"dateRangeSelectValues": [{
44
"end": "2019-07-03T14:03:00.000Z",
55
"name": "dtrange",

docs/source/api.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ API
33

44
.. automodule:: hda.api
55

6-
.. autoattribute:: hda.pi.BROKER_URL
6+
.. autoattribute:: hda.api.BROKER_URL
77

88
.. autoclass:: RequestRunner
99
:members:

docs/source/changelog.rst

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Changelog
22
=========
33

4+
Version 1.13
5+
-------------
6+
* Minor documentation fixes
7+
48
Version 1.12
59
-------------
610
* Refactored client configuration

docs/source/conf.py

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
# Configuration file for the Sphinx documentation builder.
22

3+
import os
4+
import sys
5+
6+
# If extensions (or modules to document with autodoc) are in another directory,
7+
# add these directories to sys.path here. If the directory is relative to the
8+
# documentation root, use os.path.abspath to make it absolute, like shown here.
9+
# sys.path.insert(0, os.path.abspath('.'))
10+
sys.path.insert(0, os.path.abspath("../.."))
11+
312
# -- Project information
413

514
project = "WEkEO HDA API Client"
615
copyright = "2023, ECMWF"
716
author = "ECMWF"
817

9-
release = "0.4.0"
10-
version = "0.4.0"
18+
release = "1.13"
19+
version = "1.13"
1120

1221
# -- General configuration
1322

@@ -33,3 +42,5 @@
3342

3443
# -- Options for EPUB output
3544
epub_show_urls = "footnote"
45+
46+
autodoc_mock_imports = ["tqdm", "requests"]

docs/source/quickstart.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The client can be used directly into another python script as in the following e
1717
c = Client()
1818
1919
query = {
20-
"datasetId": "EO:CODA:DAT:SENTINEL-3:OL_1_EFR___",
20+
"datasetId": "EO:EUM:DAT:SENTINEL-3:OL_1_EFR___",
2121
"dateRangeSelectValues": [{
2222
"end": "2019-07-03T14:03:00.000Z",
2323
"name": "dtrange",

hda/api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# http://www.apache.org/licenses/LICENSE-2.0
88
#
9-
# Unless required by applicable law or agreed to in writing, software
9+
# Unless required by applicable law or agreed to in writing, software
1010
# distributed under the License is distributed on an "AS IS" BASIS,
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and

setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def read(fname):
3232

3333
version = "1.13"
3434

35-
3635
setuptools.setup(
3736
name="hda",
3837
version=version,

0 commit comments

Comments
 (0)