futurehouse-client 0.3.18.dev102__tar.gz → 0.3.18.dev110__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.
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/PKG-INFO +1 -1
- futurehouse_client-0.3.18.dev110/futurehouse_client/utils/__init__.py +7 -0
- futurehouse_client-0.3.18.dev110/futurehouse_client/utils/context.py +45 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client.egg-info/PKG-INFO +1 -1
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client.egg-info/SOURCES.txt +1 -0
- futurehouse_client-0.3.18.dev102/futurehouse_client/utils/__init__.py +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/LICENSE +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/README.md +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/docs/__init__.py +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/docs/client_notebook.ipynb +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client/__init__.py +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client/clients/__init__.py +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client/clients/job_client.py +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client/clients/rest_client.py +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client/models/__init__.py +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client/models/app.py +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client/models/client.py +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client/models/rest.py +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client/utils/general.py +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client/utils/module_utils.py +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client/utils/monitoring.py +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client.egg-info/dependency_links.txt +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client.egg-info/requires.txt +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client.egg-info/top_level.txt +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/pyproject.toml +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/setup.cfg +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/tests/test_rest.py +0 -0
- {futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/uv.lock +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: futurehouse-client
|
3
|
-
Version: 0.3.18.
|
3
|
+
Version: 0.3.18.dev110
|
4
4
|
Summary: A client for interacting with endpoints of the FutureHouse service.
|
5
5
|
Author-email: FutureHouse technical staff <hello@futurehouse.org>
|
6
6
|
Classifier: Operating System :: OS Independent
|
@@ -0,0 +1,45 @@
|
|
1
|
+
from typing import Any, ClassVar
|
2
|
+
|
3
|
+
USER_JWT_CONTEXT_KEY = "user_jwt"
|
4
|
+
JOB_ID_CONTEXT_KEY = "job_id"
|
5
|
+
|
6
|
+
|
7
|
+
class RequestContext:
|
8
|
+
"""A context manager for storing information from the initial request."""
|
9
|
+
|
10
|
+
_context: ClassVar[dict[str, Any]] = {}
|
11
|
+
|
12
|
+
@classmethod
|
13
|
+
def set(cls, key: str, value: Any) -> None:
|
14
|
+
"""Set a context variable.
|
15
|
+
|
16
|
+
Args:
|
17
|
+
key: The context variable name
|
18
|
+
value: The value to store
|
19
|
+
"""
|
20
|
+
cls._context[key] = value
|
21
|
+
|
22
|
+
@classmethod
|
23
|
+
def get(cls, key: str) -> Any:
|
24
|
+
"""Get a context variable.
|
25
|
+
|
26
|
+
Args:
|
27
|
+
key: The context variable name
|
28
|
+
default: Default value if key doesn't exist
|
29
|
+
|
30
|
+
Returns:
|
31
|
+
The stored value or default if not found
|
32
|
+
"""
|
33
|
+
return cls._context.get(key, None)
|
34
|
+
|
35
|
+
@classmethod
|
36
|
+
def clear(cls, key: str | None = None) -> None:
|
37
|
+
"""Clear a specific context variable or all variables.
|
38
|
+
|
39
|
+
Args:
|
40
|
+
key: Specific key to clear, or None to clear all
|
41
|
+
"""
|
42
|
+
if key is None:
|
43
|
+
cls._context.clear()
|
44
|
+
elif key in cls._context:
|
45
|
+
del cls._context[key]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: futurehouse-client
|
3
|
-
Version: 0.3.18.
|
3
|
+
Version: 0.3.18.dev110
|
4
4
|
Summary: A client for interacting with endpoints of the FutureHouse service.
|
5
5
|
Author-email: FutureHouse technical staff <hello@futurehouse.org>
|
6
6
|
Classifier: Operating System :: OS Independent
|
@@ -18,6 +18,7 @@ futurehouse_client/models/app.py
|
|
18
18
|
futurehouse_client/models/client.py
|
19
19
|
futurehouse_client/models/rest.py
|
20
20
|
futurehouse_client/utils/__init__.py
|
21
|
+
futurehouse_client/utils/context.py
|
21
22
|
futurehouse_client/utils/general.py
|
22
23
|
futurehouse_client/utils/module_utils.py
|
23
24
|
futurehouse_client/utils/monitoring.py
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/docs/client_notebook.ipynb
RENAMED
File without changes
|
{futurehouse_client-0.3.18.dev102 → futurehouse_client-0.3.18.dev110}/futurehouse_client/__init__.py
RENAMED
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
|
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
|