cuiman 0.2.0.dev1__tar.gz → 0.2.1.dev1__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.
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/PKG-INFO +4 -3
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/client_app_mixin.py +6 -0
- cuiman-0.2.1.dev1/cuiman/app/display.py +104 -0
- cuiman-0.2.1.dev1/cuiman/app/dist/assets/index-9NSgOSt1.js +85 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/app/dist/index.html +3 -3
- cuiman-0.2.1.dev1/cuiman/app/notebook-display.js +196 -0
- cuiman-0.2.1.dev1/cuiman/app/serve.py +123 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/app/service.py +23 -3
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/pyproject.toml +4 -3
- cuiman-0.2.0.dev1/cuiman/app/display.py +0 -110
- cuiman-0.2.0.dev1/cuiman/app/dist/assets/index-CEQarI7F.js +0 -84
- cuiman-0.2.0.dev1/cuiman/app/serve.py +0 -68
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/.gitignore +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/LICENSE +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/README.md +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/__init__.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/__init__.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/async_client.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/async_client_mixin.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/auth/__init__.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/auth/config.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/auth/login.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/auth/login_async.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/client.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/client_mixin.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/config.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/defaults.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/exceptions.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/ishell.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/jobs.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/opener/__init__.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/opener/context.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/opener/errors.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/opener/impl/__init__.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/opener/impl/_gpd.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/opener/impl/_image.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/opener/impl/_pd.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/opener/impl/_xr.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/opener/impl/base.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/opener/impl/openers.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/opener/opener.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/opener/registry.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/service_client.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/transport/__init__.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/transport/args.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/transport/httpx.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/api/transport/transport.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/app/__init__.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/app/app.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/app/dist/assets/index-DKE7nU5k.css +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/app/dist/eozilla-small.svg +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/app/dist/eozilla.svg +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/app/dist/privacy.md +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/app/url.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/cli/__init__.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/cli/cli.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/cli/client.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/cli/config.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/cli/output.py +0 -0
- {cuiman-0.2.0.dev1 → cuiman-0.2.1.dev1}/cuiman/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cuiman
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1.dev1
|
|
4
4
|
Summary: Provides a client Python API, GUI, and CLI for servers compliant with OGC API - Processes
|
|
5
5
|
Project-URL: Documentation, https://eo-tools.github.io/eozilla
|
|
6
6
|
Project-URL: Repository, https://github.com/eo-tools/eozilla
|
|
@@ -27,12 +27,13 @@ Classifier: Topic :: Scientific/Engineering
|
|
|
27
27
|
Classifier: Topic :: Software Development
|
|
28
28
|
Classifier: Typing :: Typed
|
|
29
29
|
Requires-Python: >=3.10
|
|
30
|
-
Requires-Dist: gavicore>=0.2.
|
|
30
|
+
Requires-Dist: gavicore>=0.2.1.dev1
|
|
31
31
|
Requires-Dist: httpx
|
|
32
|
+
Requires-Dist: ipython
|
|
32
33
|
Requires-Dist: pydantic
|
|
33
34
|
Requires-Dist: pydantic-settings
|
|
34
35
|
Requires-Dist: pyyaml
|
|
35
|
-
Requires-Dist: remotestate<1,>=0.3.
|
|
36
|
+
Requires-Dist: remotestate<1,>=0.3.4
|
|
36
37
|
Requires-Dist: typer<1,>=0.26.0
|
|
37
38
|
Requires-Dist: uri-template
|
|
38
39
|
Description-Content-Type: text/markdown
|
|
@@ -6,6 +6,7 @@ from abc import ABC, abstractmethod
|
|
|
6
6
|
from typing import TYPE_CHECKING, Literal
|
|
7
7
|
|
|
8
8
|
from cuiman.api.ishell import has_ishell
|
|
9
|
+
from cuiman.app.serve import ProxyMode
|
|
9
10
|
|
|
10
11
|
from .config import ClientConfig
|
|
11
12
|
|
|
@@ -32,6 +33,7 @@ class ClientAppMixin(ABC):
|
|
|
32
33
|
width: int | str = "100%",
|
|
33
34
|
height: int | str = 600,
|
|
34
35
|
display: Literal["browser", "notebook", "auto"] = "auto",
|
|
36
|
+
proxy: ProxyMode = "auto",
|
|
35
37
|
) -> "App":
|
|
36
38
|
"""
|
|
37
39
|
Show the Cuiman app for this client.
|
|
@@ -77,6 +79,9 @@ class ClientAppMixin(ABC):
|
|
|
77
79
|
height: Height of the notebook iframe.
|
|
78
80
|
display: Where to show the app. ``"auto"`` embeds it in notebooks
|
|
79
81
|
and opens it in a browser otherwise.
|
|
82
|
+
proxy: Whether notebook traffic uses ``jupyter-server-proxy``. ``"auto"``
|
|
83
|
+
uses it when available, ``"never"`` disables it, and ``"always"``
|
|
84
|
+
requires it.
|
|
80
85
|
Return:
|
|
81
86
|
An ``App`` instance.
|
|
82
87
|
"""
|
|
@@ -99,6 +104,7 @@ class ClientAppMixin(ABC):
|
|
|
99
104
|
width=width,
|
|
100
105
|
height=height,
|
|
101
106
|
display=display_,
|
|
107
|
+
proxy=proxy,
|
|
102
108
|
)
|
|
103
109
|
|
|
104
110
|
return App(remote_store, serve_result)
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Copyright (c) 2026 by the Eozilla team and contributors
|
|
2
|
+
# Permissions are hereby granted under the terms of the Apache 2.0 License:
|
|
3
|
+
# https://opensource.org/license/apache-2-0.
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import json
|
|
8
|
+
from importlib import resources
|
|
9
|
+
|
|
10
|
+
from IPython.display import HTML, DisplayObject
|
|
11
|
+
|
|
12
|
+
_NOTEBOOK_DISPLAY_SCRIPT = (
|
|
13
|
+
resources.files("cuiman.app")
|
|
14
|
+
.joinpath("notebook-display.js")
|
|
15
|
+
.read_text(encoding="utf-8")
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def create_app_display_object(
|
|
20
|
+
app_url: str,
|
|
21
|
+
*,
|
|
22
|
+
auto_scheme: bool,
|
|
23
|
+
width: int | str,
|
|
24
|
+
height: int | str,
|
|
25
|
+
proxy_port: int | None = None,
|
|
26
|
+
proxy_app: bool = False,
|
|
27
|
+
auto_proxy: bool = False,
|
|
28
|
+
open_in_browser: bool = False,
|
|
29
|
+
) -> DisplayObject:
|
|
30
|
+
"""Create the notebook display object for the Cuiman app."""
|
|
31
|
+
if auto_scheme or proxy_port is not None or open_in_browser:
|
|
32
|
+
return _get_iframe_script_html(
|
|
33
|
+
app_url,
|
|
34
|
+
auto_scheme=auto_scheme,
|
|
35
|
+
width=width,
|
|
36
|
+
height=height,
|
|
37
|
+
proxy_port=proxy_port,
|
|
38
|
+
proxy_app=proxy_app,
|
|
39
|
+
auto_proxy=auto_proxy,
|
|
40
|
+
open_in_browser=open_in_browser,
|
|
41
|
+
)
|
|
42
|
+
return _get_iframe_html(
|
|
43
|
+
app_url,
|
|
44
|
+
width=width,
|
|
45
|
+
height=height,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def _get_iframe_html(
|
|
50
|
+
src: str,
|
|
51
|
+
*,
|
|
52
|
+
width: int | str,
|
|
53
|
+
height: int | str,
|
|
54
|
+
) -> HTML:
|
|
55
|
+
return HTML(f"""
|
|
56
|
+
<iframe
|
|
57
|
+
src={json.dumps(src)}
|
|
58
|
+
width={json.dumps(_norm_size(width))}
|
|
59
|
+
height={json.dumps(_norm_size(height))}
|
|
60
|
+
style={json.dumps(f"border: 0; width: {_norm_size(width)}; height: {_norm_size(height)};")}
|
|
61
|
+
allow="clipboard-read; clipboard-write"
|
|
62
|
+
></iframe>
|
|
63
|
+
""")
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _get_iframe_script_html(
|
|
67
|
+
base_src: str,
|
|
68
|
+
*,
|
|
69
|
+
auto_scheme: bool,
|
|
70
|
+
width: int | str,
|
|
71
|
+
height: int | str,
|
|
72
|
+
proxy_port: int | None,
|
|
73
|
+
proxy_app: bool,
|
|
74
|
+
auto_proxy: bool,
|
|
75
|
+
open_in_browser: bool,
|
|
76
|
+
) -> HTML:
|
|
77
|
+
config = {
|
|
78
|
+
"baseSrc": base_src,
|
|
79
|
+
"autoScheme": auto_scheme,
|
|
80
|
+
"width": _norm_size(width),
|
|
81
|
+
"height": _norm_size(height),
|
|
82
|
+
"proxyPort": proxy_port,
|
|
83
|
+
"proxyApp": proxy_app,
|
|
84
|
+
"autoProxy": auto_proxy,
|
|
85
|
+
"openInBrowser": open_in_browser,
|
|
86
|
+
}
|
|
87
|
+
config_json = json.dumps(config, separators=(",", ":")).replace("<", "\\u003c")
|
|
88
|
+
|
|
89
|
+
# Inline the package resource so notebook output needs no additional asset URL.
|
|
90
|
+
return HTML(f"""
|
|
91
|
+
<div class="eozilla-frame-root"></div>
|
|
92
|
+
<script type="application/json" class="eozilla-frame-config">
|
|
93
|
+
{config_json}
|
|
94
|
+
</script>
|
|
95
|
+
<script>
|
|
96
|
+
{_NOTEBOOK_DISPLAY_SCRIPT}
|
|
97
|
+
</script>
|
|
98
|
+
""")
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def _norm_size(size: int | float | str) -> str:
|
|
102
|
+
if isinstance(size, str):
|
|
103
|
+
return size
|
|
104
|
+
return f"{size}px"
|