cecil 0.0.8__py3-none-any.whl → 0.0.10__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.

Potentially problematic release.


This version of cecil might be problematic. Click here for more details.

cecil/client.py CHANGED
@@ -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="dev"):
26
+ def __init__(self, env=None):
26
27
  self._api_auth = None
27
- self._base_url = f"https://{env}-api.cecil.earth" # TODO: hard-code to prod 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
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cecil
3
- Version: 0.0.8
3
+ Version: 0.0.10
4
4
  Summary: Python SDK for Cecil Earth
5
5
  License-Expression: MIT
6
6
  License-File: LICENSE.txt
@@ -0,0 +1,7 @@
1
+ cecil/__init__.py,sha256=MF64bwUCd4sm3dvcxZnkb4ujHtxT_KeuXdD0nVieEt4,27
2
+ cecil/client.py,sha256=aXr6gho9NaZotpHcDmmO_XCdmfsUChyb6cKi1EC_aXc,4475
3
+ cecil/models.py,sha256=eSkDhHSCJyW9OsOkK7eMYh4BXY5FI1Z_THOLVLcE8QA,2027
4
+ cecil-0.0.10.dist-info/METADATA,sha256=ZCYjxeHDt69LzMZjkQdntRNIBLgEOpQyRYqX2pQ_6rw,2677
5
+ cecil-0.0.10.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
6
+ cecil-0.0.10.dist-info/licenses/LICENSE.txt,sha256=mUexcmfYx3bG1VIzAdQTOf_NzStYw6-QkKVdUY_d4i4,1066
7
+ cecil-0.0.10.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- cecil/__init__.py,sha256=MF64bwUCd4sm3dvcxZnkb4ujHtxT_KeuXdD0nVieEt4,27
2
- cecil/client.py,sha256=VEWL90sGYxcj4lkGBwT9k6H0v4rNPdvZy6iGHby7N40,4285
3
- cecil/models.py,sha256=eSkDhHSCJyW9OsOkK7eMYh4BXY5FI1Z_THOLVLcE8QA,2027
4
- cecil-0.0.8.dist-info/METADATA,sha256=tJldA9JEIjSvWNlTiKNBQI60r2jFvG6vEBjrnbt67-o,2676
5
- cecil-0.0.8.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
6
- cecil-0.0.8.dist-info/licenses/LICENSE.txt,sha256=mUexcmfYx3bG1VIzAdQTOf_NzStYw6-QkKVdUY_d4i4,1066
7
- cecil-0.0.8.dist-info/RECORD,,
File without changes