terrakio-admin-api 0.2.2__tar.gz → 0.5.13__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.
- terrakio_admin_api-0.5.13/.gitignore +166 -0
- terrakio_admin_api-0.5.13/PKG-INFO +53 -0
- {terrakio_admin_api-0.2.2 → terrakio_admin_api-0.5.13}/README.md +5 -5
- terrakio_admin_api-0.5.13/pyproject.toml +19 -0
- terrakio_admin_api-0.5.13/terrakio_admin_api/__init__.py +31 -0
- terrakio_admin_api-0.2.2/PKG-INFO +0 -69
- terrakio_admin_api-0.2.2/pyproject.toml +0 -30
- terrakio_admin_api-0.2.2/setup.cfg +0 -4
- terrakio_admin_api-0.2.2/setup.py +0 -26
- terrakio_admin_api-0.2.2/terrakio_admin_api/__init__.py +0 -53
- terrakio_admin_api-0.2.2/terrakio_admin_api.egg-info/PKG-INFO +0 -69
- terrakio_admin_api-0.2.2/terrakio_admin_api.egg-info/SOURCES.txt +0 -9
- terrakio_admin_api-0.2.2/terrakio_admin_api.egg-info/dependency_links.txt +0 -1
- terrakio_admin_api-0.2.2/terrakio_admin_api.egg-info/requires.txt +0 -1
- terrakio_admin_api-0.2.2/terrakio_admin_api.egg-info/top_level.txt +0 -1
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Python bytecode cache directories
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# Distribution / packaging
|
|
7
|
+
dist/
|
|
8
|
+
build/
|
|
9
|
+
*.egg-info/
|
|
10
|
+
*.egg
|
|
11
|
+
eggs/
|
|
12
|
+
lib/
|
|
13
|
+
lib64/
|
|
14
|
+
parts/
|
|
15
|
+
sdist/
|
|
16
|
+
var/
|
|
17
|
+
wheels/
|
|
18
|
+
*.dist-info/
|
|
19
|
+
|
|
20
|
+
# UV package manager
|
|
21
|
+
.python-version
|
|
22
|
+
.python-versions
|
|
23
|
+
|
|
24
|
+
# Virtual environments
|
|
25
|
+
venv/
|
|
26
|
+
env/
|
|
27
|
+
ENV/
|
|
28
|
+
.venv/
|
|
29
|
+
.env/
|
|
30
|
+
api_venv/
|
|
31
|
+
*.venv
|
|
32
|
+
virtualenv/
|
|
33
|
+
pipenv/
|
|
34
|
+
|
|
35
|
+
# PyInstaller
|
|
36
|
+
*.manifest
|
|
37
|
+
*.spec
|
|
38
|
+
|
|
39
|
+
# Installer logs
|
|
40
|
+
pip-log.txt
|
|
41
|
+
pip-delete-this-directory.txt
|
|
42
|
+
|
|
43
|
+
# Unit test / coverage reports
|
|
44
|
+
htmlcov/
|
|
45
|
+
.tox/
|
|
46
|
+
.nox/
|
|
47
|
+
.coverage
|
|
48
|
+
.coverage.*
|
|
49
|
+
.cache
|
|
50
|
+
nosetests.xml
|
|
51
|
+
coverage.xml
|
|
52
|
+
*.cover
|
|
53
|
+
*.py,cover
|
|
54
|
+
.hypothesis/
|
|
55
|
+
.pytest_cache/
|
|
56
|
+
|
|
57
|
+
# Jupyter Notebook
|
|
58
|
+
.ipynb_checkpoints
|
|
59
|
+
|
|
60
|
+
# IPython
|
|
61
|
+
profile_default/
|
|
62
|
+
ipython_config.py
|
|
63
|
+
|
|
64
|
+
# pyenv
|
|
65
|
+
.python-version
|
|
66
|
+
|
|
67
|
+
# pipenv
|
|
68
|
+
Pipfile.lock
|
|
69
|
+
|
|
70
|
+
# poetry
|
|
71
|
+
poetry.lock
|
|
72
|
+
|
|
73
|
+
# Celery
|
|
74
|
+
celerybeat-schedule
|
|
75
|
+
celerybeat.pid
|
|
76
|
+
|
|
77
|
+
# SageMath parsed files
|
|
78
|
+
*.sage.py
|
|
79
|
+
|
|
80
|
+
# Environments
|
|
81
|
+
.env
|
|
82
|
+
.env.local
|
|
83
|
+
.env.development.local
|
|
84
|
+
.env.test.local
|
|
85
|
+
.env.production.local
|
|
86
|
+
|
|
87
|
+
# mypy
|
|
88
|
+
.mypy_cache/
|
|
89
|
+
.dmypy.json
|
|
90
|
+
dmypy.json
|
|
91
|
+
|
|
92
|
+
# Pyre type checker
|
|
93
|
+
.pyre/
|
|
94
|
+
|
|
95
|
+
# pytype static type analyzer
|
|
96
|
+
.pytype/
|
|
97
|
+
|
|
98
|
+
# IDE specific files
|
|
99
|
+
.idea/
|
|
100
|
+
.vscode/
|
|
101
|
+
*.swp
|
|
102
|
+
*.swo
|
|
103
|
+
*~
|
|
104
|
+
|
|
105
|
+
# OS specific files
|
|
106
|
+
.DS_Store
|
|
107
|
+
.DS_Store?
|
|
108
|
+
Thumbs.db
|
|
109
|
+
ehthumbs.db
|
|
110
|
+
Desktop.ini
|
|
111
|
+
|
|
112
|
+
# macOS specific files
|
|
113
|
+
.AppleDouble
|
|
114
|
+
.LSOverride
|
|
115
|
+
Icon
|
|
116
|
+
._*
|
|
117
|
+
.DocumentRevisions-V100
|
|
118
|
+
.fseventsd
|
|
119
|
+
.Spotlight-V100
|
|
120
|
+
.TemporaryItems
|
|
121
|
+
.Trashes
|
|
122
|
+
.VolumeIcon.icns
|
|
123
|
+
.com.apple.timemachine.donotpresent
|
|
124
|
+
|
|
125
|
+
# Windows specific files
|
|
126
|
+
Thumbs.db
|
|
127
|
+
ehthumbs.db
|
|
128
|
+
Desktop.ini
|
|
129
|
+
$RECYCLE.BIN/
|
|
130
|
+
*.cab
|
|
131
|
+
*.msi
|
|
132
|
+
*.msix
|
|
133
|
+
*.msm
|
|
134
|
+
*.msp
|
|
135
|
+
*.lnk
|
|
136
|
+
|
|
137
|
+
# Linux specific files
|
|
138
|
+
*~
|
|
139
|
+
.fuse_hidden*
|
|
140
|
+
.directory
|
|
141
|
+
.Trash-*
|
|
142
|
+
.nfs*
|
|
143
|
+
|
|
144
|
+
# Temporary files
|
|
145
|
+
*.tmp
|
|
146
|
+
*.temp
|
|
147
|
+
*.log
|
|
148
|
+
*.bak
|
|
149
|
+
*.swp
|
|
150
|
+
*.swo
|
|
151
|
+
|
|
152
|
+
# Local configuration files
|
|
153
|
+
.local/
|
|
154
|
+
local_settings.py
|
|
155
|
+
instance/
|
|
156
|
+
.webassets-cache
|
|
157
|
+
|
|
158
|
+
# Database files
|
|
159
|
+
*.db
|
|
160
|
+
*.sqlite3
|
|
161
|
+
*.sqlite
|
|
162
|
+
|
|
163
|
+
# Secrets and sensitive files
|
|
164
|
+
.secrets/
|
|
165
|
+
secrets.json
|
|
166
|
+
.env.secrets
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: terrakio-admin-api
|
|
3
|
+
Version: 0.5.13
|
|
4
|
+
Summary: Admin version of the terrakio-python-api
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Requires-Dist: terrakio-core==0.5.13
|
|
7
|
+
Description-Content-Type: text/markdown
|
|
8
|
+
|
|
9
|
+
# Terrakio Admin API Client
|
|
10
|
+
|
|
11
|
+
Administrative API client for Terrakio services. This package extends the regular Terrakio API client with additional administrative capabilities.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- All features from the regular API client
|
|
16
|
+
- User management (create, view, edit, delete users)
|
|
17
|
+
- Dataset management (create, edit, update, delete datasets)
|
|
18
|
+
- Mass stats functionality (create pyramid)
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install terrakio-admin-api
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage Example
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
from terrakio_admin_api import Client
|
|
30
|
+
|
|
31
|
+
# Initialize the admin client, default url is https://api.terrak.io
|
|
32
|
+
admin_client = Client(url = "https://dev-au.terrak.io")
|
|
33
|
+
|
|
34
|
+
# Login to your admin account
|
|
35
|
+
token = admin_client.auth.login(email = "XXX", password = "XXX")
|
|
36
|
+
print(f"✓ Login successful, personal token: {token[:10]}...")
|
|
37
|
+
|
|
38
|
+
# The login account will automatically be used for the requests
|
|
39
|
+
|
|
40
|
+
# View API key
|
|
41
|
+
api_key = admin_client.auth.view_api_key()
|
|
42
|
+
print(f"✓ Current API key: {api_key[:10]}...")
|
|
43
|
+
|
|
44
|
+
# List number of datasets
|
|
45
|
+
datasets = admin_client.datasets.list_datasets()
|
|
46
|
+
print(f"✓ Listed {len(datasets)} datasets")
|
|
47
|
+
|
|
48
|
+
# List number of users
|
|
49
|
+
users = admin_client.users.list_users()
|
|
50
|
+
print(f"✓ Listed {len(users)} users")
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
For more documentation, see the [main repository](https://github.com/HaizeaAnalytics/terrakio-python-api).
|
|
@@ -21,24 +21,24 @@ pip install terrakio-admin-api
|
|
|
21
21
|
from terrakio_admin_api import Client
|
|
22
22
|
|
|
23
23
|
# Initialize the admin client, default url is https://api.terrak.io
|
|
24
|
-
admin_client = Client()
|
|
24
|
+
admin_client = Client(url = "https://dev-au.terrak.io")
|
|
25
25
|
|
|
26
26
|
# Login to your admin account
|
|
27
|
-
token = admin_client.login(email = "XXX", password = "XXX")
|
|
27
|
+
token = admin_client.auth.login(email = "XXX", password = "XXX")
|
|
28
28
|
print(f"✓ Login successful, personal token: {token[:10]}...")
|
|
29
29
|
|
|
30
30
|
# The login account will automatically be used for the requests
|
|
31
31
|
|
|
32
32
|
# View API key
|
|
33
|
-
api_key = admin_client.view_api_key()
|
|
33
|
+
api_key = admin_client.auth.view_api_key()
|
|
34
34
|
print(f"✓ Current API key: {api_key[:10]}...")
|
|
35
35
|
|
|
36
36
|
# List number of datasets
|
|
37
|
-
datasets = admin_client.list_datasets()
|
|
37
|
+
datasets = admin_client.datasets.list_datasets()
|
|
38
38
|
print(f"✓ Listed {len(datasets)} datasets")
|
|
39
39
|
|
|
40
40
|
# List number of users
|
|
41
|
-
users = admin_client.list_users()
|
|
41
|
+
users = admin_client.users.list_users()
|
|
42
42
|
print(f"✓ Listed {len(users)} users")
|
|
43
43
|
```
|
|
44
44
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "terrakio-admin-api"
|
|
3
|
+
version = "0.5.13"
|
|
4
|
+
description = "Admin version of the terrakio-python-api"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11"
|
|
7
|
+
dependencies = [
|
|
8
|
+
"terrakio-core==0.5.13",
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
[build-system]
|
|
12
|
+
requires = ["hatchling"]
|
|
13
|
+
build-backend = "hatchling.build"
|
|
14
|
+
|
|
15
|
+
[tool.hatch.build.targets.wheel]
|
|
16
|
+
packages = ["terrakio_admin_api"]
|
|
17
|
+
|
|
18
|
+
[tool.uv.sources]
|
|
19
|
+
terrakio-core = { workspace = true }
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# terrakio_admin/__init__.py
|
|
2
|
+
"""
|
|
3
|
+
Terrakio Admin API Client
|
|
4
|
+
|
|
5
|
+
An admin API client for Terrakio.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
# Suppress ONNX Runtime GPU device discovery warnings - MUST BE FIRST!
|
|
9
|
+
import os
|
|
10
|
+
os.environ['ORT_LOGGING_LEVEL'] = '3'
|
|
11
|
+
__version__ = "0.5.13"
|
|
12
|
+
|
|
13
|
+
from terrakio_core import AsyncClient as CoreAsyncClient
|
|
14
|
+
from terrakio_core import Client as CoreClient
|
|
15
|
+
from terrakio_core.endpoints.group_management import GroupManagement
|
|
16
|
+
from terrakio_core.sync_client import SyncWrapper
|
|
17
|
+
|
|
18
|
+
class AsyncClient(CoreAsyncClient):
|
|
19
|
+
def __init__(self, *args, **kwargs):
|
|
20
|
+
super().__init__(*args, **kwargs)
|
|
21
|
+
self.groups = GroupManagement(self)
|
|
22
|
+
|
|
23
|
+
class Client(CoreClient):
|
|
24
|
+
"""Synchronous version of the Terrakio Admin API client with full admin permissions."""
|
|
25
|
+
|
|
26
|
+
def __init__(self, *args, **kwargs):
|
|
27
|
+
super().__init__(*args, **kwargs)
|
|
28
|
+
self._async_client.groups = GroupManagement(self._async_client)
|
|
29
|
+
self.groups = SyncWrapper(self._async_client.groups, self)
|
|
30
|
+
|
|
31
|
+
__all__ = ['AsyncClient', 'Client']
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: terrakio-admin-api
|
|
3
|
-
Version: 0.2.2
|
|
4
|
-
Summary: Admin API client for Terrakio services
|
|
5
|
-
Home-page: https://github.com/HaizeaAnalytics/terrakio-python-api
|
|
6
|
-
Author: Yupeng Chao
|
|
7
|
-
Author-email: Yupeng Chao <yupeng@haizea.com.au>
|
|
8
|
-
Project-URL: Homepage, https://github.com/HaizeaAnalytics/terrakio-python-api
|
|
9
|
-
Project-URL: Bug Tracker, https://github.com/HaizeaAnalytics/terrakio-python-api/issues
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
-
Classifier: Operating System :: OS Independent
|
|
17
|
-
Classifier: Development Status :: 4 - Beta
|
|
18
|
-
Requires-Python: >=3.7
|
|
19
|
-
Description-Content-Type: text/markdown
|
|
20
|
-
Requires-Dist: terrakio-core>=0.1.0
|
|
21
|
-
Dynamic: author
|
|
22
|
-
Dynamic: home-page
|
|
23
|
-
Dynamic: requires-python
|
|
24
|
-
|
|
25
|
-
# Terrakio Admin API Client
|
|
26
|
-
|
|
27
|
-
Administrative API client for Terrakio services. This package extends the regular Terrakio API client with additional administrative capabilities.
|
|
28
|
-
|
|
29
|
-
## Features
|
|
30
|
-
|
|
31
|
-
- All features from the regular API client
|
|
32
|
-
- User management (create, view, edit, delete users)
|
|
33
|
-
- Dataset management (create, edit, update, delete datasets)
|
|
34
|
-
- Mass stats functionality (create pyramid)
|
|
35
|
-
|
|
36
|
-
## Installation
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
pip install terrakio-admin-api
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Usage Example
|
|
43
|
-
|
|
44
|
-
```python
|
|
45
|
-
from terrakio_admin_api import Client
|
|
46
|
-
|
|
47
|
-
# Initialize the admin client, default url is https://api.terrak.io
|
|
48
|
-
admin_client = Client()
|
|
49
|
-
|
|
50
|
-
# Login to your admin account
|
|
51
|
-
token = admin_client.login(email = "XXX", password = "XXX")
|
|
52
|
-
print(f"✓ Login successful, personal token: {token[:10]}...")
|
|
53
|
-
|
|
54
|
-
# The login account will automatically be used for the requests
|
|
55
|
-
|
|
56
|
-
# View API key
|
|
57
|
-
api_key = admin_client.view_api_key()
|
|
58
|
-
print(f"✓ Current API key: {api_key[:10]}...")
|
|
59
|
-
|
|
60
|
-
# List number of datasets
|
|
61
|
-
datasets = admin_client.list_datasets()
|
|
62
|
-
print(f"✓ Listed {len(datasets)} datasets")
|
|
63
|
-
|
|
64
|
-
# List number of users
|
|
65
|
-
users = admin_client.list_users()
|
|
66
|
-
print(f"✓ Listed {len(users)} users")
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
For more documentation, see the [main repository](https://github.com/HaizeaAnalytics/terrakio-python-api).
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools>=61.0"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "terrakio-admin-api"
|
|
7
|
-
version = "0.2.2"
|
|
8
|
-
authors = [
|
|
9
|
-
{name = "Yupeng Chao", email = "yupeng@haizea.com.au"},
|
|
10
|
-
]
|
|
11
|
-
description = "Admin API client for Terrakio services"
|
|
12
|
-
readme = "README.md"
|
|
13
|
-
requires-python = ">=3.7"
|
|
14
|
-
classifiers = [
|
|
15
|
-
"Programming Language :: Python :: 3",
|
|
16
|
-
"Programming Language :: Python :: 3.7",
|
|
17
|
-
"Programming Language :: Python :: 3.8",
|
|
18
|
-
"Programming Language :: Python :: 3.9",
|
|
19
|
-
"Programming Language :: Python :: 3.10",
|
|
20
|
-
"License :: OSI Approved :: MIT License",
|
|
21
|
-
"Operating System :: OS Independent",
|
|
22
|
-
"Development Status :: 4 - Beta",
|
|
23
|
-
]
|
|
24
|
-
dependencies = [
|
|
25
|
-
"terrakio-core>=0.1.0",
|
|
26
|
-
]
|
|
27
|
-
|
|
28
|
-
[project.urls]
|
|
29
|
-
"Homepage" = "https://github.com/HaizeaAnalytics/terrakio-python-api"
|
|
30
|
-
"Bug Tracker" = "https://github.com/HaizeaAnalytics/terrakio-python-api/issues"
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
from setuptools import setup
|
|
2
|
-
|
|
3
|
-
setup(
|
|
4
|
-
name="terrakio_admin_api",
|
|
5
|
-
version="0.2.2",
|
|
6
|
-
author="Yupeng Chao",
|
|
7
|
-
author_email="yupeng@haizea.com.au",
|
|
8
|
-
description="Admin API client for Terrakio services",
|
|
9
|
-
url="https://github.com/HaizeaAnalytics/terrakio-python-api",
|
|
10
|
-
packages=["terrakio_admin_api"],
|
|
11
|
-
classifiers=[
|
|
12
|
-
"Programming Language :: Python :: 3",
|
|
13
|
-
"Programming Language :: Python :: 3.7",
|
|
14
|
-
"Programming Language :: Python :: 3.8",
|
|
15
|
-
"Programming Language :: Python :: 3.9",
|
|
16
|
-
"Programming Language :: Python :: 3.10",
|
|
17
|
-
"License :: OSI Approved :: MIT License",
|
|
18
|
-
"Operating System :: OS Independent",
|
|
19
|
-
"Development Status :: 4 - Beta",
|
|
20
|
-
],
|
|
21
|
-
python_requires=">=3.7",
|
|
22
|
-
install_requires=[
|
|
23
|
-
"terrakio-core>=0.1.0",
|
|
24
|
-
],
|
|
25
|
-
metadata_version='2.2'
|
|
26
|
-
)
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Terrakio Admin API Client
|
|
3
|
-
|
|
4
|
-
A Python client for administrators to access Terrakio's administrative API.
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
|
-
__version__ = "0.1.0"
|
|
8
|
-
|
|
9
|
-
from terrakio_core.client import BaseClient
|
|
10
|
-
|
|
11
|
-
class Client(BaseClient):
|
|
12
|
-
# Expose admin methods as public
|
|
13
|
-
def get_user_by_id(self, user_id: str):
|
|
14
|
-
return self._get_user_by_id(user_id)
|
|
15
|
-
|
|
16
|
-
def get_user_by_email(self, email: str):
|
|
17
|
-
return self._get_user_by_email(email)
|
|
18
|
-
|
|
19
|
-
def list_users(self, substring: str = None, uid: bool = False):
|
|
20
|
-
return self._list_users(substring, uid)
|
|
21
|
-
|
|
22
|
-
def edit_user(self, user_id: str, uid: str = None, email: str = None, role: str = None, apiKey: str = None, groups: list = None, quota: int = None):
|
|
23
|
-
return self._edit_user(user_id, uid, email, role, apiKey, groups, quota)
|
|
24
|
-
|
|
25
|
-
def reset_quota(self, email: str, quota: int = None):
|
|
26
|
-
return self._reset_quota(email, quota)
|
|
27
|
-
|
|
28
|
-
def delete_user(self, uid: str):
|
|
29
|
-
return self._delete_user(uid)
|
|
30
|
-
|
|
31
|
-
# Expose dataset management methods as public
|
|
32
|
-
def get_dataset(self, name: str, collection: str = "terrakio-datasets"):
|
|
33
|
-
return self._get_dataset(name, collection)
|
|
34
|
-
|
|
35
|
-
def list_datasets(self, substring: str = None, collection: str = "terrakio-datasets"):
|
|
36
|
-
return self._list_datasets(substring, collection)
|
|
37
|
-
|
|
38
|
-
def create_dataset(self, name: str, collection: str = "terrakio-datasets", **kwargs):
|
|
39
|
-
return self._create_dataset(name, collection, **kwargs)
|
|
40
|
-
|
|
41
|
-
def update_dataset(self, name: str, append: bool = True, collection: str = "terrakio-datasets", **kwargs):
|
|
42
|
-
return self._update_dataset(name, append, collection, **kwargs)
|
|
43
|
-
|
|
44
|
-
def overwrite_dataset(self, name: str, collection: str = "terrakio-datasets", **kwargs):
|
|
45
|
-
return self._overwrite_dataset(name, collection, **kwargs)
|
|
46
|
-
|
|
47
|
-
def delete_dataset(self, name: str, collection: str = "terrakio-datasets"):
|
|
48
|
-
return self._delete_dataset(name, collection)
|
|
49
|
-
|
|
50
|
-
__all__ = [
|
|
51
|
-
'Client'
|
|
52
|
-
]
|
|
53
|
-
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: terrakio-admin-api
|
|
3
|
-
Version: 0.2.2
|
|
4
|
-
Summary: Admin API client for Terrakio services
|
|
5
|
-
Home-page: https://github.com/HaizeaAnalytics/terrakio-python-api
|
|
6
|
-
Author: Yupeng Chao
|
|
7
|
-
Author-email: Yupeng Chao <yupeng@haizea.com.au>
|
|
8
|
-
Project-URL: Homepage, https://github.com/HaizeaAnalytics/terrakio-python-api
|
|
9
|
-
Project-URL: Bug Tracker, https://github.com/HaizeaAnalytics/terrakio-python-api/issues
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
-
Classifier: Operating System :: OS Independent
|
|
17
|
-
Classifier: Development Status :: 4 - Beta
|
|
18
|
-
Requires-Python: >=3.7
|
|
19
|
-
Description-Content-Type: text/markdown
|
|
20
|
-
Requires-Dist: terrakio-core>=0.1.0
|
|
21
|
-
Dynamic: author
|
|
22
|
-
Dynamic: home-page
|
|
23
|
-
Dynamic: requires-python
|
|
24
|
-
|
|
25
|
-
# Terrakio Admin API Client
|
|
26
|
-
|
|
27
|
-
Administrative API client for Terrakio services. This package extends the regular Terrakio API client with additional administrative capabilities.
|
|
28
|
-
|
|
29
|
-
## Features
|
|
30
|
-
|
|
31
|
-
- All features from the regular API client
|
|
32
|
-
- User management (create, view, edit, delete users)
|
|
33
|
-
- Dataset management (create, edit, update, delete datasets)
|
|
34
|
-
- Mass stats functionality (create pyramid)
|
|
35
|
-
|
|
36
|
-
## Installation
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
pip install terrakio-admin-api
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Usage Example
|
|
43
|
-
|
|
44
|
-
```python
|
|
45
|
-
from terrakio_admin_api import Client
|
|
46
|
-
|
|
47
|
-
# Initialize the admin client, default url is https://api.terrak.io
|
|
48
|
-
admin_client = Client()
|
|
49
|
-
|
|
50
|
-
# Login to your admin account
|
|
51
|
-
token = admin_client.login(email = "XXX", password = "XXX")
|
|
52
|
-
print(f"✓ Login successful, personal token: {token[:10]}...")
|
|
53
|
-
|
|
54
|
-
# The login account will automatically be used for the requests
|
|
55
|
-
|
|
56
|
-
# View API key
|
|
57
|
-
api_key = admin_client.view_api_key()
|
|
58
|
-
print(f"✓ Current API key: {api_key[:10]}...")
|
|
59
|
-
|
|
60
|
-
# List number of datasets
|
|
61
|
-
datasets = admin_client.list_datasets()
|
|
62
|
-
print(f"✓ Listed {len(datasets)} datasets")
|
|
63
|
-
|
|
64
|
-
# List number of users
|
|
65
|
-
users = admin_client.list_users()
|
|
66
|
-
print(f"✓ Listed {len(users)} users")
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
For more documentation, see the [main repository](https://github.com/HaizeaAnalytics/terrakio-python-api).
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
README.md
|
|
2
|
-
pyproject.toml
|
|
3
|
-
setup.py
|
|
4
|
-
terrakio_admin_api/__init__.py
|
|
5
|
-
terrakio_admin_api.egg-info/PKG-INFO
|
|
6
|
-
terrakio_admin_api.egg-info/SOURCES.txt
|
|
7
|
-
terrakio_admin_api.egg-info/dependency_links.txt
|
|
8
|
-
terrakio_admin_api.egg-info/requires.txt
|
|
9
|
-
terrakio_admin_api.egg-info/top_level.txt
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
terrakio-core>=0.1.0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
terrakio_admin_api
|