datacrunch 1.15.0__tar.gz → 1.17.1__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.
- datacrunch-1.17.1/PKG-INFO +30 -0
- datacrunch-1.17.1/README.md +5 -0
- datacrunch-1.17.1/datacrunch/__init__.py +53 -0
- datacrunch-1.17.1/datacrunch/datacrunch.py +44 -0
- datacrunch-1.17.1/pyproject.toml +49 -0
- datacrunch-1.15.0/LICENSE +0 -21
- datacrunch-1.15.0/PKG-INFO +0 -208
- datacrunch-1.15.0/README.md +0 -168
- datacrunch-1.15.0/datacrunch/InferenceClient/__init__.py +0 -3
- datacrunch-1.15.0/datacrunch/InferenceClient/inference_client.py +0 -379
- datacrunch-1.15.0/datacrunch/__init__.py +0 -1
- datacrunch-1.15.0/datacrunch/__version__.py +0 -1
- datacrunch-1.15.0/datacrunch/authentication/__init__.py +0 -0
- datacrunch-1.15.0/datacrunch/authentication/authentication.py +0 -112
- datacrunch-1.15.0/datacrunch/balance/__init__.py +0 -0
- datacrunch-1.15.0/datacrunch/balance/balance.py +0 -52
- datacrunch-1.15.0/datacrunch/constants.py +0 -107
- datacrunch-1.15.0/datacrunch/containers/__init__.py +0 -33
- datacrunch-1.15.0/datacrunch/containers/containers.py +0 -1081
- datacrunch-1.15.0/datacrunch/datacrunch.py +0 -81
- datacrunch-1.15.0/datacrunch/exceptions.py +0 -29
- datacrunch-1.15.0/datacrunch/helpers.py +0 -13
- datacrunch-1.15.0/datacrunch/http_client/__init__.py +0 -0
- datacrunch-1.15.0/datacrunch/http_client/http_client.py +0 -241
- datacrunch-1.15.0/datacrunch/images/__init__.py +0 -0
- datacrunch-1.15.0/datacrunch/images/images.py +0 -87
- datacrunch-1.15.0/datacrunch/instance_types/__init__.py +0 -0
- datacrunch-1.15.0/datacrunch/instance_types/instance_types.py +0 -188
- datacrunch-1.15.0/datacrunch/instances/__init__.py +0 -0
- datacrunch-1.15.0/datacrunch/instances/instances.py +0 -247
- datacrunch-1.15.0/datacrunch/locations/__init__.py +0 -0
- datacrunch-1.15.0/datacrunch/locations/locations.py +0 -16
- datacrunch-1.15.0/datacrunch/ssh_keys/__init__.py +0 -0
- datacrunch-1.15.0/datacrunch/ssh_keys/ssh_keys.py +0 -112
- datacrunch-1.15.0/datacrunch/startup_scripts/__init__.py +0 -0
- datacrunch-1.15.0/datacrunch/startup_scripts/startup_scripts.py +0 -113
- datacrunch-1.15.0/datacrunch/volume_types/__init__.py +0 -0
- datacrunch-1.15.0/datacrunch/volume_types/volume_types.py +0 -66
- datacrunch-1.15.0/datacrunch/volumes/__init__.py +0 -0
- datacrunch-1.15.0/datacrunch/volumes/volumes.py +0 -398
- datacrunch-1.15.0/datacrunch.egg-info/PKG-INFO +0 -208
- datacrunch-1.15.0/datacrunch.egg-info/SOURCES.txt +0 -72
- datacrunch-1.15.0/datacrunch.egg-info/dependency_links.txt +0 -1
- datacrunch-1.15.0/datacrunch.egg-info/requires.txt +0 -10
- datacrunch-1.15.0/datacrunch.egg-info/top_level.txt +0 -2
- datacrunch-1.15.0/setup.cfg +0 -4
- datacrunch-1.15.0/setup.py +0 -44
- datacrunch-1.15.0/tests/__init__.py +0 -0
- datacrunch-1.15.0/tests/integration_tests/__init__.py +0 -0
- datacrunch-1.15.0/tests/integration_tests/conftest.py +0 -20
- datacrunch-1.15.0/tests/integration_tests/test_instances.py +0 -36
- datacrunch-1.15.0/tests/integration_tests/test_locations.py +0 -65
- datacrunch-1.15.0/tests/integration_tests/test_volumes.py +0 -94
- datacrunch-1.15.0/tests/unit_tests/__init__.py +0 -0
- datacrunch-1.15.0/tests/unit_tests/authentication/__init__.py +0 -0
- datacrunch-1.15.0/tests/unit_tests/authentication/test_authentication.py +0 -202
- datacrunch-1.15.0/tests/unit_tests/balance/__init__.py +0 -0
- datacrunch-1.15.0/tests/unit_tests/balance/test_balance.py +0 -25
- datacrunch-1.15.0/tests/unit_tests/conftest.py +0 -21
- datacrunch-1.15.0/tests/unit_tests/containers/__init__.py +0 -1
- datacrunch-1.15.0/tests/unit_tests/containers/test_containers.py +0 -959
- datacrunch-1.15.0/tests/unit_tests/http_client/__init__.py +0 -0
- datacrunch-1.15.0/tests/unit_tests/http_client/test_http_client.py +0 -193
- datacrunch-1.15.0/tests/unit_tests/images/__init__.py +0 -0
- datacrunch-1.15.0/tests/unit_tests/images/test_images.py +0 -41
- datacrunch-1.15.0/tests/unit_tests/instance_types/__init__.py +0 -0
- datacrunch-1.15.0/tests/unit_tests/instance_types/test_instance_types.py +0 -87
- datacrunch-1.15.0/tests/unit_tests/instances/__init__.py +0 -0
- datacrunch-1.15.0/tests/unit_tests/instances/test_instances.py +0 -483
- datacrunch-1.15.0/tests/unit_tests/ssh_keys/__init__.py +0 -0
- datacrunch-1.15.0/tests/unit_tests/ssh_keys/test_ssh_keys.py +0 -198
- datacrunch-1.15.0/tests/unit_tests/startup_scripts/__init__.py +0 -0
- datacrunch-1.15.0/tests/unit_tests/startup_scripts/test_startup_scripts.py +0 -196
- datacrunch-1.15.0/tests/unit_tests/test_datacrunch.py +0 -65
- datacrunch-1.15.0/tests/unit_tests/test_exceptions.py +0 -33
- datacrunch-1.15.0/tests/unit_tests/volume_types/__init__.py +0 -0
- datacrunch-1.15.0/tests/unit_tests/volume_types/test_volume_types.py +0 -50
- datacrunch-1.15.0/tests/unit_tests/volumes/__init__.py +0 -0
- datacrunch-1.15.0/tests/unit_tests/volumes/test_volumes.py +0 -641
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: datacrunch
|
|
3
|
+
Version: 1.17.1
|
|
4
|
+
Summary: datacrunch is now verda
|
|
5
|
+
Author: Verda Cloud Oy
|
|
6
|
+
Author-email: Verda Cloud Oy <info@verda.com>
|
|
7
|
+
Classifier: Development Status :: 7 - Inactive
|
|
8
|
+
Classifier: Intended Audience :: Developers
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Natural Language :: English
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
18
|
+
Requires-Dist: verda==1.17.1
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Project-URL: Changelog, https://github.com/verda-cloud/sdk-python/blob/master/CHANGELOG.md
|
|
21
|
+
Project-URL: Documentation, https://datacrunch-python.readthedocs.io/
|
|
22
|
+
Project-URL: Homepage, https://github.com/verda-cloud
|
|
23
|
+
Project-URL: Repository, https://github.com/verda-cloud/sdk-python
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
|
|
26
|
+
# datacrunch is now verda
|
|
27
|
+
|
|
28
|
+
This package has been [renamed](https://verda.com/blog/datacrunch-is-changing-its-name-to-verda). Use `pip install verda` or `uv add verda` instead.
|
|
29
|
+
|
|
30
|
+
New package: https://pypi.org/project/verda/
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Compatibility layer for deprecated `datacrunch` package
|
|
2
|
+
|
|
3
|
+
from verda import (
|
|
4
|
+
InferenceClient,
|
|
5
|
+
__version__,
|
|
6
|
+
authentication,
|
|
7
|
+
balance,
|
|
8
|
+
constants,
|
|
9
|
+
containers,
|
|
10
|
+
exceptions,
|
|
11
|
+
helpers,
|
|
12
|
+
http_client,
|
|
13
|
+
images,
|
|
14
|
+
instance_types,
|
|
15
|
+
instances,
|
|
16
|
+
locations,
|
|
17
|
+
ssh_keys,
|
|
18
|
+
startup_scripts,
|
|
19
|
+
volume_types,
|
|
20
|
+
volumes,
|
|
21
|
+
)
|
|
22
|
+
from verda import VerdaClient as DataCrunchClient
|
|
23
|
+
|
|
24
|
+
# For old `from datacrunch import *``
|
|
25
|
+
__all__ = [
|
|
26
|
+
'DataCrunchClient',
|
|
27
|
+
'InferenceClient',
|
|
28
|
+
'__version__',
|
|
29
|
+
'authentication',
|
|
30
|
+
'balance',
|
|
31
|
+
'constants',
|
|
32
|
+
'containers',
|
|
33
|
+
'datacrunch',
|
|
34
|
+
'exceptions',
|
|
35
|
+
'helpers',
|
|
36
|
+
'http_client',
|
|
37
|
+
'images',
|
|
38
|
+
'instance_types',
|
|
39
|
+
'instances',
|
|
40
|
+
'locations',
|
|
41
|
+
'ssh_keys',
|
|
42
|
+
'startup_scripts',
|
|
43
|
+
'volume_types',
|
|
44
|
+
'volumes',
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
import warnings
|
|
48
|
+
|
|
49
|
+
warnings.warn(
|
|
50
|
+
'datacrunch is deprecated; use verda package instead: https://github.com/verda-cloud/sdk-python/blob/master/CHANGELOG.md#1170---2025-11-26',
|
|
51
|
+
DeprecationWarning,
|
|
52
|
+
stacklevel=2,
|
|
53
|
+
)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Compatibility layer for deprecated `datacrunch.datacrunch` package
|
|
2
|
+
|
|
3
|
+
from verda import VerdaClient as DataCrunchClient
|
|
4
|
+
from verda._version import __version__
|
|
5
|
+
from verda.authentication.authentication import AuthenticationService
|
|
6
|
+
from verda.balance.balance import BalanceService
|
|
7
|
+
from verda.constants import Constants
|
|
8
|
+
from verda.containers.containers import ContainersService
|
|
9
|
+
from verda.http_client.http_client import HTTPClient
|
|
10
|
+
from verda.images.images import ImagesService
|
|
11
|
+
from verda.instance_types.instance_types import InstanceTypesService
|
|
12
|
+
from verda.instances.instances import InstancesService
|
|
13
|
+
from verda.locations.locations import LocationsService
|
|
14
|
+
from verda.ssh_keys.ssh_keys import SSHKeysService
|
|
15
|
+
from verda.startup_scripts.startup_scripts import StartupScriptsService
|
|
16
|
+
from verda.volume_types.volume_types import VolumeTypesService
|
|
17
|
+
from verda.volumes.volumes import VolumesService
|
|
18
|
+
|
|
19
|
+
# for `from datacrunch.datacrunch import *`
|
|
20
|
+
__all__ = [
|
|
21
|
+
'AuthenticationService',
|
|
22
|
+
'BalanceService',
|
|
23
|
+
'Constants',
|
|
24
|
+
'ContainersService',
|
|
25
|
+
'DataCrunchClient',
|
|
26
|
+
'HTTPClient',
|
|
27
|
+
'ImagesService',
|
|
28
|
+
'InstanceTypesService',
|
|
29
|
+
'InstancesService',
|
|
30
|
+
'LocationsService',
|
|
31
|
+
'SSHKeysService',
|
|
32
|
+
'StartupScriptsService',
|
|
33
|
+
'VolumeTypesService',
|
|
34
|
+
'VolumesService',
|
|
35
|
+
'__version__',
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
import warnings
|
|
39
|
+
|
|
40
|
+
warnings.warn(
|
|
41
|
+
'datacrunch is deprecated; use verda package instead: https://github.com/verda-cloud/sdk-python/blob/master/CHANGELOG.md#1170---2025-11-26',
|
|
42
|
+
DeprecationWarning,
|
|
43
|
+
stacklevel=2,
|
|
44
|
+
)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "datacrunch"
|
|
3
|
+
version = "1.17.1" # version will be set by .github/workflows/publish.yml before release
|
|
4
|
+
description = "datacrunch is now verda"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10"
|
|
7
|
+
|
|
8
|
+
authors = [{ name = "Verda Cloud Oy", email = "info@verda.com" }]
|
|
9
|
+
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Development Status :: 7 - Inactive",
|
|
12
|
+
"Intended Audience :: Developers",
|
|
13
|
+
"License :: OSI Approved :: MIT License",
|
|
14
|
+
"Natural Language :: English",
|
|
15
|
+
"Operating System :: OS Independent",
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"Programming Language :: Python :: 3.10",
|
|
18
|
+
"Programming Language :: Python :: 3.11",
|
|
19
|
+
"Programming Language :: Python :: 3.12",
|
|
20
|
+
"Programming Language :: Python :: 3.13",
|
|
21
|
+
"Programming Language :: Python :: 3.14",
|
|
22
|
+
]
|
|
23
|
+
dependencies = [
|
|
24
|
+
"verda==1.17.1",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[project.urls]
|
|
28
|
+
Homepage = "https://github.com/verda-cloud"
|
|
29
|
+
Documentation = "https://datacrunch-python.readthedocs.io/"
|
|
30
|
+
Repository = "https://github.com/verda-cloud/sdk-python"
|
|
31
|
+
Changelog = "https://github.com/verda-cloud/sdk-python/blob/master/CHANGELOG.md"
|
|
32
|
+
|
|
33
|
+
[build-system]
|
|
34
|
+
requires = ["uv_build>=0.9.5,<0.10.0"]
|
|
35
|
+
build-backend = "uv_build"
|
|
36
|
+
|
|
37
|
+
[tool.uv.build-backend]
|
|
38
|
+
module-name = "datacrunch"
|
|
39
|
+
module-root = ""
|
|
40
|
+
|
|
41
|
+
[tool.uv.sources]
|
|
42
|
+
verda = { workspace = true }
|
|
43
|
+
|
|
44
|
+
[dependency-groups]
|
|
45
|
+
dev = [
|
|
46
|
+
"pytest>=8.1,<9",
|
|
47
|
+
"pytest-responses>=0.5.1",
|
|
48
|
+
"responses>=0.25.8",
|
|
49
|
+
]
|
datacrunch-1.15.0/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 DataCrunch Oy
|
|
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.
|
datacrunch-1.15.0/PKG-INFO
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: datacrunch
|
|
3
|
-
Version: 1.15.0
|
|
4
|
-
Summary: Official Python SDK for DataCrunch Public API
|
|
5
|
-
Home-page: https://github.com/DataCrunch-io
|
|
6
|
-
Author: DataCrunch Oy
|
|
7
|
-
Author-email: info@datacrunch.io
|
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
13
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
-
Classifier: Operating System :: OS Independent
|
|
17
|
-
Classifier: Natural Language :: English
|
|
18
|
-
Requires-Python: >=3.10
|
|
19
|
-
Description-Content-Type: text/markdown
|
|
20
|
-
License-File: LICENSE
|
|
21
|
-
Requires-Dist: requests<3,>=2.25.1
|
|
22
|
-
Requires-Dist: dataclasses_json>=0.6.7
|
|
23
|
-
Provides-Extra: dev
|
|
24
|
-
Provides-Extra: test
|
|
25
|
-
Requires-Dist: pytest<7,>=6.2.1; extra == "test"
|
|
26
|
-
Requires-Dist: pytest-cov<3,>=2.10.1; extra == "test"
|
|
27
|
-
Requires-Dist: pytest-responses<1,>=0.4.0; extra == "test"
|
|
28
|
-
Requires-Dist: responses<1,>=0.12.1; extra == "test"
|
|
29
|
-
Dynamic: author
|
|
30
|
-
Dynamic: author-email
|
|
31
|
-
Dynamic: classifier
|
|
32
|
-
Dynamic: description
|
|
33
|
-
Dynamic: description-content-type
|
|
34
|
-
Dynamic: home-page
|
|
35
|
-
Dynamic: license-file
|
|
36
|
-
Dynamic: provides-extra
|
|
37
|
-
Dynamic: requires-dist
|
|
38
|
-
Dynamic: requires-python
|
|
39
|
-
Dynamic: summary
|
|
40
|
-
|
|
41
|
-
# DataCrunch Python SDK
|
|
42
|
-
|
|
43
|
-
[<img src='https://github.com/DataCrunch-io/datacrunch-python/workflows/Unit%20Tests/badge.svg'>](https://github.com/DataCrunch-io/datacrunch-python/actions?query=workflow%3A%22Unit+Tests%22+branch%3Amaster)
|
|
44
|
-
[<img src='https://github.com/DataCrunch-io/datacrunch-python/workflows/Code%20Style/badge.svg'>](https://github.com/DataCrunch-io/datacrunch-python/actions?query=workflow%3A%22Code+Style%22+branch%3Amaster)
|
|
45
|
-
[<img src="https://codecov.io/gh/DataCrunch-io/datacrunch-python/branch/master/graph/badge.svg?token=5X5KTYSSPK">](https://codecov.io/gh/DataCrunch-io/datacrunch-python)
|
|
46
|
-
[<img src='https://readthedocs.org/projects/datacrunch-python/badge/?version=latest'>](https://datacrunch-python.readthedocs.io/en/latest/)
|
|
47
|
-
[<img src='https://img.shields.io/github/license/DataCrunch-io/datacrunch-python'>](https://github.com/DataCrunch-io/datacrunch-python/blob/master/LICENSE)
|
|
48
|
-
[<img src='https://img.shields.io/pypi/v/datacrunch?logo=python'>](https://pypi.org/project/datacrunch/)
|
|
49
|
-
[<img src='https://img.shields.io/pypi/pyversions/datacrunch'>](https://pypi.org/project/datacrunch/)
|
|
50
|
-
|
|
51
|
-
The official [DataCrunch.io](https://datacrunch.io) Python SDK.
|
|
52
|
-
|
|
53
|
-
The SDK's documentation is available on [ReadTheDocs](https://datacrunch-python.readthedocs.io/en/latest/)
|
|
54
|
-
|
|
55
|
-
DataCrunch's Public API documentation [is available here](https://api.datacrunch.io/v1/docs).
|
|
56
|
-
|
|
57
|
-
## Getting Started - Using the SDK:
|
|
58
|
-
|
|
59
|
-
- Install via pip:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
pip3 install datacrunch
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
- Generate your client credentials - [instructions in the public API docs](https://api.datacrunch.io/v1/docs#description/quick-start-guide).
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
- Add your client id and client secret to an environment variable (don't want it to be hardcoded):
|
|
69
|
-
|
|
70
|
-
Linux (bash):
|
|
71
|
-
|
|
72
|
-
```bash
|
|
73
|
-
export DATACRUNCH_CLIENT_ID=YOUR_ID_HERE
|
|
74
|
-
export DATACRUNCH_CLIENT_SECRET=YOUR_SECRET_HERE
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
- To enable sending inference requests from SDK you must generate an inference key - [Instructions on inference authorization](https://docs.datacrunch.io/inference/authorization)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
- Add your inference key to an environment variable
|
|
81
|
-
|
|
82
|
-
Linux (bash):
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
export DATACRUNCH_INFERENCE_KEY=YOUR_API_KEY_HERE
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
Other platforms:
|
|
89
|
-
https://en.wikipedia.org/wiki/Environment_variable
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
- Example for creating a new instance:
|
|
94
|
-
|
|
95
|
-
```python
|
|
96
|
-
import os
|
|
97
|
-
from datacrunch import DataCrunchClient
|
|
98
|
-
|
|
99
|
-
# Get credentials from environment variables
|
|
100
|
-
CLIENT_ID = os.environ.get('DATACRUNCH_CLIENT_ID')
|
|
101
|
-
CLIENT_SECRET = os.environ['DATACRUNCH_CLIENT_SECRET']
|
|
102
|
-
|
|
103
|
-
# Create datcrunch client
|
|
104
|
-
datacrunch = DataCrunchClient(CLIENT_ID, CLIENT_SECRET)
|
|
105
|
-
|
|
106
|
-
# Get all SSH keys
|
|
107
|
-
ssh_keys = datacrunch.ssh_keys.get()
|
|
108
|
-
ssh_keys = list(map(lambda key: key.id, ssh_keys))
|
|
109
|
-
|
|
110
|
-
# Create a new instance
|
|
111
|
-
instance = datacrunch.instances.create(instance_type='1V100.6V',
|
|
112
|
-
image='ubuntu-24.04-cuda-12.8-open-docker',
|
|
113
|
-
ssh_key_ids=ssh_keys,
|
|
114
|
-
hostname='example',
|
|
115
|
-
description='example instance')
|
|
116
|
-
|
|
117
|
-
# Delete instance
|
|
118
|
-
datacrunch.instances.action(instance.id, datacrunch.constants.instance_actions.DELETE)
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
More examples can be found in the `/examples` folder or in the [documentation](https://datacrunch-python.readthedocs.io/en/latest/).
|
|
122
|
-
|
|
123
|
-
## Development
|
|
124
|
-
|
|
125
|
-
### Setting up the local development environment
|
|
126
|
-
|
|
127
|
-
- Clone the repository:
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
git clone
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
- Create local virtual environment:
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
python3 -m venv datacrunch_env && source ./datacrunch_env/bin/activate
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
or if using [fish shell](https://fishshell.com/):
|
|
140
|
-
|
|
141
|
-
```fish
|
|
142
|
-
python3 -m venv datacrunch_env && source ./datacrunch_env/bin/activate.fish
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
- Install Dependencies:
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
pip3 install -e .[test]
|
|
149
|
-
pip3 install -U pytest
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Running Tests
|
|
153
|
-
|
|
154
|
-
We use pytest for testing.
|
|
155
|
-
|
|
156
|
-
- To execute all tests
|
|
157
|
-
|
|
158
|
-
```bash
|
|
159
|
-
pytest
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
- To execute a single test file
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
pytest ./tests/unit_tests/test_file.py
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
### Local Manual Testing
|
|
169
|
-
|
|
170
|
-
Create this file in the root directory of the project:
|
|
171
|
-
|
|
172
|
-
```python
|
|
173
|
-
from datacrunch.datacrunch import DataCrunchClient
|
|
174
|
-
|
|
175
|
-
CLIENT_SECRET = 'secret'
|
|
176
|
-
CLIENT_ID = 'your-id'
|
|
177
|
-
|
|
178
|
-
# Create datcrunch client
|
|
179
|
-
datacrunch = DataCrunchClient(CLIENT_ID, CLIENT_SECRET, base_url='http://localhost:3001/v1')
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### Generating the documentation
|
|
183
|
-
|
|
184
|
-
If added a new service, create a documentation template under api/services for that service.
|
|
185
|
-
|
|
186
|
-
```bash
|
|
187
|
-
cd docs
|
|
188
|
-
make html
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
### Style Guide
|
|
192
|
-
|
|
193
|
-
Use autopep8 for auto code formatting:
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
# Install
|
|
197
|
-
pip3 install autopep8
|
|
198
|
-
|
|
199
|
-
# Apply to an entire directory
|
|
200
|
-
autopep8 directory_name --recursive --in-place --pep8-passes 2000 --verbose
|
|
201
|
-
|
|
202
|
-
# Or a single file
|
|
203
|
-
autopep8 file.py --in-place
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
## Contact
|
|
207
|
-
|
|
208
|
-
You can [contact us here](https://datacrunch.io/contact), or open an issue in the repo.
|
datacrunch-1.15.0/README.md
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
# DataCrunch Python SDK
|
|
2
|
-
|
|
3
|
-
[<img src='https://github.com/DataCrunch-io/datacrunch-python/workflows/Unit%20Tests/badge.svg'>](https://github.com/DataCrunch-io/datacrunch-python/actions?query=workflow%3A%22Unit+Tests%22+branch%3Amaster)
|
|
4
|
-
[<img src='https://github.com/DataCrunch-io/datacrunch-python/workflows/Code%20Style/badge.svg'>](https://github.com/DataCrunch-io/datacrunch-python/actions?query=workflow%3A%22Code+Style%22+branch%3Amaster)
|
|
5
|
-
[<img src="https://codecov.io/gh/DataCrunch-io/datacrunch-python/branch/master/graph/badge.svg?token=5X5KTYSSPK">](https://codecov.io/gh/DataCrunch-io/datacrunch-python)
|
|
6
|
-
[<img src='https://readthedocs.org/projects/datacrunch-python/badge/?version=latest'>](https://datacrunch-python.readthedocs.io/en/latest/)
|
|
7
|
-
[<img src='https://img.shields.io/github/license/DataCrunch-io/datacrunch-python'>](https://github.com/DataCrunch-io/datacrunch-python/blob/master/LICENSE)
|
|
8
|
-
[<img src='https://img.shields.io/pypi/v/datacrunch?logo=python'>](https://pypi.org/project/datacrunch/)
|
|
9
|
-
[<img src='https://img.shields.io/pypi/pyversions/datacrunch'>](https://pypi.org/project/datacrunch/)
|
|
10
|
-
|
|
11
|
-
The official [DataCrunch.io](https://datacrunch.io) Python SDK.
|
|
12
|
-
|
|
13
|
-
The SDK's documentation is available on [ReadTheDocs](https://datacrunch-python.readthedocs.io/en/latest/)
|
|
14
|
-
|
|
15
|
-
DataCrunch's Public API documentation [is available here](https://api.datacrunch.io/v1/docs).
|
|
16
|
-
|
|
17
|
-
## Getting Started - Using the SDK:
|
|
18
|
-
|
|
19
|
-
- Install via pip:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
pip3 install datacrunch
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
- Generate your client credentials - [instructions in the public API docs](https://api.datacrunch.io/v1/docs#description/quick-start-guide).
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- Add your client id and client secret to an environment variable (don't want it to be hardcoded):
|
|
29
|
-
|
|
30
|
-
Linux (bash):
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
export DATACRUNCH_CLIENT_ID=YOUR_ID_HERE
|
|
34
|
-
export DATACRUNCH_CLIENT_SECRET=YOUR_SECRET_HERE
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
- To enable sending inference requests from SDK you must generate an inference key - [Instructions on inference authorization](https://docs.datacrunch.io/inference/authorization)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
- Add your inference key to an environment variable
|
|
41
|
-
|
|
42
|
-
Linux (bash):
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
export DATACRUNCH_INFERENCE_KEY=YOUR_API_KEY_HERE
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Other platforms:
|
|
49
|
-
https://en.wikipedia.org/wiki/Environment_variable
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- Example for creating a new instance:
|
|
54
|
-
|
|
55
|
-
```python
|
|
56
|
-
import os
|
|
57
|
-
from datacrunch import DataCrunchClient
|
|
58
|
-
|
|
59
|
-
# Get credentials from environment variables
|
|
60
|
-
CLIENT_ID = os.environ.get('DATACRUNCH_CLIENT_ID')
|
|
61
|
-
CLIENT_SECRET = os.environ['DATACRUNCH_CLIENT_SECRET']
|
|
62
|
-
|
|
63
|
-
# Create datcrunch client
|
|
64
|
-
datacrunch = DataCrunchClient(CLIENT_ID, CLIENT_SECRET)
|
|
65
|
-
|
|
66
|
-
# Get all SSH keys
|
|
67
|
-
ssh_keys = datacrunch.ssh_keys.get()
|
|
68
|
-
ssh_keys = list(map(lambda key: key.id, ssh_keys))
|
|
69
|
-
|
|
70
|
-
# Create a new instance
|
|
71
|
-
instance = datacrunch.instances.create(instance_type='1V100.6V',
|
|
72
|
-
image='ubuntu-24.04-cuda-12.8-open-docker',
|
|
73
|
-
ssh_key_ids=ssh_keys,
|
|
74
|
-
hostname='example',
|
|
75
|
-
description='example instance')
|
|
76
|
-
|
|
77
|
-
# Delete instance
|
|
78
|
-
datacrunch.instances.action(instance.id, datacrunch.constants.instance_actions.DELETE)
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
More examples can be found in the `/examples` folder or in the [documentation](https://datacrunch-python.readthedocs.io/en/latest/).
|
|
82
|
-
|
|
83
|
-
## Development
|
|
84
|
-
|
|
85
|
-
### Setting up the local development environment
|
|
86
|
-
|
|
87
|
-
- Clone the repository:
|
|
88
|
-
|
|
89
|
-
```bash
|
|
90
|
-
git clone
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
- Create local virtual environment:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
python3 -m venv datacrunch_env && source ./datacrunch_env/bin/activate
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
or if using [fish shell](https://fishshell.com/):
|
|
100
|
-
|
|
101
|
-
```fish
|
|
102
|
-
python3 -m venv datacrunch_env && source ./datacrunch_env/bin/activate.fish
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
- Install Dependencies:
|
|
106
|
-
|
|
107
|
-
```bash
|
|
108
|
-
pip3 install -e .[test]
|
|
109
|
-
pip3 install -U pytest
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Running Tests
|
|
113
|
-
|
|
114
|
-
We use pytest for testing.
|
|
115
|
-
|
|
116
|
-
- To execute all tests
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
pytest
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
- To execute a single test file
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
pytest ./tests/unit_tests/test_file.py
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### Local Manual Testing
|
|
129
|
-
|
|
130
|
-
Create this file in the root directory of the project:
|
|
131
|
-
|
|
132
|
-
```python
|
|
133
|
-
from datacrunch.datacrunch import DataCrunchClient
|
|
134
|
-
|
|
135
|
-
CLIENT_SECRET = 'secret'
|
|
136
|
-
CLIENT_ID = 'your-id'
|
|
137
|
-
|
|
138
|
-
# Create datcrunch client
|
|
139
|
-
datacrunch = DataCrunchClient(CLIENT_ID, CLIENT_SECRET, base_url='http://localhost:3001/v1')
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### Generating the documentation
|
|
143
|
-
|
|
144
|
-
If added a new service, create a documentation template under api/services for that service.
|
|
145
|
-
|
|
146
|
-
```bash
|
|
147
|
-
cd docs
|
|
148
|
-
make html
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Style Guide
|
|
152
|
-
|
|
153
|
-
Use autopep8 for auto code formatting:
|
|
154
|
-
|
|
155
|
-
```bash
|
|
156
|
-
# Install
|
|
157
|
-
pip3 install autopep8
|
|
158
|
-
|
|
159
|
-
# Apply to an entire directory
|
|
160
|
-
autopep8 directory_name --recursive --in-place --pep8-passes 2000 --verbose
|
|
161
|
-
|
|
162
|
-
# Or a single file
|
|
163
|
-
autopep8 file.py --in-place
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
## Contact
|
|
167
|
-
|
|
168
|
-
You can [contact us here](https://datacrunch.io/contact), or open an issue in the repo.
|