kobo-api-v2 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
kobo/__init__.py ADDED
@@ -0,0 +1,4 @@
1
+ from .client import KoboClient
2
+
3
+ __version__ = "0.1.0"
4
+ __all__ = ["KoboClient"]
kobo/client.py ADDED
@@ -0,0 +1,350 @@
1
+ """KoboToolbox API v2 client."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import time
6
+ from pathlib import Path
7
+ from typing import Any
8
+
9
+ import requests
10
+
11
+
12
+ BASE_URL = "https://kf.kobotoolbox.org"
13
+
14
+ # Default export settings that use XLSForm internal names (lang=_xml)
15
+ # Keys accepted by /export-settings/ (reusable config)
16
+ _DEFAULT_EXPORT_SETTING_KEYS: dict[str, Any] = {
17
+ "type": "xls",
18
+ "fields_from_all_versions": True,
19
+ "group_sep": "/",
20
+ "hierarchy_in_labels": False,
21
+ "lang": "_xml",
22
+ "multiple_select": "summary",
23
+ "flatten": False,
24
+ "xls_types_as_text": False,
25
+ "include_media_url": False,
26
+ "fields": [],
27
+ "query": {},
28
+ }
29
+
30
+ # Keys for one-off async /exports/ (superset — allows filtering by submission IDs)
31
+ _DEFAULT_EXPORT_PAYLOAD: dict[str, Any] = {
32
+ **_DEFAULT_EXPORT_SETTING_KEYS,
33
+ "submission_ids": [],
34
+ }
35
+
36
+
37
+ class KoboError(Exception):
38
+ """Raised when the KoboToolbox API returns an error response."""
39
+
40
+
41
+ class ExportTimeoutError(KoboError):
42
+ """Raised when waiting for an export exceeds the timeout."""
43
+
44
+
45
+ class KoboClient:
46
+ """Simple synchronous client for the KoboToolbox API v2.
47
+
48
+ Parameters
49
+ ----------
50
+ api_token:
51
+ KoboToolbox API token (found in Account Settings → Security).
52
+ base_url:
53
+ Base URL of the KoboToolbox instance.
54
+ Defaults to the public server ``https://kf.kobotoolbox.org``.
55
+ """
56
+
57
+ def __init__(
58
+ self,
59
+ api_token: str,
60
+ base_url: str = BASE_URL,
61
+ ) -> None:
62
+ self._base = base_url.rstrip("/")
63
+ self._session = requests.Session()
64
+ self._session.headers.update(
65
+ {
66
+ "Authorization": f"Token {api_token}",
67
+ "Accept": "application/json",
68
+ }
69
+ )
70
+
71
+ # ------------------------------------------------------------------
72
+ # Internal helpers
73
+ # ------------------------------------------------------------------
74
+
75
+ def _url(self, path: str) -> str:
76
+ return f"{self._base}{path}"
77
+
78
+ def _raise_for_status(self, response: requests.Response) -> None:
79
+ if not response.ok:
80
+ try:
81
+ detail = response.json()
82
+ except Exception:
83
+ detail = response.text
84
+ raise KoboError(
85
+ f"HTTP {response.status_code} {response.request.url}: {detail}"
86
+ )
87
+
88
+ def _get(self, path: str, **params: Any) -> Any:
89
+ resp = self._session.get(self._url(path), params=params or None)
90
+ self._raise_for_status(resp)
91
+ return resp.json()
92
+
93
+ def _post(self, path: str, payload: dict[str, Any]) -> Any:
94
+ resp = self._session.post(self._url(path), json=payload)
95
+ self._raise_for_status(resp)
96
+ return resp.json()
97
+
98
+ # ------------------------------------------------------------------
99
+ # Surveys (assets of type "survey")
100
+ # ------------------------------------------------------------------
101
+
102
+ def get_surveys(
103
+ self,
104
+ limit: int = 100,
105
+ offset: int = 0,
106
+ search: str | None = None,
107
+ ) -> list[dict[str, Any]]:
108
+ """Return a list of survey assets for the authenticated user.
109
+
110
+ Parameters
111
+ ----------
112
+ limit: Max results per page (API max: 300).
113
+ offset: Pagination offset.
114
+ search: Optional free-text search query.
115
+
116
+ Returns a list of dicts with keys such as ``uid``, ``name``,
117
+ ``deployment_status``, ``date_modified``, etc.
118
+ """
119
+ params: dict[str, Any] = {
120
+ "asset_type": "survey",
121
+ "limit": limit,
122
+ "offset": offset,
123
+ }
124
+ if search:
125
+ params["q"] = search
126
+ data = self._get("/api/v2/assets/", **params)
127
+ return data.get("results", [])
128
+
129
+ def get_survey(self, uid: str) -> dict[str, Any]:
130
+ """Return full details for a single survey asset."""
131
+ return self._get(f"/api/v2/assets/{uid}/")
132
+
133
+ def get_survey_content(self, uid: str) -> dict[str, Any]:
134
+ """Return the XLSForm content of a survey (survey, choices, settings)."""
135
+ return self._get(f"/api/v2/assets/{uid}/content/")
136
+
137
+ # ------------------------------------------------------------------
138
+ # Export settings (reusable configurations)
139
+ # ------------------------------------------------------------------
140
+
141
+ def get_or_create_export_setting(
142
+ self,
143
+ asset_uid: str,
144
+ name: str,
145
+ **overrides: Any,
146
+ ) -> tuple[str, bool]:
147
+ """Return the uid of an export setting with the given name, creating it if needed.
148
+
149
+ Parameters
150
+ ----------
151
+ asset_uid: UID of the survey asset.
152
+ name: Display name for the setting.
153
+ **overrides:
154
+ Any key from ``export_settings`` to override the defaults.
155
+
156
+ Returns a ``(uid, created)`` tuple where ``created`` is ``True`` if
157
+ the setting was newly created, or ``False`` if an existing one was found.
158
+ """
159
+ for setting in self.list_export_settings(asset_uid):
160
+ if setting.get("name") == name:
161
+ return setting["uid"], False
162
+
163
+ uid = self.create_export_setting(asset_uid, name, **overrides)
164
+ return uid, True
165
+
166
+ def create_export_setting(
167
+ self,
168
+ asset_uid: str,
169
+ name: str,
170
+ **overrides: Any,
171
+ ) -> str:
172
+ """Create a named export setting for an asset and return its uid.
173
+
174
+ Parameters
175
+ ----------
176
+ asset_uid: UID of the survey asset.
177
+ name: Display name for the setting.
178
+ **overrides:
179
+ Any key from ``export_settings`` to override the defaults.
180
+ Defaults use ``lang="_xml"`` (XLSForm internal field names)
181
+ and ``type="xls"``.
182
+
183
+ Returns the ``uid`` of the created export setting.
184
+ Raises :exc:`KoboError` if a setting with the same name already exists.
185
+ Use :meth:`get_or_create_export_setting` to avoid that error.
186
+ """
187
+ settings = {**_DEFAULT_EXPORT_SETTING_KEYS, **overrides}
188
+ payload: dict[str, Any] = {
189
+ "name": name,
190
+ "export_settings": settings,
191
+ }
192
+ data = self._post(f"/api/v2/assets/{asset_uid}/export-settings/", payload)
193
+ return data["uid"]
194
+
195
+ def list_export_settings(self, asset_uid: str) -> list[dict[str, Any]]:
196
+ """Return all saved export settings for an asset."""
197
+ data = self._get(f"/api/v2/assets/{asset_uid}/export-settings/")
198
+ return data.get("results", [])
199
+
200
+ # ------------------------------------------------------------------
201
+ # Async exports (trigger → poll → download)
202
+ # ------------------------------------------------------------------
203
+
204
+ def trigger_export(
205
+ self,
206
+ asset_uid: str,
207
+ type: str = "xls",
208
+ lang: str = "_xml",
209
+ **overrides: Any,
210
+ ) -> str:
211
+ """Trigger an async export task and return its ``uid``.
212
+
213
+ Parameters
214
+ ----------
215
+ asset_uid: UID of the survey asset.
216
+ type: Export format — ``"xls"``, ``"csv"``, ``"geojson"``, etc.
217
+ lang: Language for labels. ``"_xml"`` uses XLSForm field names.
218
+ **overrides:
219
+ Extra ``ExportCreatePayload`` fields (e.g. ``fields``,
220
+ ``query``, ``submissions_id``).
221
+
222
+ Returns the ``uid`` of the export task. Use :meth:`wait_for_export`
223
+ to poll for completion.
224
+ """
225
+ payload: dict[str, Any] = {
226
+ **_DEFAULT_EXPORT_PAYLOAD,
227
+ "type": type,
228
+ "lang": lang,
229
+ **overrides,
230
+ }
231
+ data = self._post(f"/api/v2/assets/{asset_uid}/exports/", payload)
232
+ return data["uid"]
233
+
234
+ def wait_for_export(
235
+ self,
236
+ asset_uid: str,
237
+ export_uid: str,
238
+ poll_interval: float = 3.0,
239
+ timeout: float = 120.0,
240
+ ) -> dict[str, Any]:
241
+ """Poll until an export task is complete and return the response dict.
242
+
243
+ The returned dict includes a ``result`` key with the direct download URL.
244
+
245
+ Parameters
246
+ ----------
247
+ asset_uid: UID of the survey asset.
248
+ export_uid: UID of the export task (from :meth:`trigger_export`).
249
+ poll_interval: Seconds between status checks.
250
+ timeout: Maximum seconds to wait before raising
251
+ :exc:`ExportTimeoutError`.
252
+ """
253
+ path = f"/api/v2/assets/{asset_uid}/exports/{export_uid}/"
254
+ deadline = time.monotonic() + timeout
255
+
256
+ while True:
257
+ data = self._get(path)
258
+ status = data.get("status", "")
259
+
260
+ if status == "complete":
261
+ return data
262
+ if status == "error":
263
+ raise KoboError(
264
+ f"Export {export_uid} failed: {data.get('message', 'unknown error')}"
265
+ )
266
+ if time.monotonic() >= deadline:
267
+ raise ExportTimeoutError(
268
+ f"Export {export_uid} did not complete within {timeout}s "
269
+ f"(last status: {status!r})"
270
+ )
271
+
272
+ time.sleep(poll_interval)
273
+
274
+ def download_export(
275
+ self,
276
+ asset_uid: str,
277
+ export_uid: str,
278
+ dest_path: str | Path,
279
+ poll_interval: float = 3.0,
280
+ timeout: float = 120.0,
281
+ ) -> Path:
282
+ """Wait for an export to complete, then download the file.
283
+
284
+ Parameters
285
+ ----------
286
+ asset_uid: UID of the survey asset.
287
+ export_uid: UID of the export task (from :meth:`trigger_export`).
288
+ dest_path: Local path to save the downloaded file.
289
+ poll_interval: Seconds between status checks while waiting.
290
+ timeout: Maximum seconds to wait for the export to finish.
291
+
292
+ Returns the resolved :class:`~pathlib.Path` of the saved file.
293
+ """
294
+ result = self.wait_for_export(asset_uid, export_uid, poll_interval, timeout)
295
+ download_url: str = result["result"]
296
+
297
+ dest = Path(dest_path)
298
+ dest.parent.mkdir(parents=True, exist_ok=True)
299
+
300
+ with self._session.get(download_url, stream=True) as resp:
301
+ self._raise_for_status(resp)
302
+ with dest.open("wb") as fh:
303
+ for chunk in resp.iter_content(chunk_size=8192):
304
+ fh.write(chunk)
305
+
306
+ return dest.resolve()
307
+
308
+ # ------------------------------------------------------------------
309
+ # High-level shortcut
310
+ # ------------------------------------------------------------------
311
+
312
+ def get_excel(
313
+ self,
314
+ asset_uid: str,
315
+ export_uid: str | None = None,
316
+ path: str | Path = "data_survey.xlsx",
317
+ poll_interval: float = 3.0,
318
+ timeout: float = 120.0,
319
+ ) -> Path:
320
+ """Download survey data as an Excel file in one call.
321
+
322
+ If ``export_uid`` is provided, waits for that existing export task and
323
+ downloads it. Otherwise, ensures a reusable export setting named
324
+ ``"python-client"`` exists (creating it if needed), triggers a new
325
+ export with the default configuration (``type="xls"``, ``lang="_xml"``),
326
+ and downloads the result.
327
+
328
+ Parameters
329
+ ----------
330
+ asset_uid: UID of the survey asset.
331
+ export_uid: Optional UID of an already-triggered export task.
332
+ If omitted, a new export is triggered automatically.
333
+ path: Destination file path. Defaults to ``data_survey.xlsx``
334
+ in the current working directory.
335
+ poll_interval: Seconds between status checks while waiting.
336
+ timeout: Maximum seconds to wait for the export to finish.
337
+
338
+ Returns the resolved :class:`~pathlib.Path` of the saved file.
339
+
340
+ Example
341
+ -------
342
+ >>> saved = client.get_excel("atXzmELZmQgQkWD4cAnumv")
343
+ >>> print(saved)
344
+ /home/user/project/data_survey.xlsx
345
+ """
346
+ if export_uid is None:
347
+ self.get_or_create_export_setting(asset_uid, name="python-client")
348
+ export_uid = self.trigger_export(asset_uid)
349
+
350
+ return self.download_export(asset_uid, export_uid, path, poll_interval, timeout)
@@ -0,0 +1,230 @@
1
+ Metadata-Version: 2.4
2
+ Name: kobo-api-v2
3
+ Version: 0.1.0
4
+ Summary: A synchronous Python client for the KoboToolbox API v2
5
+ Project-URL: Homepage, https://github.com/morabdiego/kobo-api-v2
6
+ Project-URL: Repository, https://github.com/morabdiego/kobo-api-v2
7
+ Project-URL: Bug Tracker, https://github.com/morabdiego/kobo-api-v2/issues
8
+ Author-email: Diego Mora <morabdiego@gmail.com>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: api,data-collection,kobo,kobotoolbox,survey,xlsform
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Internet :: WWW/HTTP
22
+ Classifier: Topic :: Scientific/Engineering
23
+ Classifier: Typing :: Typed
24
+ Requires-Python: >=3.10
25
+ Requires-Dist: requests>=2.32
26
+ Description-Content-Type: text/markdown
27
+
28
+ # Kobo API v2 Python client
29
+
30
+ [![PyPI version](https://img.shields.io/pypi/v/kobo-api-v2.svg)](https://pypi.org/project/kobo-api-v2/)
31
+ [![Python](https://img.shields.io/pypi/pyversions/kobo-api-v2.svg)](https://pypi.org/project/kobo-api-v2/)
32
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
33
+
34
+ A lightweight, synchronous Python client for the [KoboToolbox API v2](https://kf.kobotoolbox.org/api/v2/docs/).
35
+
36
+ ## Installation
37
+
38
+ ```bash
39
+ pip install kobo-api-v2
40
+ ```
41
+
42
+ Requires Python ≥ 3.10.
43
+
44
+ ## Quick start
45
+
46
+ ```python
47
+ from kobo import KoboClient
48
+
49
+ client = KoboClient(api_token="<your_api_token>")
50
+
51
+ # List available surveys
52
+ surveys = client.get_surveys()
53
+
54
+ # Download the first survey as Excel in one call
55
+ saved = client.get_excel(surveys[0]["uid"])
56
+ print(saved) # → /absolute/path/to/data_survey.xlsx
57
+ ```
58
+
59
+ Your API token is under **Account Settings → Security → API key** in your KoboToolbox account.
60
+
61
+ ---
62
+
63
+ ## API reference
64
+
65
+ ### `KoboClient(api_token, base_url=...)`
66
+
67
+ ```python
68
+ # Public server (default)
69
+ client = KoboClient(api_token="...")
70
+
71
+ # Self-hosted instance
72
+ client = KoboClient(api_token="...", base_url="https://kobo.myserver.org")
73
+ ```
74
+
75
+ ---
76
+
77
+ ### Surveys
78
+
79
+ ```python
80
+ # List surveys (returns list[dict] with uid, name, deployment_status, …)
81
+ surveys = client.get_surveys()
82
+ surveys = client.get_surveys(search="census", limit=50, offset=0)
83
+
84
+ # Full metadata for a single survey
85
+ survey = client.get_survey(uid)
86
+
87
+ # XLSForm content (survey, choices, settings sections)
88
+ content = client.get_survey_content(uid)
89
+ for row in content["survey"]:
90
+ print(row["type"], row.get("$autoname"))
91
+ ```
92
+
93
+ #### `get_surveys` parameters
94
+
95
+ | Parameter | Default | Description |
96
+ |-----------|---------|-------------|
97
+ | `limit` | `100` | Results per page (API max: 300) |
98
+ | `offset` | `0` | Pagination offset |
99
+ | `search` | `None` | Free-text filter |
100
+
101
+ ---
102
+
103
+ ### `get_excel` — one-call export
104
+
105
+ Download survey data as an Excel file with a single method call:
106
+
107
+ ```python
108
+ # Minimal — saves to data_survey.xlsx in the current directory
109
+ saved = client.get_excel(uid)
110
+
111
+ # Custom output path
112
+ saved = client.get_excel(uid, path="outputs/survey.xlsx")
113
+
114
+ # Reuse an already-triggered export task
115
+ saved = client.get_excel(uid, export_uid="eNHpF8SxT9oP2752mj8UJQ")
116
+ ```
117
+
118
+ When `export_uid` is omitted the method:
119
+ 1. Creates (or reuses) a saved export setting named `"python-client"`
120
+ 2. Triggers a new XLS export using XLSForm internal field names (`lang="_xml"`)
121
+ 3. Polls until the server finishes generating the file (every 3 s, 120 s timeout)
122
+ 4. Downloads the file and returns its absolute `Path`
123
+
124
+ | Parameter | Default | Description |
125
+ |-----------|---------|-------------|
126
+ | `asset_uid` | — | Survey UID |
127
+ | `export_uid` | `None` | UID of an already-triggered export; triggers a new one if omitted |
128
+ | `path` | `"data_survey.xlsx"` | Local destination path |
129
+ | `poll_interval` | `3.0` | Seconds between status checks |
130
+ | `timeout` | `120.0` | Max seconds to wait before raising `ExportTimeoutError` |
131
+
132
+ ---
133
+
134
+ ### Export settings (reusable configurations)
135
+
136
+ Export settings are named configurations saved in KoboToolbox that can be reused across multiple exports.
137
+
138
+ ```python
139
+ # Create a new setting (raises KoboError if the name already exists)
140
+ setting_uid = client.create_export_setting(uid, name="my_config")
141
+
142
+ # Create or reuse — recommended for recurring scripts
143
+ setting_uid, created = client.get_or_create_export_setting(uid, name="my_config")
144
+
145
+ # List all saved settings for a survey
146
+ settings = client.list_export_settings(uid)
147
+ ```
148
+
149
+ All settings default to the values below and can be overridden with `**overrides`:
150
+
151
+ | Field | Default | Description |
152
+ |-------|---------|-------------|
153
+ | `type` | `"xls"` | Format: `"xls"`, `"csv"`, `"geojson"` |
154
+ | `lang` | `"_xml"` | `"_xml"` = XLSForm internal names; or a language label, e.g. `"English"` |
155
+ | `fields_from_all_versions` | `True` | Include fields from older form versions |
156
+ | `group_sep` | `"/"` | Column name separator for groups |
157
+ | `hierarchy_in_labels` | `False` | Prepend group hierarchy to labels |
158
+ | `multiple_select` | `"summary"` | `"summary"`, `"both"`, or `"details"` |
159
+ | `flatten` | `False` | Flatten group structure |
160
+ | `xls_types_as_text` | `False` | Export all values as strings |
161
+ | `include_media_url` | `False` | Include attachment download URLs |
162
+
163
+ ```python
164
+ setting_uid = client.create_export_setting(
165
+ uid,
166
+ name="csv_english",
167
+ type="csv",
168
+ lang="English",
169
+ )
170
+ ```
171
+
172
+ ---
173
+
174
+ ### Async exports (manual control)
175
+
176
+ For full control over the export lifecycle:
177
+
178
+ ```python
179
+ # 1. Trigger an export task
180
+ export_uid = client.trigger_export(uid, type="xls", lang="_xml")
181
+
182
+ # Filter by date
183
+ export_uid = client.trigger_export(
184
+ uid,
185
+ query={"$and": [{"_submission_time": {"$gte": "2024-01-01"}}]},
186
+ )
187
+
188
+ # Specific submissions or fields
189
+ export_uid = client.trigger_export(uid, submission_ids=[101, 102])
190
+ export_uid = client.trigger_export(uid, fields=["name", "age"])
191
+
192
+ # 2. Wait and get the download URL
193
+ result = client.wait_for_export(uid, export_uid)
194
+ print(result["result"]) # direct download URL
195
+
196
+ # 3. Or wait and download in one step
197
+ saved = client.download_export(uid, export_uid, dest_path="data/survey.xlsx")
198
+ ```
199
+
200
+ | Method | Returns |
201
+ |--------|---------|
202
+ | `trigger_export(uid, ...)` | `export_uid: str` |
203
+ | `wait_for_export(uid, export_uid)` | `dict` with `result` (download URL) |
204
+ | `download_export(uid, export_uid, path)` | `Path` of the saved file |
205
+
206
+ ---
207
+
208
+ ## Error handling
209
+
210
+ | Exception | Raised when |
211
+ |-----------|-------------|
212
+ | `KoboError` | The API returns an HTTP error (4xx / 5xx) |
213
+ | `ExportTimeoutError` | Export did not complete within `timeout` seconds |
214
+
215
+ ```python
216
+ from kobo.client import KoboError, ExportTimeoutError
217
+
218
+ try:
219
+ saved = client.get_excel(uid, path="out.xlsx")
220
+ except ExportTimeoutError:
221
+ print("Export took too long")
222
+ except KoboError as e:
223
+ print(f"API error: {e}")
224
+ ```
225
+
226
+ ---
227
+
228
+ ## License
229
+
230
+ MIT — see [LICENSE](LICENSE).
@@ -0,0 +1,6 @@
1
+ kobo/__init__.py,sha256=LxD7wwgdNY3PYwqZI3n2voOjY1cOWQvYJSRYmKASD0E,79
2
+ kobo/client.py,sha256=bNg17NJM9tgrwMVUXeYpFvOZoNd-NniD_OBFqj89Gsw,12141
3
+ kobo_api_v2-0.1.0.dist-info/METADATA,sha256=3ZixpSAUPv5ydlyv53cFzQ6udR5e_WhTFcokUdCWnz8,7088
4
+ kobo_api_v2-0.1.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
5
+ kobo_api_v2-0.1.0.dist-info/licenses/LICENSE,sha256=71NFijUc1j8u2bqK17cxtVAbOpOEqDDhgeJjXJh2Myc,1067
6
+ kobo_api_v2-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Diego Mora
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.