urban-class 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.
- urban_class-0.1.0/.gitignore +235 -0
- urban_class-0.1.0/PKG-INFO +32 -0
- urban_class-0.1.0/README.md +20 -0
- urban_class-0.1.0/pyproject.toml +29 -0
- urban_class-0.1.0/urban_class/__init__.py +36 -0
- urban_class-0.1.0/urban_class/parse.py +884 -0
- urban_class-0.1.0/urban_class/static/types/contract/types.d.ts +229 -0
- urban_class-0.1.0/urban_class/static/types/errors.d.ts +51 -0
- urban_class-0.1.0/urban_class/static/types/index.d.ts +4 -0
- urban_class-0.1.0/urban_class/static/types/model/document.d.ts +105 -0
- urban_class-0.1.0/urban_class/static/types/model/extend.d.ts +23 -0
- urban_class-0.1.0/urban_class/static/types/model/ids.d.ts +27 -0
- urban_class-0.1.0/urban_class/static/types/model/parse.d.ts +209 -0
- urban_class-0.1.0/urban_class/static/types/model/reference.d.ts +24 -0
- urban_class-0.1.0/urban_class/static/types/model/text.d.ts +20 -0
- urban_class-0.1.0/urban_class/static/types/render/layout.d.ts +119 -0
- urban_class-0.1.0/urban_class/static/types/render/measure.d.ts +10 -0
- urban_class-0.1.0/urban_class/static/types/render/palette.d.ts +28 -0
- urban_class-0.1.0/urban_class/static/types/render/svg.d.ts +28 -0
- urban_class-0.1.0/urban_class/static/types/web-component/UrbanClassElement.d.ts +133 -0
- urban_class-0.1.0/urban_class/static/urban-class.css +2 -0
- urban_class-0.1.0/urban_class/static/urban-class.js +12721 -0
- urban_class-0.1.0/urban_class/static/urban-class.js.map +1 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
*.lcov
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
cover/
|
|
54
|
+
|
|
55
|
+
# Translations
|
|
56
|
+
*.mo
|
|
57
|
+
*.pot
|
|
58
|
+
|
|
59
|
+
# Django stuff:
|
|
60
|
+
*.log
|
|
61
|
+
local_settings.py
|
|
62
|
+
db.sqlite3
|
|
63
|
+
db.sqlite3-journal
|
|
64
|
+
|
|
65
|
+
# Flask stuff:
|
|
66
|
+
instance/
|
|
67
|
+
.webassets-cache
|
|
68
|
+
|
|
69
|
+
# Scrapy stuff:
|
|
70
|
+
.scrapy
|
|
71
|
+
|
|
72
|
+
# Sphinx documentation
|
|
73
|
+
docs/_build/
|
|
74
|
+
|
|
75
|
+
# PyBuilder
|
|
76
|
+
.pybuilder/
|
|
77
|
+
target/
|
|
78
|
+
|
|
79
|
+
# Jupyter Notebook
|
|
80
|
+
.ipynb_checkpoints
|
|
81
|
+
|
|
82
|
+
# IPython
|
|
83
|
+
profile_default/
|
|
84
|
+
ipython_config.py
|
|
85
|
+
|
|
86
|
+
# pyenv
|
|
87
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
88
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
89
|
+
# .python-version
|
|
90
|
+
|
|
91
|
+
# pipenv
|
|
92
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
93
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
94
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
95
|
+
# install all needed dependencies.
|
|
96
|
+
# Pipfile.lock
|
|
97
|
+
|
|
98
|
+
# uv
|
|
99
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
100
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
101
|
+
# commonly ignored for libraries.
|
|
102
|
+
# uv.lock
|
|
103
|
+
|
|
104
|
+
# poetry
|
|
105
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
106
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
107
|
+
# commonly ignored for libraries.
|
|
108
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
109
|
+
# poetry.lock
|
|
110
|
+
# poetry.toml
|
|
111
|
+
|
|
112
|
+
# pdm
|
|
113
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
114
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
115
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
116
|
+
# pdm.lock
|
|
117
|
+
# pdm.toml
|
|
118
|
+
.pdm-python
|
|
119
|
+
.pdm-build/
|
|
120
|
+
|
|
121
|
+
# pixi
|
|
122
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
123
|
+
# pixi.lock
|
|
124
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
125
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
126
|
+
.pixi/*
|
|
127
|
+
!.pixi/config.toml
|
|
128
|
+
|
|
129
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
130
|
+
__pypackages__/
|
|
131
|
+
|
|
132
|
+
# Celery stuff
|
|
133
|
+
celerybeat-schedule*
|
|
134
|
+
celerybeat.pid
|
|
135
|
+
|
|
136
|
+
# Redis
|
|
137
|
+
*.rdb
|
|
138
|
+
*.aof
|
|
139
|
+
*.pid
|
|
140
|
+
|
|
141
|
+
# RabbitMQ
|
|
142
|
+
mnesia/
|
|
143
|
+
rabbitmq/
|
|
144
|
+
rabbitmq-data/
|
|
145
|
+
|
|
146
|
+
# ActiveMQ
|
|
147
|
+
activemq-data/
|
|
148
|
+
|
|
149
|
+
# SageMath parsed files
|
|
150
|
+
*.sage.py
|
|
151
|
+
|
|
152
|
+
# Environments
|
|
153
|
+
.env
|
|
154
|
+
.envrc
|
|
155
|
+
.venv
|
|
156
|
+
env/
|
|
157
|
+
venv/
|
|
158
|
+
ENV/
|
|
159
|
+
env.bak/
|
|
160
|
+
venv.bak/
|
|
161
|
+
|
|
162
|
+
# Conda environments
|
|
163
|
+
conda-meta/
|
|
164
|
+
|
|
165
|
+
# Spyder project settings
|
|
166
|
+
.spyderproject
|
|
167
|
+
.spyproject
|
|
168
|
+
|
|
169
|
+
# Rope project settings
|
|
170
|
+
.ropeproject
|
|
171
|
+
|
|
172
|
+
# mkdocs/Zensical documentation — règle du gabarit Python retirée :
|
|
173
|
+
# site/ est ici le site de démonstration, versionné (pas de MkDocs)
|
|
174
|
+
|
|
175
|
+
# mypy
|
|
176
|
+
.mypy_cache/
|
|
177
|
+
.dmypy.json
|
|
178
|
+
dmypy.json
|
|
179
|
+
|
|
180
|
+
# Pyre type checker
|
|
181
|
+
.pyre/
|
|
182
|
+
|
|
183
|
+
# pytype static type analyzer
|
|
184
|
+
.pytype/
|
|
185
|
+
|
|
186
|
+
# Cython debug symbols
|
|
187
|
+
cython_debug/
|
|
188
|
+
|
|
189
|
+
# PyCharm
|
|
190
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
191
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
192
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
193
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
194
|
+
# .idea/
|
|
195
|
+
|
|
196
|
+
# Abstra
|
|
197
|
+
# Abstra is an AI-powered process automation framework.
|
|
198
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
199
|
+
# Learn more at https://abstra.io/docs
|
|
200
|
+
.abstra/
|
|
201
|
+
|
|
202
|
+
# Visual Studio Code
|
|
203
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore that
|
|
204
|
+
# can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
205
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer, you
|
|
206
|
+
# could uncomment the following to ignore the entire vscode folder
|
|
207
|
+
# .vscode/
|
|
208
|
+
# Temporary file for partial code execution
|
|
209
|
+
tempCodeRunnerFile.py
|
|
210
|
+
|
|
211
|
+
# Ruff stuff:
|
|
212
|
+
.ruff_cache/
|
|
213
|
+
|
|
214
|
+
# PyPI configuration file
|
|
215
|
+
.pypirc
|
|
216
|
+
|
|
217
|
+
# Marimo
|
|
218
|
+
marimo/_static/
|
|
219
|
+
marimo/_lsp/
|
|
220
|
+
__marimo__/
|
|
221
|
+
|
|
222
|
+
# Streamlit
|
|
223
|
+
.streamlit/secrets.toml
|
|
224
|
+
|
|
225
|
+
# --- urban-class ---
|
|
226
|
+
# Node
|
|
227
|
+
node_modules/
|
|
228
|
+
dist-site/
|
|
229
|
+
*.local
|
|
230
|
+
__screenshots__/
|
|
231
|
+
# artefacts assemblés dans le paquet Python
|
|
232
|
+
python/urban_class/static/
|
|
233
|
+
python/dist/
|
|
234
|
+
# instance de dev/test
|
|
235
|
+
demo/.env
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: urban-class
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Class and entity-relationship diagram editor web component (<urban-class>), served from FastAPI / Starlette
|
|
5
|
+
Project-URL: Repository, https://github.com/gaelgael5/urban-class
|
|
6
|
+
Author: urban-class contributors
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Keywords: class-diagram,editor,er-diagram,fastapi,mermaid,starlette,web-component
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
|
+
Requires-Dist: starlette>=0.37
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
|
|
13
|
+
# urban-class
|
|
14
|
+
|
|
15
|
+
Class and entity-relationship diagram editor web component
|
|
16
|
+
(`<urban-class>`), stored as pure Mermaid (`classDiagram` /
|
|
17
|
+
`erDiagram`) plus a `.extend.yaml` annex (positions, descriptions,
|
|
18
|
+
host references), served from FastAPI / Starlette.
|
|
19
|
+
|
|
20
|
+
```python
|
|
21
|
+
import urban_class
|
|
22
|
+
urban_class.mount(app, "/api/class")
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The page then loads `/api/class/urban-class.js` (ES module) and
|
|
26
|
+
`/api/class/urban-class.css`, and uses the `<urban-class>` element.
|
|
27
|
+
The TypeScript declarations of the public contract are served under
|
|
28
|
+
`/api/class/types/`.
|
|
29
|
+
|
|
30
|
+
The full public contract (properties, methods, events, error codes,
|
|
31
|
+
stored formats) lives in `docs/contrat.yaml` of the repository:
|
|
32
|
+
<https://github.com/gaelgael5/urban-class>.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# urban-class
|
|
2
|
+
|
|
3
|
+
Class and entity-relationship diagram editor web component
|
|
4
|
+
(`<urban-class>`), stored as pure Mermaid (`classDiagram` /
|
|
5
|
+
`erDiagram`) plus a `.extend.yaml` annex (positions, descriptions,
|
|
6
|
+
host references), served from FastAPI / Starlette.
|
|
7
|
+
|
|
8
|
+
```python
|
|
9
|
+
import urban_class
|
|
10
|
+
urban_class.mount(app, "/api/class")
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The page then loads `/api/class/urban-class.js` (ES module) and
|
|
14
|
+
`/api/class/urban-class.css`, and uses the `<urban-class>` element.
|
|
15
|
+
The TypeScript declarations of the public contract are served under
|
|
16
|
+
`/api/class/types/`.
|
|
17
|
+
|
|
18
|
+
The full public contract (properties, methods, events, error codes,
|
|
19
|
+
stored formats) lives in `docs/contrat.yaml` of the repository:
|
|
20
|
+
<https://github.com/gaelgael5/urban-class>.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = [ "hatchling" ]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "urban-class"
|
|
7
|
+
dynamic = [ "version" ]
|
|
8
|
+
description = "Class and entity-relationship diagram editor web component (<urban-class>), served from FastAPI / Starlette"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [ { name = "urban-class contributors" } ]
|
|
13
|
+
keywords = [ "class-diagram", "er-diagram", "mermaid", "editor", "web-component", "fastapi", "starlette" ]
|
|
14
|
+
dependencies = [
|
|
15
|
+
"starlette>=0.37"
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
[project.urls]
|
|
19
|
+
Repository = "https://github.com/gaelgael5/urban-class"
|
|
20
|
+
|
|
21
|
+
[tool.hatch.version]
|
|
22
|
+
path = "urban_class/__init__.py"
|
|
23
|
+
|
|
24
|
+
[tool.hatch.build.targets.wheel]
|
|
25
|
+
packages = [ "urban_class" ]
|
|
26
|
+
artifacts = [ "urban_class/static/**" ]
|
|
27
|
+
|
|
28
|
+
[tool.hatch.build.targets.sdist]
|
|
29
|
+
include = [ "urban_class/**", "README.md" ]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"""urban-class — class / entity-relationship diagram editor web component.
|
|
2
|
+
|
|
3
|
+
The package embeds the built JS and CSS (and the TypeScript types) of
|
|
4
|
+
the ``<urban-class>`` custom element, and serves them from a
|
|
5
|
+
FastAPI / Starlette application::
|
|
6
|
+
|
|
7
|
+
import urban_class
|
|
8
|
+
urban_class.mount(app, "/api/class")
|
|
9
|
+
|
|
10
|
+
The page then loads ``<path>/urban-class.js`` (ES module) and
|
|
11
|
+
``<path>/urban-class.css``, and uses the ``<urban-class>`` element.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
|
|
16
|
+
from .parse import UrbanClassError, parse
|
|
17
|
+
|
|
18
|
+
__all__ = [ "mount", "parse", "UrbanClassError", "STATIC_DIR" ]
|
|
19
|
+
|
|
20
|
+
__version__ = "0.1.0"
|
|
21
|
+
|
|
22
|
+
STATIC_DIR = Path(__file__).parent / "static"
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def mount(app, path: str = "/api/class") -> None:
|
|
26
|
+
"""Serves the component's built assets at ``path``.
|
|
27
|
+
|
|
28
|
+
``app`` is a FastAPI or Starlette application. The JS module is
|
|
29
|
+
then available at ``{path}/urban-class.js``, the stylesheet at
|
|
30
|
+
``{path}/urban-class.css`` and the TypeScript types under
|
|
31
|
+
``{path}/types/``.
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
from starlette.staticfiles import StaticFiles
|
|
35
|
+
|
|
36
|
+
app.mount(path, StaticFiles(directory=STATIC_DIR), name="urban-class")
|