mostlyai 0.3.0__tar.gz → 0.3.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.
- {mostlyai-0.3.0 → mostlyai-0.3.1}/PKG-INFO +3 -1
- {mostlyai-0.3.0 → mostlyai-0.3.1}/README.md +2 -0
- {mostlyai-0.3.0 → mostlyai-0.3.1}/mostlyai/api.py +16 -2
- {mostlyai-0.3.0 → mostlyai-0.3.1}/mostlyai/base.py +7 -3
- {mostlyai-0.3.0 → mostlyai-0.3.1}/pyproject.toml +2 -1
- {mostlyai-0.3.0 → mostlyai-0.3.1}/LICENSE +0 -0
- {mostlyai-0.3.0 → mostlyai-0.3.1}/mostlyai/__init__.py +0 -0
- {mostlyai-0.3.0 → mostlyai-0.3.1}/mostlyai/connectors.py +0 -0
- {mostlyai-0.3.0 → mostlyai-0.3.1}/mostlyai/exceptions.py +0 -0
- {mostlyai-0.3.0 → mostlyai-0.3.1}/mostlyai/generators.py +0 -0
- {mostlyai-0.3.0 → mostlyai-0.3.1}/mostlyai/model.py +0 -0
- {mostlyai-0.3.0 → mostlyai-0.3.1}/mostlyai/shares.py +0 -0
- {mostlyai-0.3.0 → mostlyai-0.3.1}/mostlyai/synthetic_datasets.py +0 -0
- {mostlyai-0.3.0 → mostlyai-0.3.1}/mostlyai/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mostlyai
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: The official Python client for the MOSTLY AI platform.
|
|
5
5
|
Home-page: https://app.mostly.ai/
|
|
6
6
|
License: Proprietary
|
|
@@ -31,6 +31,8 @@ A Python wrapper for the MOSTLY AI platform (https://app.mostly.ai/).
|
|
|
31
31
|
| Generate unlimited synthetic data on demand | `mostly.generate(g, size)` |
|
|
32
32
|
| Prompt the generator for the data that you need | `mostly.generate(g, seed)` |
|
|
33
33
|
| Connect to any data source within your org | `mostly.connect(config)` |
|
|
34
|
+
| Info about the current user | `mostly.me()` |
|
|
35
|
+
|
|
34
36
|
|
|
35
37
|
|
|
36
38
|
|
|
@@ -9,6 +9,8 @@ A Python wrapper for the MOSTLY AI platform (https://app.mostly.ai/).
|
|
|
9
9
|
| Generate unlimited synthetic data on demand | `mostly.generate(g, size)` |
|
|
10
10
|
| Prompt the generator for the data that you need | `mostly.generate(g, seed)` |
|
|
11
11
|
| Connect to any data source within your org | `mostly.connect(config)` |
|
|
12
|
+
| Info about the current user | `mostly.me()` |
|
|
13
|
+
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
|
|
@@ -4,11 +4,12 @@ from typing import Any, Optional, Union
|
|
|
4
4
|
import pandas as pd
|
|
5
5
|
import rich
|
|
6
6
|
|
|
7
|
-
from mostlyai.base import _MostlyBaseClient
|
|
7
|
+
from mostlyai.base import GET, _MostlyBaseClient
|
|
8
8
|
from mostlyai.connectors import _MostlyConnectorsClient
|
|
9
9
|
from mostlyai.generators import _MostlyGeneratorsClient
|
|
10
10
|
from mostlyai.model import (
|
|
11
11
|
Connector,
|
|
12
|
+
CurrentUser,
|
|
12
13
|
Generator,
|
|
13
14
|
PermissionLevel,
|
|
14
15
|
ProgressStatus,
|
|
@@ -30,6 +31,7 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
30
31
|
:param base_url: The base URL. If not provided, a default value is used.
|
|
31
32
|
:param api_key: The API key for authenticating. If not provided, it would rely on env vars.
|
|
32
33
|
:param timeout: Timeout for HTTPS requests in seconds.
|
|
34
|
+
:param ssl_verify: Whether to verify SSL certificates.
|
|
33
35
|
"""
|
|
34
36
|
|
|
35
37
|
def __init__(
|
|
@@ -37,12 +39,16 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
37
39
|
base_url: Optional[str] = None,
|
|
38
40
|
api_key: Optional[str] = None,
|
|
39
41
|
timeout: float = 60.0,
|
|
42
|
+
ssl_verify: bool = True,
|
|
40
43
|
):
|
|
41
|
-
super().__init__(
|
|
44
|
+
super().__init__(
|
|
45
|
+
base_url=base_url, api_key=api_key, timeout=timeout, ssl_verify=ssl_verify
|
|
46
|
+
)
|
|
42
47
|
client_kwargs = {
|
|
43
48
|
"base_url": self.base_url,
|
|
44
49
|
"api_key": self.api_key,
|
|
45
50
|
"timeout": self.timeout,
|
|
51
|
+
"ssl_verify": self.ssl_verify,
|
|
46
52
|
}
|
|
47
53
|
self.connectors = _MostlyConnectorsClient(**client_kwargs)
|
|
48
54
|
self.generators = _MostlyGeneratorsClient(**client_kwargs)
|
|
@@ -321,3 +327,11 @@ class MostlyAI(_MostlyBaseClient):
|
|
|
321
327
|
rich.print(
|
|
322
328
|
f"Revoked access of resource [bold cyan]{resource.id}[/] for [bold]{user_email}[/]"
|
|
323
329
|
)
|
|
330
|
+
|
|
331
|
+
def me(self) -> CurrentUser:
|
|
332
|
+
"""
|
|
333
|
+
Retrieve current user info.
|
|
334
|
+
|
|
335
|
+
:return: info about the current user.
|
|
336
|
+
"""
|
|
337
|
+
return self.request(verb=GET, path=["users", "me"], response_type=CurrentUser)
|
|
@@ -46,15 +46,19 @@ class _MostlyBaseClient:
|
|
|
46
46
|
base_url: Optional[str] = None,
|
|
47
47
|
api_key: Optional[str] = None,
|
|
48
48
|
timeout: float = 60.0,
|
|
49
|
+
ssl_verify: bool = True,
|
|
49
50
|
):
|
|
50
51
|
self.base_url = (
|
|
51
52
|
base_url or os.getenv("MOSTLY_BASE_URL") or DEFAULT_BASE_URL
|
|
52
53
|
).rstrip("/")
|
|
53
54
|
self.api_key = api_key or os.getenv("MOSTLY_API_KEY")
|
|
54
55
|
self.timeout = timeout
|
|
56
|
+
self.ssl_verify = ssl_verify
|
|
55
57
|
if not self.api_key:
|
|
56
|
-
raise APIError(
|
|
57
|
-
|
|
58
|
+
raise APIError(
|
|
59
|
+
"The API key must be either set by passing api_key to the client or by specifying a "
|
|
60
|
+
"MOSTLY_API_KEY environment variable"
|
|
61
|
+
)
|
|
58
62
|
|
|
59
63
|
def headers(self):
|
|
60
64
|
return {
|
|
@@ -102,7 +106,7 @@ class _MostlyBaseClient:
|
|
|
102
106
|
)
|
|
103
107
|
|
|
104
108
|
try:
|
|
105
|
-
with httpx.Client(timeout=self.timeout) as client:
|
|
109
|
+
with httpx.Client(timeout=self.timeout, verify=self.ssl_verify) as client:
|
|
106
110
|
response = client.request(method=verb, url=full_url, **kwargs)
|
|
107
111
|
response.raise_for_status()
|
|
108
112
|
except httpx.HTTPStatusError as exc:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "mostlyai"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.1"
|
|
4
4
|
description = "The official Python client for the MOSTLY AI platform."
|
|
5
5
|
homepage = "https://app.mostly.ai/"
|
|
6
6
|
authors = ["MOSTLY AI <office@mostly.ai>"]
|
|
@@ -52,6 +52,7 @@ version_scheme = "pep440"
|
|
|
52
52
|
version_provider = "poetry"
|
|
53
53
|
update_changelog_on_bump = true
|
|
54
54
|
major_version_zero = true
|
|
55
|
+
|
|
55
56
|
[build-system]
|
|
56
57
|
requires = ["poetry-core"]
|
|
57
58
|
build-backend = "poetry.core.masonry.api"
|
|
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
|