generalforecast 0.2.0__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.
- generalforecast/__init__.py +102 -0
- generalforecast/__main__.py +8 -0
- generalforecast/_api.py +8367 -0
- generalforecast/_files.py +196 -0
- generalforecast/_operations.py +2095 -0
- generalforecast/account.py +302 -0
- generalforecast/as_of.py +138 -0
- generalforecast/async_client.py +1279 -0
- generalforecast/catalog.py +116 -0
- generalforecast/cli.py +1257 -0
- generalforecast/client.py +1230 -0
- generalforecast/command_specs.py +202 -0
- generalforecast/commands.py +303 -0
- generalforecast/contracts.py +684 -0
- generalforecast/credentials.py +308 -0
- generalforecast/diagnostics.py +102 -0
- generalforecast/errors.py +809 -0
- generalforecast/estimators.py +506 -0
- generalforecast/frequency.py +519 -0
- generalforecast/ipc.py +208 -0
- generalforecast/iso.py +76 -0
- generalforecast/login.py +174 -0
- generalforecast/manifest.py +169 -0
- generalforecast/predict_request.py +472 -0
- generalforecast/predictor.py +596 -0
- generalforecast/predictor_commands.py +1479 -0
- generalforecast/py.typed +0 -0
- generalforecast/render.py +410 -0
- generalforecast/retry.py +422 -0
- generalforecast/serialization.py +37 -0
- generalforecast/service/__init__.py +4 -0
- generalforecast/service/boundary.py +292 -0
- generalforecast/service/contracts.py +191 -0
- generalforecast/service/interfaces.py +116 -0
- generalforecast/service/sdk.py +592 -0
- generalforecast/tables.py +539 -0
- generalforecast/tabular.py +678 -0
- generalforecast/term.py +1383 -0
- generalforecast/transport.py +1323 -0
- generalforecast/validation.py +157 -0
- generalforecast-0.2.0.dist-info/METADATA +167 -0
- generalforecast-0.2.0.dist-info/RECORD +45 -0
- generalforecast-0.2.0.dist-info/WHEEL +4 -0
- generalforecast-0.2.0.dist-info/entry_points.txt +2 -0
- generalforecast-0.2.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: General Forecast, Inc.
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
"""General Forecast: the Python SDK and `gf` CLI for the hosted forecasting service.
|
|
5
|
+
|
|
6
|
+
Exports `Predictor`, the estimators `Classifier`, `Regressor` and
|
|
7
|
+
`Forecaster`, the hosted `Client` and `AsyncClient`, the error classes, and
|
|
8
|
+
the `errors` submodule. Every prediction runs on the service. Everything
|
|
9
|
+
loads on first use, so `import generalforecast` stays cheap.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
import importlib
|
|
13
|
+
from typing import TYPE_CHECKING, Any
|
|
14
|
+
|
|
15
|
+
from generalforecast.errors import (
|
|
16
|
+
AmbiguousReference,
|
|
17
|
+
CapacityExceeded,
|
|
18
|
+
Conflict,
|
|
19
|
+
Error,
|
|
20
|
+
Internal,
|
|
21
|
+
InvalidInput,
|
|
22
|
+
ModelNotReady,
|
|
23
|
+
NotFound,
|
|
24
|
+
PaymentRequired,
|
|
25
|
+
Unauthorized,
|
|
26
|
+
Unavailable,
|
|
27
|
+
Unsupported,
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
if TYPE_CHECKING:
|
|
31
|
+
from generalforecast import errors as errors
|
|
32
|
+
from generalforecast.async_client import AsyncClient as AsyncClient
|
|
33
|
+
from generalforecast.client import Client as Client
|
|
34
|
+
from generalforecast.estimators import Classifier as Classifier
|
|
35
|
+
from generalforecast.estimators import Forecaster as Forecaster
|
|
36
|
+
from generalforecast.estimators import Regressor as Regressor
|
|
37
|
+
from generalforecast.predictor import Predictor as Predictor
|
|
38
|
+
|
|
39
|
+
__version__: str
|
|
40
|
+
|
|
41
|
+
__all__ = [
|
|
42
|
+
"AmbiguousReference",
|
|
43
|
+
"AsyncClient",
|
|
44
|
+
"CapacityExceeded",
|
|
45
|
+
"Classifier",
|
|
46
|
+
"Client",
|
|
47
|
+
"Conflict",
|
|
48
|
+
"Error",
|
|
49
|
+
"Forecaster",
|
|
50
|
+
"Internal",
|
|
51
|
+
"InvalidInput",
|
|
52
|
+
"ModelNotReady",
|
|
53
|
+
"NotFound",
|
|
54
|
+
"PaymentRequired",
|
|
55
|
+
"Predictor",
|
|
56
|
+
"Regressor",
|
|
57
|
+
"Unauthorized",
|
|
58
|
+
"Unavailable",
|
|
59
|
+
"Unsupported",
|
|
60
|
+
"__version__",
|
|
61
|
+
"errors",
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
_EXPORTS = {
|
|
65
|
+
"Predictor": ("generalforecast.predictor", "Predictor"),
|
|
66
|
+
"Client": ("generalforecast.client", "Client"),
|
|
67
|
+
"AsyncClient": ("generalforecast.async_client", "AsyncClient"),
|
|
68
|
+
"Classifier": ("generalforecast.estimators", "Classifier"),
|
|
69
|
+
"Regressor": ("generalforecast.estimators", "Regressor"),
|
|
70
|
+
"Forecaster": ("generalforecast.estimators", "Forecaster"),
|
|
71
|
+
"errors": ("generalforecast.errors", None),
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def _version() -> str:
|
|
76
|
+
"""The installed version; reading the package metadata is itself an import."""
|
|
77
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
78
|
+
|
|
79
|
+
try:
|
|
80
|
+
return version("generalforecast")
|
|
81
|
+
except PackageNotFoundError: # A checkout imported without being installed.
|
|
82
|
+
return "0.0.0"
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def __getattr__(name: str) -> Any:
|
|
86
|
+
"""Imports an export, or reads the version, on first use."""
|
|
87
|
+
if name == "__version__":
|
|
88
|
+
value = globals()[name] = _version()
|
|
89
|
+
return value
|
|
90
|
+
target = _EXPORTS.get(name)
|
|
91
|
+
if target is None:
|
|
92
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
93
|
+
module_name, attribute = target
|
|
94
|
+
module = importlib.import_module(module_name)
|
|
95
|
+
value = module if attribute is None else getattr(module, attribute)
|
|
96
|
+
globals()[name] = value
|
|
97
|
+
return value
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def __dir__() -> list[str]:
|
|
101
|
+
"""Lists the public exports."""
|
|
102
|
+
return sorted(__all__)
|