cecil 0.0.8__tar.gz → 0.0.10__tar.gz
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.
Potentially problematic release.
This version of cecil might be problematic. Click here for more details.
- {cecil-0.0.8 → cecil-0.0.10}/PKG-INFO +1 -1
- cecil-0.0.10/__about__.py +1 -0
- {cecil-0.0.8 → cecil-0.0.10}/src/cecil/client.py +14 -6
- {cecil-0.0.8 → cecil-0.0.10}/tests/test_client.py +3 -3
- cecil-0.0.8/__about__.py +0 -1
- {cecil-0.0.8 → cecil-0.0.10}/.gitignore +0 -0
- {cecil-0.0.8 → cecil-0.0.10}/CONTRIBUTING.md +0 -0
- {cecil-0.0.8 → cecil-0.0.10}/LICENSE.txt +0 -0
- {cecil-0.0.8 → cecil-0.0.10}/Makefile +0 -0
- {cecil-0.0.8 → cecil-0.0.10}/README.md +0 -0
- {cecil-0.0.8 → cecil-0.0.10}/pyproject.toml +0 -0
- {cecil-0.0.8 → cecil-0.0.10}/src/cecil/__init__.py +0 -0
- {cecil-0.0.8 → cecil-0.0.10}/src/cecil/models.py +0 -0
- {cecil-0.0.8 → cecil-0.0.10}/tests/__init__.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.0.10"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import os
|
|
2
|
-
from pydantic import BaseModel
|
|
3
2
|
from typing import Dict, List
|
|
4
|
-
import requests
|
|
5
|
-
|
|
6
|
-
from requests import auth
|
|
7
3
|
|
|
4
|
+
import requests
|
|
8
5
|
import snowflake.connector
|
|
6
|
+
from pydantic import BaseModel
|
|
7
|
+
from requests import auth
|
|
9
8
|
|
|
9
|
+
from __about__ import __version__
|
|
10
10
|
from .models import (
|
|
11
11
|
AOI,
|
|
12
12
|
AOICreate,
|
|
@@ -17,14 +17,19 @@ from .models import (
|
|
|
17
17
|
SnowflakeCredentials,
|
|
18
18
|
)
|
|
19
19
|
|
|
20
|
+
|
|
20
21
|
# TODO: Documentation (Google style)
|
|
21
22
|
# TODO: Add HTTP retries
|
|
22
23
|
|
|
23
24
|
|
|
24
25
|
class Client:
|
|
25
|
-
def __init__(self, env=
|
|
26
|
+
def __init__(self, env=None):
|
|
26
27
|
self._api_auth = None
|
|
27
|
-
self._base_url =
|
|
28
|
+
self._base_url = (
|
|
29
|
+
"https://api.cecil.earth"
|
|
30
|
+
if env is None
|
|
31
|
+
else f"https://{env}-api.cecil.earth"
|
|
32
|
+
)
|
|
28
33
|
self._snowflake_creds = None
|
|
29
34
|
|
|
30
35
|
def create_aoi(self, name: str, geometry: Dict) -> AOI:
|
|
@@ -96,11 +101,14 @@ class Client:
|
|
|
96
101
|
|
|
97
102
|
self._set_auth()
|
|
98
103
|
|
|
104
|
+
headers = {"cecil-python-sdk-version": __version__}
|
|
105
|
+
|
|
99
106
|
try:
|
|
100
107
|
r = requests.request(
|
|
101
108
|
method=method,
|
|
102
109
|
url=self._base_url + url,
|
|
103
110
|
auth=self._api_auth,
|
|
111
|
+
headers=headers,
|
|
104
112
|
timeout=None,
|
|
105
113
|
**kwargs,
|
|
106
114
|
)
|
|
@@ -8,14 +8,14 @@ FROZEN_TIME = "2024-01-01T00:00:00.000Z"
|
|
|
8
8
|
|
|
9
9
|
def test_client_class():
|
|
10
10
|
client = Client()
|
|
11
|
-
assert client._base_url == "https://
|
|
11
|
+
assert client._base_url == "https://api.cecil.earth"
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
@responses.activate
|
|
15
15
|
def test_client_create_data_request():
|
|
16
16
|
responses.add(
|
|
17
17
|
responses.POST,
|
|
18
|
-
"https://
|
|
18
|
+
"https://api.cecil.earth/v0/data-requests",
|
|
19
19
|
json={
|
|
20
20
|
"id": "id",
|
|
21
21
|
"aoiId": "aoi_id",
|
|
@@ -46,7 +46,7 @@ def test_client_create_data_request():
|
|
|
46
46
|
def test_client_list_data_requests():
|
|
47
47
|
responses.add(
|
|
48
48
|
responses.GET,
|
|
49
|
-
"https://
|
|
49
|
+
"https://api.cecil.earth/v0/data-requests",
|
|
50
50
|
json={
|
|
51
51
|
"records": [
|
|
52
52
|
{
|
cecil-0.0.8/__about__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.0.8"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|