edron 0.1.0__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.
- edron-0.1.0/.gitignore +36 -0
- edron-0.1.0/CHANGELOG.md +12 -0
- edron-0.1.0/LICENSE +21 -0
- edron-0.1.0/PKG-INFO +71 -0
- edron-0.1.0/README.md +20 -0
- edron-0.1.0/pyproject.toml +60 -0
- edron-0.1.0/src/edron/__init__.py +62 -0
- edron-0.1.0/src/edron/_internal.py +68 -0
- edron-0.1.0/src/edron/app.py +506 -0
- edron-0.1.0/src/edron/cache.py +62 -0
- edron-0.1.0/src/edron/capabilities.py +52 -0
- edron-0.1.0/src/edron/cli/__init__.py +3 -0
- edron-0.1.0/src/edron/cli/main.py +30 -0
- edron-0.1.0/src/edron/confirm.py +10 -0
- edron-0.1.0/src/edron/dependencies.py +36 -0
- edron-0.1.0/src/edron/descriptors.py +217 -0
- edron-0.1.0/src/edron/downloads.py +14 -0
- edron-0.1.0/src/edron/errors.py +27 -0
- edron-0.1.0/src/edron/jobs.py +52 -0
- edron-0.1.0/src/edron/outcomes.py +35 -0
- edron-0.1.0/src/edron/page.py +670 -0
- edron-0.1.0/src/edron/py.typed +0 -0
- edron-0.1.0/src/edron/styling.py +35 -0
edron-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.DS_Store
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.egg-info/
|
|
6
|
+
.eggs/
|
|
7
|
+
dist/
|
|
8
|
+
/build/
|
|
9
|
+
# Artifact/output build trees only — never ignore package source such as
|
|
10
|
+
# packages/hedron/src/hedron/build (Hatchling respects gitignore and would
|
|
11
|
+
# omit it from sdists/wheels; see #32).
|
|
12
|
+
**/.hedron/build/
|
|
13
|
+
packages/hedron-runtime-java/build/
|
|
14
|
+
target/
|
|
15
|
+
.venv*/
|
|
16
|
+
.bounds-venv*
|
|
17
|
+
venv*/
|
|
18
|
+
.env
|
|
19
|
+
.coverage
|
|
20
|
+
htmlcov/
|
|
21
|
+
.pytest_cache/
|
|
22
|
+
.mypy_cache/
|
|
23
|
+
.ruff_cache/
|
|
24
|
+
.hypothesis/
|
|
25
|
+
.tox/
|
|
26
|
+
.nox/
|
|
27
|
+
.audit-build-proj/
|
|
28
|
+
examples/reference-app/.hedron/
|
|
29
|
+
*.html.gz
|
|
30
|
+
/site/
|
|
31
|
+
*.so
|
|
32
|
+
*.dylib
|
|
33
|
+
*.pyd
|
|
34
|
+
.devcontainer/
|
|
35
|
+
# Local SQLite demos (e.g. examples/notes-sqlalchemy)
|
|
36
|
+
*.db
|
edron-0.1.0/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.0] — 2026-08-26
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Initial Edron class-oriented authoring facade over Hedron.
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Lowered fragment/action dependencies into their native route registrations.
|
|
12
|
+
- Preserved explicitly bound action arguments in generated controls and forms.
|
edron-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Odos Matthews
|
|
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.
|
edron-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: edron
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Pythonic class-oriented authoring facade for Hedron
|
|
5
|
+
Project-URL: Homepage, https://github.com/eddiethedean/hedron
|
|
6
|
+
Project-URL: Repository, https://github.com/eddiethedean/hedron
|
|
7
|
+
Project-URL: Issues, https://github.com/eddiethedean/hedron/issues
|
|
8
|
+
Author-email: Odos Matthews <odosmatthews@gmail.com>
|
|
9
|
+
Maintainer-email: Odos Matthews <odosmatthews@gmail.com>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: dashboard,fastapi,htmx,python,server-rendered
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Framework :: FastAPI
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: <3.15,>=3.11
|
|
25
|
+
Requires-Dist: hedron-charts<0.3,>=0.2.2
|
|
26
|
+
Requires-Dist: hedron-data<0.67,>=0.66.0
|
|
27
|
+
Requires-Dist: hedron-maps<0.2,>=0.1.2
|
|
28
|
+
Requires-Dist: hedron<0.67,>=0.66.0
|
|
29
|
+
Requires-Dist: markdown>=3.5
|
|
30
|
+
Requires-Dist: nh3>=0.2
|
|
31
|
+
Requires-Dist: uvicorn>=0.52.1
|
|
32
|
+
Provides-Extra: altair
|
|
33
|
+
Requires-Dist: altair<7,>=6; extra == 'altair'
|
|
34
|
+
Requires-Dist: vl-convert-python>=1.0; extra == 'altair'
|
|
35
|
+
Provides-Extra: matplotlib
|
|
36
|
+
Requires-Dist: matplotlib<4,>=3.8; extra == 'matplotlib'
|
|
37
|
+
Provides-Extra: pandas
|
|
38
|
+
Requires-Dist: narwhals>=1.0; extra == 'pandas'
|
|
39
|
+
Requires-Dist: pandas>=2.0; extra == 'pandas'
|
|
40
|
+
Provides-Extra: plotly
|
|
41
|
+
Requires-Dist: plotly<7,>=5.18; extra == 'plotly'
|
|
42
|
+
Provides-Extra: polars
|
|
43
|
+
Requires-Dist: narwhals>=1.0; extra == 'polars'
|
|
44
|
+
Requires-Dist: polars>=1.0; extra == 'polars'
|
|
45
|
+
Provides-Extra: pyarrow
|
|
46
|
+
Requires-Dist: narwhals>=1.0; extra == 'pyarrow'
|
|
47
|
+
Requires-Dist: pyarrow>=15.0; extra == 'pyarrow'
|
|
48
|
+
Provides-Extra: sqlalchemy
|
|
49
|
+
Requires-Dist: sqlalchemy<3,>=2; extra == 'sqlalchemy'
|
|
50
|
+
Description-Content-Type: text/markdown
|
|
51
|
+
|
|
52
|
+
# Edron
|
|
53
|
+
|
|
54
|
+
Edron is a class-oriented Python authoring facade over Hedron. It keeps Hedron as the renderer,
|
|
55
|
+
router, interaction, state, styling, and security authority.
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
import edron as ed
|
|
59
|
+
|
|
60
|
+
app = ed.App(title="Hello")
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@app.page("/", title="Hello")
|
|
64
|
+
class Home(ed.Page):
|
|
65
|
+
def render(self) -> None:
|
|
66
|
+
self.heading("Hello, Edron")
|
|
67
|
+
self.text("A small Python vocabulary over native Hedron.")
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Edron 0.1 is a Beta implementation line. Native Hedron objects remain available through
|
|
71
|
+
`app.hedron` and `Page.include()`.
|
edron-0.1.0/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Edron
|
|
2
|
+
|
|
3
|
+
Edron is a class-oriented Python authoring facade over Hedron. It keeps Hedron as the renderer,
|
|
4
|
+
router, interaction, state, styling, and security authority.
|
|
5
|
+
|
|
6
|
+
```python
|
|
7
|
+
import edron as ed
|
|
8
|
+
|
|
9
|
+
app = ed.App(title="Hello")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@app.page("/", title="Hello")
|
|
13
|
+
class Home(ed.Page):
|
|
14
|
+
def render(self) -> None:
|
|
15
|
+
self.heading("Hello, Edron")
|
|
16
|
+
self.text("A small Python vocabulary over native Hedron.")
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Edron 0.1 is a Beta implementation line. Native Hedron objects remain available through
|
|
20
|
+
`app.hedron` and `Page.include()`.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "edron"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Pythonic class-oriented authoring facade for Hedron"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.11,<3.15"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
license-files = ["LICENSE"]
|
|
9
|
+
authors = [{ name = "Odos Matthews", email = "odosmatthews@gmail.com" }]
|
|
10
|
+
maintainers = [{ name = "Odos Matthews", email = "odosmatthews@gmail.com" }]
|
|
11
|
+
keywords = ["fastapi", "htmx", "python", "server-rendered", "dashboard"]
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 4 - Beta",
|
|
14
|
+
"Framework :: FastAPI",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Programming Language :: Python",
|
|
18
|
+
"Programming Language :: Python :: 3",
|
|
19
|
+
"Programming Language :: Python :: 3.11",
|
|
20
|
+
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Programming Language :: Python :: 3.13",
|
|
22
|
+
"Programming Language :: Python :: 3.14",
|
|
23
|
+
"Typing :: Typed",
|
|
24
|
+
]
|
|
25
|
+
dependencies = [
|
|
26
|
+
"hedron>=0.66.0,<0.67",
|
|
27
|
+
"hedron-data>=0.66.0,<0.67",
|
|
28
|
+
"hedron-charts>=0.2.2,<0.3",
|
|
29
|
+
"hedron-maps>=0.1.2,<0.2",
|
|
30
|
+
"markdown>=3.5",
|
|
31
|
+
"nh3>=0.2",
|
|
32
|
+
"uvicorn>=0.52.1",
|
|
33
|
+
]
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
pandas = ["pandas>=2.0", "narwhals>=1.0"]
|
|
37
|
+
polars = ["polars>=1.0", "narwhals>=1.0"]
|
|
38
|
+
pyarrow = ["pyarrow>=15.0", "narwhals>=1.0"]
|
|
39
|
+
plotly = ["plotly>=5.18,<7"]
|
|
40
|
+
altair = ["altair>=6,<7", "vl-convert-python>=1.0"]
|
|
41
|
+
matplotlib = ["matplotlib>=3.8,<4"]
|
|
42
|
+
sqlalchemy = ["sqlalchemy>=2,<3"]
|
|
43
|
+
|
|
44
|
+
[project.scripts]
|
|
45
|
+
edron = "edron.cli:main"
|
|
46
|
+
|
|
47
|
+
[project.urls]
|
|
48
|
+
Homepage = "https://github.com/eddiethedean/hedron"
|
|
49
|
+
Repository = "https://github.com/eddiethedean/hedron"
|
|
50
|
+
Issues = "https://github.com/eddiethedean/hedron/issues"
|
|
51
|
+
|
|
52
|
+
[build-system]
|
|
53
|
+
requires = ["hatchling"]
|
|
54
|
+
build-backend = "hatchling.build"
|
|
55
|
+
|
|
56
|
+
[tool.hatch.build.targets.wheel]
|
|
57
|
+
packages = ["src/edron"]
|
|
58
|
+
|
|
59
|
+
[tool.hatch.build.targets.sdist]
|
|
60
|
+
only-include = ["src/edron", "README.md", "CHANGELOG.md", "LICENSE", "pyproject.toml"]
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""Edron: a class-oriented authoring facade for Hedron."""
|
|
2
|
+
|
|
3
|
+
__version__ = "0.1.0"
|
|
4
|
+
|
|
5
|
+
from edron.app import App
|
|
6
|
+
from edron.cache import CachedFunction, cache_data
|
|
7
|
+
from edron.capabilities import (
|
|
8
|
+
BrokenCapabilityError,
|
|
9
|
+
CapabilityError,
|
|
10
|
+
IncompatibleCapabilityError,
|
|
11
|
+
MissingCapabilityError,
|
|
12
|
+
)
|
|
13
|
+
from edron.confirm import Confirm
|
|
14
|
+
from edron.dependencies import Dependency, dependency
|
|
15
|
+
from edron.descriptors import Action, BoundAction, BoundFragment, Fragment, action, fragment
|
|
16
|
+
from edron.downloads import Download, download
|
|
17
|
+
from edron.errors import BindingError, EdronError, PhaseError, RegistrationError
|
|
18
|
+
from edron.jobs import JobBackend, JobFlow, JobScope # pyright: ignore[reportUnknownVariableType]
|
|
19
|
+
from edron.outcomes import Outcome, refresh, success
|
|
20
|
+
from edron.page import Container, FilterScope, Page
|
|
21
|
+
from edron.styling import Color, DesignSystem, StyleContext, StyleRecipe, Theme, ThemeSpec, theme
|
|
22
|
+
|
|
23
|
+
__all__ = [
|
|
24
|
+
"Action",
|
|
25
|
+
"App",
|
|
26
|
+
"BindingError",
|
|
27
|
+
"BoundAction",
|
|
28
|
+
"BoundFragment",
|
|
29
|
+
"CachedFunction",
|
|
30
|
+
"CapabilityError",
|
|
31
|
+
"Color",
|
|
32
|
+
"Confirm",
|
|
33
|
+
"Container",
|
|
34
|
+
"Dependency",
|
|
35
|
+
"DesignSystem",
|
|
36
|
+
"Download",
|
|
37
|
+
"EdronError",
|
|
38
|
+
"FilterScope",
|
|
39
|
+
"Fragment",
|
|
40
|
+
"IncompatibleCapabilityError",
|
|
41
|
+
"JobBackend",
|
|
42
|
+
"JobFlow",
|
|
43
|
+
"JobScope",
|
|
44
|
+
"MissingCapabilityError",
|
|
45
|
+
"BrokenCapabilityError",
|
|
46
|
+
"Outcome",
|
|
47
|
+
"Page",
|
|
48
|
+
"PhaseError",
|
|
49
|
+
"RegistrationError",
|
|
50
|
+
"StyleContext",
|
|
51
|
+
"StyleRecipe",
|
|
52
|
+
"Theme",
|
|
53
|
+
"ThemeSpec",
|
|
54
|
+
"action",
|
|
55
|
+
"cache_data",
|
|
56
|
+
"dependency",
|
|
57
|
+
"download",
|
|
58
|
+
"fragment",
|
|
59
|
+
"refresh",
|
|
60
|
+
"success",
|
|
61
|
+
"theme",
|
|
62
|
+
]
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Iterator
|
|
4
|
+
from contextlib import contextmanager
|
|
5
|
+
from contextvars import ContextVar
|
|
6
|
+
from dataclasses import dataclass, field
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
from edron.errors import PhaseError
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass
|
|
13
|
+
class Buffer:
|
|
14
|
+
entries: list[Any] = field(default_factory=list)
|
|
15
|
+
closed: bool = False
|
|
16
|
+
|
|
17
|
+
def append(self, value: Any) -> None:
|
|
18
|
+
if self.closed:
|
|
19
|
+
raise PhaseError(
|
|
20
|
+
"output was emitted after the request phase closed", code="EDRON_LATE_OUTPUT"
|
|
21
|
+
)
|
|
22
|
+
self.entries.append(value)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass
|
|
26
|
+
class Frame:
|
|
27
|
+
app: Any
|
|
28
|
+
page: Any
|
|
29
|
+
phase: str
|
|
30
|
+
request: Any = None
|
|
31
|
+
buffer: Buffer = field(default_factory=Buffer)
|
|
32
|
+
parent: Frame | None = None
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
_current_frame: ContextVar[Frame | None] = ContextVar("edron_current_frame", default=None)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def current_frame() -> Frame | None:
|
|
39
|
+
return _current_frame.get()
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def require_frame(*phases: str) -> Frame:
|
|
43
|
+
frame = current_frame()
|
|
44
|
+
if frame is None:
|
|
45
|
+
raise PhaseError(
|
|
46
|
+
"this Edron operation is only valid during a request", code="EDRON_NO_REQUEST"
|
|
47
|
+
)
|
|
48
|
+
if phases and frame.phase not in phases:
|
|
49
|
+
expected = ", ".join(phases)
|
|
50
|
+
raise PhaseError(
|
|
51
|
+
f"operation is valid during {expected}, not {frame.phase}",
|
|
52
|
+
code="EDRON_WRONG_PHASE",
|
|
53
|
+
)
|
|
54
|
+
return frame
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
@contextmanager
|
|
58
|
+
def frame_context(frame: Frame) -> Iterator[Frame]:
|
|
59
|
+
token = _current_frame.set(frame)
|
|
60
|
+
try:
|
|
61
|
+
yield frame
|
|
62
|
+
finally:
|
|
63
|
+
frame.buffer.closed = True
|
|
64
|
+
_current_frame.reset(token)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def native_request() -> Any:
|
|
68
|
+
return require_frame().request
|