chartedcode 0.1.0__py3-none-macosx_11_0_arm64.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.
- chartedcode/__init__.py +1 -0
- chartedcode/__main__.py +5 -0
- chartedcode/_binary.py +134 -0
- chartedcode/_rust.abi3.so +0 -0
- chartedcode/_rust.pyi +2 -0
- chartedcode-0.1.0.data/scripts/chartedcode +0 -0
- chartedcode-0.1.0.data/scripts/chartedcode-py +4 -0
- chartedcode-0.1.0.dist-info/METADATA +153 -0
- chartedcode-0.1.0.dist-info/RECORD +14 -0
- chartedcode-0.1.0.dist-info/WHEEL +4 -0
- chartedcode-0.1.0.dist-info/licenses/LICENSE +21 -0
- chartedcode-0.1.0.dist-info/licenses/NOTICE +18 -0
- chartedcode-0.1.0.dist-info/licenses/rust/assets/elkjs-LICENSE.md +264 -0
- chartedcode-0.1.0.dist-info/sboms/chartedcode_core.cyclonedx.json +3770 -0
chartedcode/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""chartedcode: diagrams for Python projects, drawn as self-contained HTML."""
|
chartedcode/__main__.py
ADDED
chartedcode/_binary.py
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
"""Running the `chartedcode` command line: as the executable installed alongside this package, or in this process.
|
|
2
|
+
|
|
3
|
+
The in-process mode runs the same program from the `chartedcode._rust` extension module. It is for
|
|
4
|
+
environments where the Python interpreter may run code but no other executable may be started.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
import shutil
|
|
9
|
+
import subprocess
|
|
10
|
+
import sys
|
|
11
|
+
from importlib import import_module
|
|
12
|
+
from pathlib import Path
|
|
13
|
+
from sysconfig import get_config_var, get_path, get_preferred_scheme
|
|
14
|
+
from types import ModuleType
|
|
15
|
+
|
|
16
|
+
IN_PROCESS_VARIABLE = "CHARTEDCODE_INPROC"
|
|
17
|
+
_OFF_VALUES = frozenset({"", "0", "false", "no", "off"})
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class BinaryNotFoundError(FileNotFoundError):
|
|
21
|
+
"""Raised when the `chartedcode` executable is not installed."""
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def find_binary() -> Path:
|
|
25
|
+
"""The `chartedcode` executable: next to the interpreter's scripts, then the user's, then on PATH.
|
|
26
|
+
|
|
27
|
+
Returns:
|
|
28
|
+
The path of the executable.
|
|
29
|
+
|
|
30
|
+
Raises:
|
|
31
|
+
BinaryNotFoundError: If none of those hold it, e.g. the package was installed without it.
|
|
32
|
+
"""
|
|
33
|
+
name = f"chartedcode{get_config_var('EXE') or ''}"
|
|
34
|
+
scripts = Path(get_path("scripts")) / name
|
|
35
|
+
user_scripts = Path(get_path("scripts", scheme=get_preferred_scheme("user"))) / name
|
|
36
|
+
# `pip install --target` puts scripts in a `bin` directory beside the package.
|
|
37
|
+
target = Path(__file__).resolve().parents[1] / "bin" / name
|
|
38
|
+
for candidate in (scripts, user_scripts, target):
|
|
39
|
+
if candidate.is_file():
|
|
40
|
+
return candidate
|
|
41
|
+
on_path = shutil.which("chartedcode")
|
|
42
|
+
if on_path is not None:
|
|
43
|
+
return Path(on_path)
|
|
44
|
+
msg = (
|
|
45
|
+
f"The chartedcode executable was not found (looked for {scripts}). "
|
|
46
|
+
"Reinstall chartedcode from a wheel, or build it from source with: uv run inv build"
|
|
47
|
+
)
|
|
48
|
+
raise BinaryNotFoundError(msg)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _requested_in_process() -> bool:
|
|
52
|
+
"""Whether the environment asks for the program to run inside this process."""
|
|
53
|
+
return os.environ.get(IN_PROCESS_VARIABLE, "").strip().lower() not in _OFF_VALUES
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def _extension() -> ModuleType:
|
|
57
|
+
"""The `chartedcode._rust` extension module.
|
|
58
|
+
|
|
59
|
+
Returns:
|
|
60
|
+
The imported module.
|
|
61
|
+
|
|
62
|
+
Raises:
|
|
63
|
+
BinaryNotFoundError: If the package was installed without it.
|
|
64
|
+
"""
|
|
65
|
+
try:
|
|
66
|
+
return import_module("chartedcode._rust")
|
|
67
|
+
except ImportError as e:
|
|
68
|
+
msg = (
|
|
69
|
+
"The chartedcode extension module (chartedcode._rust) was not found. "
|
|
70
|
+
"Reinstall chartedcode from a wheel, or build it from source with: uv run inv build"
|
|
71
|
+
)
|
|
72
|
+
raise BinaryNotFoundError(msg) from e
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def _executable_missing() -> bool:
|
|
76
|
+
"""Whether the executable is absent."""
|
|
77
|
+
try:
|
|
78
|
+
find_binary()
|
|
79
|
+
except BinaryNotFoundError:
|
|
80
|
+
return True
|
|
81
|
+
return False
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def _in_process() -> bool:
|
|
85
|
+
"""Whether to run in this process: when asked to, or when the executable is missing but the extension is not."""
|
|
86
|
+
if _requested_in_process():
|
|
87
|
+
return True
|
|
88
|
+
if not _executable_missing():
|
|
89
|
+
return False
|
|
90
|
+
try:
|
|
91
|
+
_extension()
|
|
92
|
+
except BinaryNotFoundError:
|
|
93
|
+
return False
|
|
94
|
+
return True
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def run_binary(arguments: list[str], *, capture: bool = False) -> subprocess.CompletedProcess[str]:
|
|
98
|
+
"""Run the command line with `arguments`; with `capture`, its output is returned instead of shared.
|
|
99
|
+
|
|
100
|
+
Args:
|
|
101
|
+
arguments: The command line, without the program name.
|
|
102
|
+
capture: Return standard output and standard error instead of sharing this process's.
|
|
103
|
+
|
|
104
|
+
Returns:
|
|
105
|
+
The finished process, with its exit status.
|
|
106
|
+
|
|
107
|
+
Raises:
|
|
108
|
+
BinaryNotFoundError: If neither the executable nor the extension module is installed.
|
|
109
|
+
"""
|
|
110
|
+
if _in_process():
|
|
111
|
+
extension = _extension()
|
|
112
|
+
if capture:
|
|
113
|
+
status, stdout, stderr = extension.run_captured(["chartedcode", *arguments])
|
|
114
|
+
return subprocess.CompletedProcess(args=arguments, returncode=status, stdout=stdout, stderr=stderr)
|
|
115
|
+
return subprocess.CompletedProcess(args=arguments, returncode=extension.main(["chartedcode", *arguments]))
|
|
116
|
+
return subprocess.run([str(find_binary()), *arguments], capture_output=capture, text=True, check=False)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def main() -> None:
|
|
120
|
+
"""Entry point for `python -m chartedcode`: the command line, with this process's arguments.
|
|
121
|
+
|
|
122
|
+
Where the platform allows it the executable takes this process's place, so no Python process
|
|
123
|
+
is left waiting; Windows has no such call, and runs it as a child instead. Set `CHARTEDCODE_INPROC=1`
|
|
124
|
+
to run in this process instead of starting the executable.
|
|
125
|
+
"""
|
|
126
|
+
if sys.platform == "win32" or _in_process():
|
|
127
|
+
sys.exit(run_binary(sys.argv[1:]).returncode)
|
|
128
|
+
binary = str(find_binary())
|
|
129
|
+
os.execv(binary, [binary, *sys.argv[1:]])
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def main_in_process() -> None:
|
|
133
|
+
"""Entry point for `chartedcode-py`: always the program inside this process, never the executable."""
|
|
134
|
+
sys.exit(_extension().main(["chartedcode", *sys.argv[1:]]))
|
|
Binary file
|
chartedcode/_rust.pyi
ADDED
|
Binary file
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: chartedcode
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
7
|
+
Classifier: Operating System :: OS Independent
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
14
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
15
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
License-File: NOTICE
|
|
18
|
+
License-File: rust/assets/elkjs-LICENSE.md
|
|
19
|
+
Summary: Diagrams for Python projects: class, call and control-flow diagrams, drawn as self-contained HTML by a small deterministic Rust binary.
|
|
20
|
+
Keywords: uml,diagram,call-graph,control-flow,class-diagram,static-analysis,documentation
|
|
21
|
+
Home-Page: https://github.com/w-martin/chartedcode
|
|
22
|
+
Author: William Martin
|
|
23
|
+
License-Expression: MIT
|
|
24
|
+
Requires-Python: >=3.11
|
|
25
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
26
|
+
Project-URL: Homepage, https://github.com/w-martin/chartedcode
|
|
27
|
+
Project-URL: Issue Tracker, https://github.com/w-martin/chartedcode/issues
|
|
28
|
+
Project-URL: Repository, https://github.com/w-martin/chartedcode
|
|
29
|
+
|
|
30
|
+
# chartedcode
|
|
31
|
+
|
|
32
|
+
Diagrams for Python projects: **class**, **call** and **control-flow** diagrams, drawn as self-contained HTML by a small, deterministic Rust program.
|
|
33
|
+
|
|
34
|
+
Point it at a file or a directory. It reads the source (it never runs it), works out how the code fits together, and writes one HTML file per diagram. Each file holds its data, the layout engine and the viewer, so it opens in any browser, works offline, and needs no Graphviz or other renderer installed.
|
|
35
|
+
|
|
36
|
+
```console
|
|
37
|
+
$ chartedcode classes src/ # class diagram
|
|
38
|
+
$ chartedcode calls src/ # call graph
|
|
39
|
+
$ chartedcode flow src/ # control-flow graph of each function
|
|
40
|
+
wrote src-flow.chartedcode.html
|
|
41
|
+
$ chartedcode all src/ -o out/ # all of them, plus the analysis as JSON and a manifest
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
|
|
46
|
+
```console
|
|
47
|
+
$ pip install chartedcode # or: uvx chartedcode calls src/
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The wheel carries the compiled program; there is nothing else to install. Python 3.11 or later.
|
|
51
|
+
|
|
52
|
+
## The diagrams
|
|
53
|
+
|
|
54
|
+
Every relationship says how it was found, and anything the tool could not follow is counted and listed, not guessed at or silently dropped.
|
|
55
|
+
|
|
56
|
+
### `classes`
|
|
57
|
+
|
|
58
|
+
Inheritance, Protocol conformance and field types.
|
|
59
|
+
|
|
60
|
+
- **inherits**: a base class, resolved through imports (including relative imports, re-exports through `__init__.py`, star imports and `TYPE_CHECKING` imports).
|
|
61
|
+
- **implements**: a class has every method name of a `Protocol`. This compares names only, not signatures, so it is shown as weak evidence.
|
|
62
|
+
- **has-a**: a field whose annotation names a class of the project (class-body annotations, and `self.x` assigned from an annotated parameter in `__init__`).
|
|
63
|
+
|
|
64
|
+
### `calls`
|
|
65
|
+
|
|
66
|
+
Which function calls which, and in what order.
|
|
67
|
+
|
|
68
|
+
- **calls** and **constructs** (`Foo()` goes to `Foo.__init__`, or to an implicit constructor when the class defines none).
|
|
69
|
+
- **passes**: a function or method handed to another function as a callback (`runner.run("train", self._trainer.fit)`), which is assumed to be called.
|
|
70
|
+
- **dispatches**: a call to a Protocol method may run any implementer's method of that name.
|
|
71
|
+
- **Call order**: each call is numbered within its caller, in evaluation order (a call's arguments before the call). Numbers appear on the arrows, in a panel listing the focused function's calls, and in an **execution flow** view that chains the calls in order and enters each callee's own calls. Recursion is marked, not drawn, so the execution flow is always acyclic.
|
|
72
|
+
- **Acyclic view**: functions that call each other in a cycle are collapsed into one node. When there are no cycles the page says it is identical to the call graph.
|
|
73
|
+
- Views at function, class or module granularity; focus on one node with its callers and callees to a chosen depth.
|
|
74
|
+
|
|
75
|
+
The colour of an edge says how sure the tool is: resolved by name, import, `self` or `super`; inferred from a declared type; method names only; external.
|
|
76
|
+
|
|
77
|
+
### `flow`
|
|
78
|
+
|
|
79
|
+
The control-flow graph of each function (and of a module's top-level code): basic blocks with their source lines, edges labelled with when they are taken (`true`, `false`, `next item`, `loop`, `break`, `exception`, `return`, ...), unreachable code marked, and a complexity number (decision points plus one). The calls in each block carry the same step numbers as the call graph, and a call that has a flow of its own can be opened with two clicks.
|
|
80
|
+
|
|
81
|
+
Approximations, so the diagram can be read correctly: any statement in a `try` body may raise (one `exception` edge from the body to each handler), context managers do not branch, and boolean operators, conditional expressions and comprehensions do not split a block.
|
|
82
|
+
|
|
83
|
+
## Every diagram at once, for CI
|
|
84
|
+
|
|
85
|
+
```console
|
|
86
|
+
$ chartedcode all src/ -o out/
|
|
87
|
+
wrote 4 files and manifest.json to out/
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
`out/` holds `classes.html`, `calls.html`, `flow.html`, `analysis.json` and `manifest.json`. The names are fixed, so whatever collects them does not need to know the project. The manifest lists each file with its size and SHA-256, the tool and schema versions, and some totals (files analysed, classes, functions, call edges, untraced calls, the highest complexity); it has no timestamps, so the same input gives a byte-identical directory. `analysis.json` is the complete analysis, including control flow, whatever `--min-complexity` does to the flow page.
|
|
91
|
+
|
|
92
|
+
## Embedding the pages
|
|
93
|
+
|
|
94
|
+
Each page is one file with no external requests, no cookies and no browser storage, and it renders inside `<iframe sandbox="allow-scripts">`. A host chooses how a page opens through the URL fragment (`page.html#embed=1&theme=dark`). A page reads `embed` and `theme` again if the fragment changes after load; the other options are read once, when the page opens. There is no other way to drive a page from outside.
|
|
95
|
+
|
|
96
|
+
| Option | Pages | Effect |
|
|
97
|
+
| --- | --- | --- |
|
|
98
|
+
| `embed=1` | all | hide the header and legend, so the diagram fills the frame (the status line and, in the call graph, the order-of-calls panel stay) |
|
|
99
|
+
| `theme=light` or `theme=dark` | all | use these colours whatever the system setting is |
|
|
100
|
+
| `kinds=inherits,implements,composes` | classes | which relationships are shown at first |
|
|
101
|
+
| `view=graph\|exec\|acyclic`, `gran=function\|class\|module` | calls | the view and its granularity |
|
|
102
|
+
| `focus=<function id>`, `depth=N` | calls | the function to focus on and how far to follow its calls |
|
|
103
|
+
| `ext=1`, `untraced=1`, `private=1`, `mincalls=N`, `dir=down` | calls | external calls, untraced-call counts, private names, the focus-list filter, the layout direction |
|
|
104
|
+
| `function=<function id>` | flow | the function to show |
|
|
105
|
+
| `minc=N`, `private=1`, `dir=right` | flow | the complexity filter for the function list, private names, the layout direction |
|
|
106
|
+
|
|
107
|
+
Function ids are the `id` fields of `functions` in `analysis.json`, such as `pkg/app::Service.run`.
|
|
108
|
+
|
|
109
|
+
## What it does not follow
|
|
110
|
+
|
|
111
|
+
Static analysis of a dynamic language has limits. The tool does not infer return types, so a call on a variable whose type is not declared (`model.evaluate()` where `model` is whatever a function returned) is **untraced**: counted per function, listed in the page, never drawn as an edge. It also does not follow dispatch through subclass overrides (only Protocols dispatch), property access that runs code, decorators, `getattr` and other dynamic calls, function-local imports or `__all__`. Branches and loops are flattened in the call numbering: a number means "the order written", not a guaranteed run order.
|
|
112
|
+
|
|
113
|
+
## Options
|
|
114
|
+
|
|
115
|
+
| Option | Effect |
|
|
116
|
+
| --- | --- |
|
|
117
|
+
| `-o, --output FILE` | where to write the result; by default `<name>-<view>.chartedcode.html` in the current directory, or standard output for JSON |
|
|
118
|
+
| `--format html\|json` | the page, or the analysis as JSON (`schema_version` 1; always includes private names) |
|
|
119
|
+
| `--include-private` | start with private names (a single leading underscore) shown; the page hides them by default |
|
|
120
|
+
| `--no-gitignore` | also analyse files matched by `.gitignore` (by default they and hidden directories are skipped; the global ignore file is never read, so a checkout gives the same result everywhere) |
|
|
121
|
+
| `--no-source` | `flow` only: leave source text out of the diagram, so blocks show only line numbers |
|
|
122
|
+
| `--min-complexity N` | `flow` only: only draw functions of at least this complexity |
|
|
123
|
+
|
|
124
|
+
The same input always gives byte-identical output.
|
|
125
|
+
|
|
126
|
+
**A `flow` page contains the source text of your functions.** Use `--no-source` before sharing one if that matters.
|
|
127
|
+
|
|
128
|
+
## From Python
|
|
129
|
+
|
|
130
|
+
```console
|
|
131
|
+
$ python -m chartedcode calls src/
|
|
132
|
+
$ chartedcode-py calls src/ # always inside this process
|
|
133
|
+
$ CHARTEDCODE_INPROC=1 python -m chartedcode calls src/
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
`python -m chartedcode` starts the executable that came with the package. For environments where the interpreter may run code but no other program may be started, `chartedcode-py` (or `CHARTEDCODE_INPROC=1`) runs the same program inside the interpreter, through an extension module; the output is identical. `chartedcode._binary.run_binary(["calls", "src/", "--format", "json"], capture=True)` runs it from code.
|
|
137
|
+
|
|
138
|
+
## Development
|
|
139
|
+
|
|
140
|
+
```console
|
|
141
|
+
$ uv sync
|
|
142
|
+
$ uv run inv build # build the executable and the extension, and install them
|
|
143
|
+
$ uv run inv all # format, lint, test (Rust and Python), verify licences
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
- `uv run inv test` builds first. Run bare `pytest` as `uv run --no-sync pytest` after `uv run inv build`: a plain `uv run` re-syncs the project and can put an older cached build over the one just installed. The test session refuses to run against an executable older than the Rust sources.
|
|
147
|
+
- The browser tests drive a headless Chrome and are skipped when none is found (set `CHROME` to its path).
|
|
148
|
+
- Build wheels from the working tree after staging the extension (`uv run inv build` does that), with `maturin build --profile cli`. `uv build` builds the wheel from the source distribution, which does not contain the compiled extension.
|
|
149
|
+
|
|
150
|
+
## Licence
|
|
151
|
+
|
|
152
|
+
MIT (see `LICENSE`). Every page embeds [elkjs](https://github.com/kieler/elkjs) 0.11.0, unmodified, which is licensed under the Eclipse Public License 2.0; see `NOTICE` and `rust/assets/elkjs-LICENSE.md`.
|
|
153
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
chartedcode/__init__.py,sha256=4i1wz2e8ouP_Kd0Y6VKa8YdDqv8IXq_gYnJh6e3l8Wc,79
|
|
2
|
+
chartedcode/__main__.py,sha256=hY0j7sczeOTYJvkEZg9pzGMiMN9tO7lTxdXw0QzTfPc,113
|
|
3
|
+
chartedcode/_binary.py,sha256=bxbXWOhZveouie5AuG8iJMu3hoGXv8ROE5X1Me7RzQE,4951
|
|
4
|
+
chartedcode/_rust.abi3.so,sha256=-eQ0oaxwqQdl_vex7Y9ykukdwLuAR5abG-ov7D14tKU,4967648
|
|
5
|
+
chartedcode/_rust.pyi,sha256=rw7s1veaUFlWSZ31Ap65DPgbkN49UVr1LVweaFjrj-o,101
|
|
6
|
+
chartedcode-0.1.0.data/scripts/chartedcode,sha256=tkb3pnQtV9zAuidxiOx_e4WxDDHfkcWDLaWKBrrKxa0,4121440
|
|
7
|
+
chartedcode-0.1.0.data/scripts/chartedcode-py,sha256=-BaOvSNC8-OD9n2I6_qEpSlWOBvN3q2jpYHU232X4WA,76
|
|
8
|
+
chartedcode-0.1.0.dist-info/METADATA,sha256=hrJ0TY78A08Q3GsHV3L2SKG66S8z7Od_UoQLCdyY-qM,10485
|
|
9
|
+
chartedcode-0.1.0.dist-info/WHEEL,sha256=Fvrs5zUKO4nQbE5Fttn9y8loVOWxn3I3-bRdoW2U0nw,102
|
|
10
|
+
chartedcode-0.1.0.dist-info/licenses/LICENSE,sha256=Nqlbsaz8L1PwV5uqh8CXUBFGrDAgh-hEYFTt5MsHSmU,1071
|
|
11
|
+
chartedcode-0.1.0.dist-info/licenses/NOTICE,sha256=cw4we5qskFiMuLf5eJZtEjYRJA0Vwm5O-zn4nZE6rRs,903
|
|
12
|
+
chartedcode-0.1.0.dist-info/licenses/rust/assets/elkjs-LICENSE.md,sha256=iVkdRXj7Hr2RUBMSo9JfAhvYZaLkNmQcHPexvH48Fhc,14480
|
|
13
|
+
chartedcode-0.1.0.dist-info/sboms/chartedcode_core.cyclonedx.json,sha256=XMsas0__GW5GFvjfgsBYSBe4MFshZiwyiGtDtoykPGE,119690
|
|
14
|
+
chartedcode-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 William Martin
|
|
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.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
chartedcode is licensed under the MIT License (see LICENSE). The diagrams it writes embed
|
|
2
|
+
the following third-party code, under its own terms:
|
|
3
|
+
|
|
4
|
+
## elkjs
|
|
5
|
+
|
|
6
|
+
rust/assets/elk.bundled.js is elkjs 0.11.0, the Eclipse Layout Kernel compiled to JavaScript
|
|
7
|
+
(https://github.com/kieler/elkjs). It is included unmodified, and every HTML diagram that
|
|
8
|
+
chartedcode generates contains a copy of it so that the diagram works offline.
|
|
9
|
+
|
|
10
|
+
elkjs is licensed under the Eclipse Public License 2.0 (EPL-2.0); the full text is in
|
|
11
|
+
rust/assets/elkjs-LICENSE.md. The corresponding source is available from the repository
|
|
12
|
+
above. The SHA-256 of the bundled file is recorded in rust/assets/elk.bundled.js.sha256 and
|
|
13
|
+
checked by the test suite.
|
|
14
|
+
|
|
15
|
+
## Rust crates
|
|
16
|
+
|
|
17
|
+
The executable is built from Rust crates whose licences are listed by `cargo metadata`;
|
|
18
|
+
among them, the Python parser comes from Ruff (https://github.com/astral-sh/ruff, MIT).
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
# Eclipse Public License - v 2.0
|
|
2
|
+
|
|
3
|
+
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
|
|
4
|
+
PUBLIC LICENSE (“AGREEMENT”). ANY USE, REPRODUCTION OR DISTRIBUTION OF
|
|
5
|
+
THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
|
6
|
+
|
|
7
|
+
## 1. DEFINITIONS
|
|
8
|
+
|
|
9
|
+
“Contribution” means:
|
|
10
|
+
|
|
11
|
+
- a\) in the case of the initial Contributor, the initial content
|
|
12
|
+
Distributed under this Agreement, and
|
|
13
|
+
- b\) in the case of each subsequent Contributor:
|
|
14
|
+
- i\) changes to the Program, and
|
|
15
|
+
- ii\) additions to the Program;
|
|
16
|
+
|
|
17
|
+
where such changes and/or additions to the Program originate from
|
|
18
|
+
and are Distributed by that particular Contributor. A Contribution
|
|
19
|
+
“originates” from a Contributor if it was added to the Program by
|
|
20
|
+
such Contributor itself or anyone acting on such Contributor's
|
|
21
|
+
behalf. Contributions do not include changes or additions to the
|
|
22
|
+
Program that are not Modified Works.
|
|
23
|
+
|
|
24
|
+
“Contributor” means any person or entity that Distributes the Program.
|
|
25
|
+
|
|
26
|
+
“Licensed Patents” mean patent claims licensable by a Contributor which
|
|
27
|
+
are necessarily infringed by the use or sale of its Contribution alone
|
|
28
|
+
or when combined with the Program.
|
|
29
|
+
|
|
30
|
+
“Program” means the Contributions Distributed in accordance with this
|
|
31
|
+
Agreement.
|
|
32
|
+
|
|
33
|
+
“Recipient” means anyone who receives the Program under this Agreement
|
|
34
|
+
or any Secondary License (as applicable), including Contributors.
|
|
35
|
+
|
|
36
|
+
“Derivative Works” shall mean any work, whether in Source Code or other
|
|
37
|
+
form, that is based on (or derived from) the Program and for which the
|
|
38
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
39
|
+
represent, as a whole, an original work of authorship.
|
|
40
|
+
|
|
41
|
+
“Modified Works” shall mean any work in Source Code or other form that
|
|
42
|
+
results from an addition to, deletion from, or modification of the
|
|
43
|
+
contents of the Program, including, for purposes of clarity any new file
|
|
44
|
+
in Source Code form that contains any contents of the Program. Modified
|
|
45
|
+
Works shall not include works that contain only declarations,
|
|
46
|
+
interfaces, types, classes, structures, or files of the Program solely
|
|
47
|
+
in each case in order to link to, bind by name, or subclass the Program
|
|
48
|
+
or Modified Works thereof.
|
|
49
|
+
|
|
50
|
+
“Distribute” means the acts of a) distributing or b) making available in
|
|
51
|
+
any manner that enables the transfer of a copy.
|
|
52
|
+
|
|
53
|
+
“Source Code” means the form of a Program preferred for making
|
|
54
|
+
modifications, including but not limited to software source code,
|
|
55
|
+
documentation source, and configuration files.
|
|
56
|
+
|
|
57
|
+
“Secondary License” means either the GNU General Public License, Version
|
|
58
|
+
2.0, or any later versions of that license, including any exceptions or
|
|
59
|
+
additional permissions as identified by the initial Contributor.
|
|
60
|
+
|
|
61
|
+
## 2. GRANT OF RIGHTS
|
|
62
|
+
|
|
63
|
+
- a\) Subject to the terms of this Agreement, each Contributor hereby
|
|
64
|
+
grants Recipient a non-exclusive, worldwide, royalty-free copyright
|
|
65
|
+
license to reproduce, prepare Derivative Works of, publicly display,
|
|
66
|
+
publicly perform, Distribute and sublicense the Contribution of such
|
|
67
|
+
Contributor, if any, and such Derivative Works.
|
|
68
|
+
- b\) Subject to the terms of this Agreement, each Contributor hereby
|
|
69
|
+
grants Recipient a non-exclusive, worldwide, royalty-free patent license
|
|
70
|
+
under Licensed Patents to make, use, sell, offer to sell, import and
|
|
71
|
+
otherwise transfer the Contribution of such Contributor, if any, in
|
|
72
|
+
Source Code or other form. This patent license shall apply to the
|
|
73
|
+
combination of the Contribution and the Program if, at the time the
|
|
74
|
+
Contribution is added by the Contributor, such addition of the
|
|
75
|
+
Contribution causes such combination to be covered by the
|
|
76
|
+
Licensed Patents. The patent license shall not apply to any other
|
|
77
|
+
combinations which include the Contribution. No hardware per se is
|
|
78
|
+
licensed hereunder.
|
|
79
|
+
- c\) Recipient understands that although each Contributor grants the
|
|
80
|
+
licenses to its Contributions set forth herein, no assurances are
|
|
81
|
+
provided by any Contributor that the Program does not infringe the
|
|
82
|
+
patent or other intellectual property rights of any other entity. Each
|
|
83
|
+
Contributor disclaims any liability to Recipient for claims brought by
|
|
84
|
+
any other entity based on infringement of intellectual property rights
|
|
85
|
+
or otherwise. As a condition to exercising the rights and licenses
|
|
86
|
+
granted hereunder, each Recipient hereby assumes sole responsibility to
|
|
87
|
+
secure any other intellectual property rights needed, if any. For
|
|
88
|
+
example, if a third party patent license is required to allow Recipient
|
|
89
|
+
to Distribute the Program, it is Recipient's responsibility to acquire
|
|
90
|
+
that license before distributing the Program.
|
|
91
|
+
- d\) Each Contributor represents that to its knowledge it has sufficient
|
|
92
|
+
copyright rights in its Contribution, if any, to grant the copyright
|
|
93
|
+
license set forth in this Agreement.
|
|
94
|
+
- e\) Notwithstanding the terms of any Secondary License, no Contributor
|
|
95
|
+
makes additional grants to any Recipient (other than those set forth in
|
|
96
|
+
this Agreement) as a result of such Recipient's receipt of the Program
|
|
97
|
+
under the terms of a Secondary License (if permitted under the terms of
|
|
98
|
+
Section 3).
|
|
99
|
+
|
|
100
|
+
## 3. REQUIREMENTS
|
|
101
|
+
|
|
102
|
+
3.1 If a Contributor Distributes the Program in any form, then:
|
|
103
|
+
|
|
104
|
+
- a\) the Program must also be made available as Source Code, in accordance
|
|
105
|
+
with section 3.2, and the Contributor must accompany the Program with a
|
|
106
|
+
statement that the Source Code for the Program is available under this
|
|
107
|
+
Agreement, and informs Recipients how to obtain it in a reasonable
|
|
108
|
+
manner on or through a medium customarily used for software exchange;
|
|
109
|
+
and
|
|
110
|
+
- b\) the Contributor may Distribute the Program under a license different
|
|
111
|
+
than this Agreement, provided that such license:
|
|
112
|
+
- i\) effectively disclaims on behalf of all other Contributors all
|
|
113
|
+
warranties and conditions, express and implied, including warranties or
|
|
114
|
+
conditions of title and non-infringement, and implied warranties or
|
|
115
|
+
conditions of merchantability and fitness for a particular purpose;
|
|
116
|
+
- ii\) effectively excludes on behalf of all other Contributors all
|
|
117
|
+
liability for damages, including direct, indirect, special, incidental
|
|
118
|
+
and consequential damages, such as lost profits;
|
|
119
|
+
- iii\) does not attempt to limit or alter the recipients' rights in the
|
|
120
|
+
Source Code under section 3.2; and
|
|
121
|
+
- iv\) requires any subsequent distribution of the Program by any party to
|
|
122
|
+
be under a license that satisfies the requirements of this section 3.
|
|
123
|
+
|
|
124
|
+
3.2 When the Program is Distributed as Source Code:
|
|
125
|
+
|
|
126
|
+
- a\) it must be made available under this Agreement, or if the Program (i)
|
|
127
|
+
is combined with other material in a separate file or files made
|
|
128
|
+
available under a Secondary License, and (ii) the initial Contributor
|
|
129
|
+
attached to the Source Code the notice described in Exhibit A of this
|
|
130
|
+
Agreement, then the Program may be made available under the terms of
|
|
131
|
+
such Secondary Licenses, and
|
|
132
|
+
- b\) a copy of this Agreement must be included with each copy of
|
|
133
|
+
the Program.
|
|
134
|
+
|
|
135
|
+
3.3 Contributors may not remove or alter any copyright, patent,
|
|
136
|
+
trademark, attribution notices, disclaimers of warranty, or limitations
|
|
137
|
+
of liability (‘notices’) contained within the Program from any copy of
|
|
138
|
+
the Program which they Distribute, provided that Contributors may add
|
|
139
|
+
their own appropriate notices.
|
|
140
|
+
|
|
141
|
+
## 4. COMMERCIAL DISTRIBUTION
|
|
142
|
+
|
|
143
|
+
Commercial distributors of software may accept certain responsibilities
|
|
144
|
+
with respect to end users, business partners and the like. While this
|
|
145
|
+
license is intended to facilitate the commercial use of the Program, the
|
|
146
|
+
Contributor who includes the Program in a commercial product offering
|
|
147
|
+
should do so in a manner which does not create potential liability for
|
|
148
|
+
other Contributors. Therefore, if a Contributor includes the Program in
|
|
149
|
+
a commercial product offering, such Contributor (“Commercial
|
|
150
|
+
Contributor”) hereby agrees to defend and indemnify every other
|
|
151
|
+
Contributor (“Indemnified Contributor”) against any losses, damages and
|
|
152
|
+
costs (collectively “Losses”) arising from claims, lawsuits and other
|
|
153
|
+
legal actions brought by a third party against the Indemnified
|
|
154
|
+
Contributor to the extent caused by the acts or omissions of such
|
|
155
|
+
Commercial Contributor in connection with its distribution of the
|
|
156
|
+
Program in a commercial product offering. The obligations in this
|
|
157
|
+
section do not apply to any claims or Losses relating to any actual or
|
|
158
|
+
alleged intellectual property infringement. In order to qualify, an
|
|
159
|
+
Indemnified Contributor must: a) promptly notify the Commercial
|
|
160
|
+
Contributor in writing of such claim, and b) allow the Commercial
|
|
161
|
+
Contributor to control, and cooperate with the Commercial Contributor
|
|
162
|
+
in, the defense and any related settlement negotiations. The Indemnified
|
|
163
|
+
Contributor may participate in any such claim at its own expense.
|
|
164
|
+
|
|
165
|
+
For example, a Contributor might include the Program in a commercial
|
|
166
|
+
product offering, Product X. That Contributor is then a Commercial
|
|
167
|
+
Contributor. If that Commercial Contributor then makes performance
|
|
168
|
+
claims, or offers warranties related to Product X, those performance
|
|
169
|
+
claims and warranties are such Commercial Contributor's responsibility
|
|
170
|
+
alone. Under this section, the Commercial Contributor would have to
|
|
171
|
+
defend claims against the other Contributors related to those
|
|
172
|
+
performance claims and warranties, and if a court requires any other
|
|
173
|
+
Contributor to pay any damages as a result, the Commercial Contributor
|
|
174
|
+
must pay those damages.
|
|
175
|
+
|
|
176
|
+
## 5. NO WARRANTY {#warranty}
|
|
177
|
+
|
|
178
|
+
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
|
|
179
|
+
PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN “AS IS”
|
|
180
|
+
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
|
|
181
|
+
IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF
|
|
182
|
+
TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
|
|
183
|
+
PURPOSE. Each Recipient is solely responsible for determining the
|
|
184
|
+
appropriateness of using and distributing the Program and assumes all
|
|
185
|
+
risks associated with its exercise of rights under this Agreement,
|
|
186
|
+
including but not limited to the risks and costs of program errors,
|
|
187
|
+
compliance with applicable laws, damage to or loss of data, programs or
|
|
188
|
+
equipment, and unavailability or interruption of operations.
|
|
189
|
+
|
|
190
|
+
## 6. DISCLAIMER OF LIABILITY {#disclaimer}
|
|
191
|
+
|
|
192
|
+
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
|
|
193
|
+
PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS
|
|
194
|
+
SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
195
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
|
|
196
|
+
PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
197
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
198
|
+
ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
|
|
199
|
+
EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
|
|
200
|
+
POSSIBILITY OF SUCH DAMAGES.
|
|
201
|
+
|
|
202
|
+
## 7. GENERAL
|
|
203
|
+
|
|
204
|
+
If any provision of this Agreement is invalid or unenforceable under
|
|
205
|
+
applicable law, it shall not affect the validity or enforceability of
|
|
206
|
+
the remainder of the terms of this Agreement, and without further action
|
|
207
|
+
by the parties hereto, such provision shall be reformed to the minimum
|
|
208
|
+
extent necessary to make such provision valid and enforceable.
|
|
209
|
+
|
|
210
|
+
If Recipient institutes patent litigation against any entity (including
|
|
211
|
+
a cross-claim or counterclaim in a lawsuit) alleging that the Program
|
|
212
|
+
itself (excluding combinations of the Program with other software or
|
|
213
|
+
hardware) infringes such Recipient's patent(s), then such Recipient's
|
|
214
|
+
rights granted under Section 2(b) shall terminate as of the date such
|
|
215
|
+
litigation is filed.
|
|
216
|
+
|
|
217
|
+
All Recipient's rights under this Agreement shall terminate if it fails
|
|
218
|
+
to comply with any of the material terms or conditions of this Agreement
|
|
219
|
+
and does not cure such failure in a reasonable period of time after
|
|
220
|
+
becoming aware of such noncompliance. If all Recipient's rights under
|
|
221
|
+
this Agreement terminate, Recipient agrees to cease use and distribution
|
|
222
|
+
of the Program as soon as reasonably practicable. However, Recipient's
|
|
223
|
+
obligations under this Agreement and any licenses granted by Recipient
|
|
224
|
+
relating to the Program shall continue and survive.
|
|
225
|
+
|
|
226
|
+
Everyone is permitted to copy and distribute copies of this Agreement,
|
|
227
|
+
but in order to avoid inconsistency the Agreement is copyrighted and may
|
|
228
|
+
only be modified in the following manner. The Agreement Steward reserves
|
|
229
|
+
the right to publish new versions (including revisions) of this
|
|
230
|
+
Agreement from time to time. No one other than the Agreement Steward has
|
|
231
|
+
the right to modify this Agreement. The Eclipse Foundation is the
|
|
232
|
+
initial Agreement Steward. The Eclipse Foundation may assign the
|
|
233
|
+
responsibility to serve as the Agreement Steward to a suitable separate
|
|
234
|
+
entity. Each new version of the Agreement will be given a distinguishing
|
|
235
|
+
version number. The Program (including Contributions) may always be
|
|
236
|
+
Distributed subject to the version of the Agreement under which it was
|
|
237
|
+
received. In addition, after a new version of the Agreement is
|
|
238
|
+
published, Contributor may elect to Distribute the Program (including
|
|
239
|
+
its Contributions) under the new version.
|
|
240
|
+
|
|
241
|
+
Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
|
|
242
|
+
receives no rights or licenses to the intellectual property of any
|
|
243
|
+
Contributor under this Agreement, whether expressly, by implication,
|
|
244
|
+
estoppel or otherwise. All rights in the Program not expressly granted
|
|
245
|
+
under this Agreement are reserved. Nothing in this Agreement is intended
|
|
246
|
+
to be enforceable by any entity that is not a Contributor or Recipient.
|
|
247
|
+
No third-party beneficiary rights are created under this Agreement.
|
|
248
|
+
|
|
249
|
+
## Exhibit A – Form of Secondary Licenses Notice {#exhibit-a}
|
|
250
|
+
|
|
251
|
+
“This Source Code may also be made available under the following
|
|
252
|
+
Secondary Licenses when the conditions for such availability set forth
|
|
253
|
+
in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
|
|
254
|
+
version(s), and exceptions or additional permissions here}.”
|
|
255
|
+
|
|
256
|
+
> Simply including a copy of this Agreement, including this Exhibit A is
|
|
257
|
+
> not sufficient to license the Source Code under Secondary Licenses.
|
|
258
|
+
>
|
|
259
|
+
> If it is not possible or desirable to put the notice in a particular
|
|
260
|
+
> file, then You may include the notice in a location (such as a LICENSE
|
|
261
|
+
> file in a relevant directory) where a recipient would be likely to
|
|
262
|
+
> look for such a notice.
|
|
263
|
+
>
|
|
264
|
+
> You may add additional accurate notices of copyright ownership.
|