gaspatchio-viewer 0.1.0rc1__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.
- gaspatchio_viewer-0.1.0rc1/.gitignore +23 -0
- gaspatchio_viewer-0.1.0rc1/LICENSES/Apache-2.0.txt +73 -0
- gaspatchio_viewer-0.1.0rc1/LICENSES/BSD-3-Clause.txt +11 -0
- gaspatchio_viewer-0.1.0rc1/LICENSES/ISC.txt +7 -0
- gaspatchio_viewer-0.1.0rc1/LICENSES/MIT.txt +20 -0
- gaspatchio_viewer-0.1.0rc1/LICENSES/OFL-1.1.txt +43 -0
- gaspatchio_viewer-0.1.0rc1/PKG-INFO +46 -0
- gaspatchio_viewer-0.1.0rc1/README.md +14 -0
- gaspatchio_viewer-0.1.0rc1/gaspatchio_viewer/__init__.py +371 -0
- gaspatchio_viewer-0.1.0rc1/gaspatchio_viewer/assets/favicon.svg +1 -0
- gaspatchio_viewer-0.1.0rc1/gaspatchio_viewer/assets/fonts.css +12 -0
- gaspatchio_viewer-0.1.0rc1/gaspatchio_viewer/assets/third-party-notices.txt +629 -0
- gaspatchio_viewer-0.1.0rc1/gaspatchio_viewer/assets/viewer.css +8 -0
- gaspatchio_viewer-0.1.0rc1/gaspatchio_viewer/assets/viewer.js +113 -0
- gaspatchio_viewer-0.1.0rc1/gaspatchio_viewer/py.typed +0 -0
- gaspatchio_viewer-0.1.0rc1/pyproject.toml +71 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
node_modules/
|
|
2
|
+
dist/
|
|
3
|
+
test-results/
|
|
4
|
+
playwright-report/
|
|
5
|
+
# The refusal cases' fixtures. `e2e/refusals.spec.ts` writes each one — a schema
|
|
6
|
+
# this page does not read, a file that is not JSON, six hundred nodes, a sample
|
|
7
|
+
# a test moved — packs a page from it and asserts the sentence the page prints.
|
|
8
|
+
# They are edits and breakages, not exports, and a broken artifact sitting in a
|
|
9
|
+
# fixtures directory is a thing somebody will one day open by mistake.
|
|
10
|
+
fixtures/refusal-*
|
|
11
|
+
# And the ones the inspector and comparison cases write: a committed export
|
|
12
|
+
# with its book taken away, or stated as a book nobody could digest, packed to
|
|
13
|
+
# show the page printing what the file says about it.
|
|
14
|
+
fixtures/written-*
|
|
15
|
+
# What the two measuring commands leave behind. `perf/results.json` is frame
|
|
16
|
+
# times on one machine and `build.json` is the byte counts `build.mjs` printed
|
|
17
|
+
# on one build; committing either would put a fact about somebody's laptop into
|
|
18
|
+
# the history and invite the next reader to quote it as though it were the
|
|
19
|
+
# repository's. The figures worth keeping are quoted in the commit that takes
|
|
20
|
+
# them, beside the command and the commit that produced them — the ceiling in
|
|
21
|
+
# .github/ratchets.env is the one of these numbers the repository keeps.
|
|
22
|
+
perf/results.json
|
|
23
|
+
build.json
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
10
|
+
|
|
11
|
+
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
12
|
+
|
|
13
|
+
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
14
|
+
|
|
15
|
+
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
16
|
+
|
|
17
|
+
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
18
|
+
|
|
19
|
+
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
20
|
+
|
|
21
|
+
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
|
22
|
+
|
|
23
|
+
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
24
|
+
|
|
25
|
+
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
|
26
|
+
|
|
27
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
28
|
+
|
|
29
|
+
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
30
|
+
|
|
31
|
+
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
|
32
|
+
|
|
33
|
+
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
34
|
+
|
|
35
|
+
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
|
36
|
+
|
|
37
|
+
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
|
|
38
|
+
|
|
39
|
+
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
|
40
|
+
|
|
41
|
+
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
|
42
|
+
|
|
43
|
+
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
|
44
|
+
|
|
45
|
+
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
46
|
+
|
|
47
|
+
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
48
|
+
|
|
49
|
+
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
50
|
+
|
|
51
|
+
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
52
|
+
|
|
53
|
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
54
|
+
|
|
55
|
+
END OF TERMS AND CONDITIONS
|
|
56
|
+
|
|
57
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
58
|
+
|
|
59
|
+
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
|
|
60
|
+
|
|
61
|
+
Copyright [yyyy] [name of copyright owner]
|
|
62
|
+
|
|
63
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
64
|
+
you may not use this file except in compliance with the License.
|
|
65
|
+
You may obtain a copy of the License at
|
|
66
|
+
|
|
67
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
68
|
+
|
|
69
|
+
Unless required by applicable law or agreed to in writing, software
|
|
70
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
71
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
72
|
+
See the License for the specific language governing permissions and
|
|
73
|
+
limitations under the License.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Copyright (c) <year> <owner>.
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
4
|
+
|
|
5
|
+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
6
|
+
|
|
7
|
+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
|
8
|
+
|
|
9
|
+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
|
10
|
+
|
|
11
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright <year> <owner>
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) <year> <copyright holders>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
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, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
19
|
+
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
SIL OPEN FONT LICENSE
|
|
2
|
+
|
|
3
|
+
Version 1.1 - 26 February 2007
|
|
4
|
+
|
|
5
|
+
PREAMBLE
|
|
6
|
+
|
|
7
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
|
|
8
|
+
|
|
9
|
+
The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
|
|
10
|
+
|
|
11
|
+
DEFINITIONS
|
|
12
|
+
|
|
13
|
+
"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
|
|
14
|
+
|
|
15
|
+
"Reserved Font Name" refers to any names specified as such after the copyright statement(s).
|
|
16
|
+
|
|
17
|
+
"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).
|
|
18
|
+
|
|
19
|
+
"Modified Version" refers to any derivative made by adding to, deleting, or substituting — in part or in whole — any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
|
|
20
|
+
|
|
21
|
+
"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
|
|
22
|
+
|
|
23
|
+
PERMISSION & CONDITIONS
|
|
24
|
+
|
|
25
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
|
|
26
|
+
|
|
27
|
+
1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
|
|
28
|
+
|
|
29
|
+
2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
|
|
30
|
+
|
|
31
|
+
3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
|
|
32
|
+
|
|
33
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
|
|
34
|
+
|
|
35
|
+
5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
|
|
36
|
+
|
|
37
|
+
TERMINATION
|
|
38
|
+
|
|
39
|
+
This license becomes null and void if any of the above conditions are not met.
|
|
40
|
+
|
|
41
|
+
DISCLAIMER
|
|
42
|
+
|
|
43
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: gaspatchio-viewer
|
|
3
|
+
Version: 0.1.0rc1
|
|
4
|
+
Summary: The viewer's built page, for gspio calc-graph --html
|
|
5
|
+
Project-URL: Homepage, https://gaspatchio.dev/
|
|
6
|
+
Project-URL: Documentation, https://gaspatchio.dev/
|
|
7
|
+
Project-URL: Repository, https://github.com/gaspatchio/gaspatchio
|
|
8
|
+
Project-URL: Issues, https://github.com/gaspatchio/gaspatchio/issues
|
|
9
|
+
Author-email: mrmattwright <matt@opioinc.com>
|
|
10
|
+
License-Expression: Apache-2.0 AND BSD-3-Clause AND ISC AND MIT AND OFL-1.1
|
|
11
|
+
License-File: LICENSES/Apache-2.0.txt
|
|
12
|
+
License-File: LICENSES/BSD-3-Clause.txt
|
|
13
|
+
License-File: LICENSES/ISC.txt
|
|
14
|
+
License-File: LICENSES/MIT.txt
|
|
15
|
+
License-File: LICENSES/OFL-1.1.txt
|
|
16
|
+
License-File: gaspatchio_viewer/assets/third-party-notices.txt
|
|
17
|
+
Classifier: Development Status :: 4 - Beta
|
|
18
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
19
|
+
Classifier: Operating System :: OS Independent
|
|
20
|
+
Classifier: Programming Language :: JavaScript
|
|
21
|
+
Classifier: Programming Language :: Python :: 3
|
|
22
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
28
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
29
|
+
Classifier: Typing :: Typed
|
|
30
|
+
Requires-Python: >=3.10
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# gaspatchio-viewer
|
|
34
|
+
|
|
35
|
+
The built page behind `gspio calc-graph model.py points.parquet --html out.html`.
|
|
36
|
+
|
|
37
|
+
One artifact in, one HTML file out: bundle, styles, three font faces and the
|
|
38
|
+
soup can, all inside the file. The page fetches nothing, computes nothing and
|
|
39
|
+
writes nothing — every number on it is a value the artifact carries. It ends
|
|
40
|
+
with the licence notices of the packages and fonts it carries, in a comment
|
|
41
|
+
after `</html>`, which says how to read them back.
|
|
42
|
+
|
|
43
|
+
pip install "gaspatchio[viewer]"
|
|
44
|
+
|
|
45
|
+
Nothing here imports gaspatchio. The source it is built from is `viewer/` in
|
|
46
|
+
the gaspatchio repository.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# gaspatchio-viewer
|
|
2
|
+
|
|
3
|
+
The built page behind `gspio calc-graph model.py points.parquet --html out.html`.
|
|
4
|
+
|
|
5
|
+
One artifact in, one HTML file out: bundle, styles, three font faces and the
|
|
6
|
+
soup can, all inside the file. The page fetches nothing, computes nothing and
|
|
7
|
+
writes nothing — every number on it is a value the artifact carries. It ends
|
|
8
|
+
with the licence notices of the packages and fonts it carries, in a comment
|
|
9
|
+
after `</html>`, which says how to read them back.
|
|
10
|
+
|
|
11
|
+
pip install "gaspatchio[viewer]"
|
|
12
|
+
|
|
13
|
+
Nothing here imports gaspatchio. The source it is built from is `viewer/` in
|
|
14
|
+
the gaspatchio repository.
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: 2026 Opio Inc.
|
|
2
|
+
#
|
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
|
|
5
|
+
"""The viewer's built page, and the calls that assemble it.
|
|
6
|
+
|
|
7
|
+
This distribution carries JavaScript, styles, three font faces and a favicon,
|
|
8
|
+
and knows how to put them around one artifact. It is not the reader: the reader
|
|
9
|
+
is the TypeScript under ``viewer/src`` that the bundle was built from. What is
|
|
10
|
+
here is the last step -- one document, with everything it needs inside it.
|
|
11
|
+
|
|
12
|
+
It is a separate distribution for one reason. The core wheel carries no
|
|
13
|
+
JavaScript, so an actuary who installs gaspatchio to run a model downloads a
|
|
14
|
+
model runner; someone who wants to look at the graph asks for the extra and
|
|
15
|
+
gets the page. Nothing here imports gaspatchio, and gaspatchio imports this
|
|
16
|
+
only through :mod:`gaspatchio.frame.graph.html_export`, which refuses by name
|
|
17
|
+
when it is absent.
|
|
18
|
+
|
|
19
|
+
The page the assembled document opens is offline in the strong sense: no
|
|
20
|
+
stylesheet is linked, no script is fetched, no font is requested, and the
|
|
21
|
+
favicon is the file's own bytes. Hand the HTML to someone with no network and
|
|
22
|
+
they see exactly what you saw.
|
|
23
|
+
|
|
24
|
+
It carries its licences the same way. The bundle and the fonts are other
|
|
25
|
+
people's work, each licensed on the condition that its notice travels with it,
|
|
26
|
+
and a page travels without the wheel it came from. So every page ends with the
|
|
27
|
+
third-party notices, :func:`notices`, in a comment after ``</html>``.
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
from __future__ import annotations
|
|
31
|
+
|
|
32
|
+
import base64
|
|
33
|
+
import re
|
|
34
|
+
from importlib.resources import files
|
|
35
|
+
|
|
36
|
+
__all__ = ["__version__", "bundle", "notices", "render", "styles"]
|
|
37
|
+
|
|
38
|
+
__version__ = "0.1.0rc1"
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def _asset(name: str) -> str:
|
|
42
|
+
"""Return one built asset's text, from the package's own data."""
|
|
43
|
+
return (files(__package__ or "gaspatchio_viewer") / "assets" / name).read_text(
|
|
44
|
+
encoding="utf-8"
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def bundle() -> str:
|
|
49
|
+
"""Return the built viewer, as one piece of JavaScript.
|
|
50
|
+
|
|
51
|
+
The whole reader and its shell, packed by ``viewer/build.mjs`` and shipped
|
|
52
|
+
as package data rather than built at install time: a wheel that had to run
|
|
53
|
+
a JavaScript toolchain to be usable would be a JavaScript toolchain the
|
|
54
|
+
actuary installed without asking for one.
|
|
55
|
+
|
|
56
|
+
It carries other people's code -- React, React Flow, dagre and the rest --
|
|
57
|
+
licensed on the condition that their notices travel with it. A page built
|
|
58
|
+
from it must carry :func:`notices` too, as every page :func:`render`
|
|
59
|
+
writes does.
|
|
60
|
+
|
|
61
|
+
Returns
|
|
62
|
+
-------
|
|
63
|
+
str
|
|
64
|
+
The bundle, ready to be put inside a ``<script>`` element.
|
|
65
|
+
"""
|
|
66
|
+
return _asset("viewer.js")
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def styles() -> str:
|
|
70
|
+
"""Return the page's styles, with its three font faces inlined.
|
|
71
|
+
|
|
72
|
+
Two files, in one string: what the views are drawn with, and the faces they
|
|
73
|
+
are drawn in. The faces arrive as ``data:font/woff2;base64,...`` so that a
|
|
74
|
+
page opened from a disk on a machine that has never seen iA Writer Quattro
|
|
75
|
+
S still renders in it, and asks nobody for it.
|
|
76
|
+
|
|
77
|
+
The faces are other people's work, under the SIL Open Font License, whose
|
|
78
|
+
copyright lines have to travel with them, as the bundled packages' notices
|
|
79
|
+
do. A page built from these styles must carry :func:`notices` too, as
|
|
80
|
+
every page :func:`render` writes does.
|
|
81
|
+
|
|
82
|
+
Returns
|
|
83
|
+
-------
|
|
84
|
+
str
|
|
85
|
+
The stylesheet, ready to be put inside a ``<style>`` element.
|
|
86
|
+
"""
|
|
87
|
+
return _asset("viewer.css") + "\n" + _asset("fonts.css")
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def notices() -> str:
|
|
91
|
+
"""Return the notices of everything the page carries that is not ours.
|
|
92
|
+
|
|
93
|
+
``third-party-notices.txt``, which ``viewer/build.mjs`` writes from the
|
|
94
|
+
bundle's own metafile on every build: each npm package esbuild bundled, at
|
|
95
|
+
the version bundled, with its licence file verbatim, and the three font
|
|
96
|
+
faces with their copyright lines and the SIL Open Font License. The wheel
|
|
97
|
+
lists the same file as a licence file; :func:`render` puts it at the end
|
|
98
|
+
of every page, and a page assembled from :func:`bundle` and
|
|
99
|
+
:func:`styles` some other way has to carry it as well.
|
|
100
|
+
|
|
101
|
+
Returns
|
|
102
|
+
-------
|
|
103
|
+
str
|
|
104
|
+
The notices, as the file holds them.
|
|
105
|
+
"""
|
|
106
|
+
return _asset("third-party-notices.txt")
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
# What the notices' comment says first, before a blank line and the notices.
|
|
110
|
+
# It is the escape's documentation for whoever holds only the page, so it says
|
|
111
|
+
# how to undo it in full. It holds no two hyphens together itself.
|
|
112
|
+
_NOTICES_HEAD = (
|
|
113
|
+
"Third-party notices: the software and fonts this page carries that are\n"
|
|
114
|
+
"not Opio Inc.'s work, each with its licence. This is gaspatchio-viewer's\n"
|
|
115
|
+
"third-party-notices.txt, escaped for a comment, which two hyphens\n"
|
|
116
|
+
"together could close: each backslash is written as two, and each hyphen\n"
|
|
117
|
+
"that follows a hyphen has a backslash written before it. The text starts\n"
|
|
118
|
+
"after the blank line below and ends at the line break before the comment\n"
|
|
119
|
+
"closes. To read it back, replace each backslash and the character after\n"
|
|
120
|
+
"it with that character, from left to right."
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def _for_a_comment(text: str) -> str:
|
|
125
|
+
"""Return ``text`` with no two hyphens together, by the escape the head states.
|
|
126
|
+
|
|
127
|
+
A backslash is written twice first, so that every backslash in the result
|
|
128
|
+
starts an escape; then each hyphen that follows a hyphen in ``text`` gets
|
|
129
|
+
one. Nothing else changes, so the notices read as they are.
|
|
130
|
+
"""
|
|
131
|
+
doubled = text.replace("\\", "\\\\")
|
|
132
|
+
return re.sub(r"(?<=-)-", lambda _: "\\-", doubled)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def _notices_comment() -> str:
|
|
136
|
+
"""Return the comment every page ends with: the head, then the notices."""
|
|
137
|
+
return f"<!--\n{_NOTICES_HEAD}\n\n{_for_a_comment(notices())}\n-->\n"
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def _favicon_href() -> str:
|
|
141
|
+
"""Return the soup can as a ``data:`` URI, which is the whole favicon.
|
|
142
|
+
|
|
143
|
+
Base64 rather than the percent-encoded form the same SVG could take,
|
|
144
|
+
because the SVG names the XML namespace by URL and the page states -- and a
|
|
145
|
+
test asserts -- that it carries no address of anything. Encoded, the
|
|
146
|
+
namespace is what it always was: an identifier the browser matches, never
|
|
147
|
+
an address it visits.
|
|
148
|
+
"""
|
|
149
|
+
svg = _asset("favicon.svg").strip()
|
|
150
|
+
return "data:image/svg+xml;base64," + base64.b64encode(svg.encode()).decode()
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def _escaped(text: str) -> str:
|
|
154
|
+
"""Return ``text`` with the three characters that would end an element."""
|
|
155
|
+
return text.replace("&", "&").replace("<", "<").replace(">", ">")
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
def _attribute(text: str) -> str:
|
|
159
|
+
"""Return ``text`` for a double-quoted attribute, as text and never as markup.
|
|
160
|
+
|
|
161
|
+
Each character that could end the attribute or open an element is written
|
|
162
|
+
as its entity, and a carriage return as its reference: written as itself,
|
|
163
|
+
the parser reads it, and a carriage return and line feed together, back as
|
|
164
|
+
a line feed.
|
|
165
|
+
"""
|
|
166
|
+
return (
|
|
167
|
+
text.replace("&", "&")
|
|
168
|
+
.replace('"', """)
|
|
169
|
+
.replace("<", "<")
|
|
170
|
+
.replace(">", ">")
|
|
171
|
+
.replace("\r", " ")
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def _no_nul(name: str, label: str | None) -> None:
|
|
176
|
+
"""Refuse a label holding NUL, the one character no page can carry.
|
|
177
|
+
|
|
178
|
+
Raises:
|
|
179
|
+
ValueError: If ``label`` holds U+0000, which a browser reads back as
|
|
180
|
+
U+FFFD however it is written.
|
|
181
|
+
|
|
182
|
+
"""
|
|
183
|
+
if label is not None and "\0" in label:
|
|
184
|
+
msg = (
|
|
185
|
+
f"{name} holds the character NUL (U+0000), which an HTML page "
|
|
186
|
+
"cannot carry: the page would read it back as U+FFFD, the "
|
|
187
|
+
"replacement character, and show a label other than the one "
|
|
188
|
+
"given. Pass the label without it."
|
|
189
|
+
)
|
|
190
|
+
raise ValueError(msg)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
def _block(artifact_json: str, label: str | None = None) -> str:
|
|
194
|
+
"""Return one artifact as the document carries it: one block, one escape.
|
|
195
|
+
|
|
196
|
+
A label travels on the block as its ``data-label`` attribute, written as
|
|
197
|
+
text and never as markup -- each character that could end the attribute
|
|
198
|
+
or open an element is written as its entity -- so the page reads back the
|
|
199
|
+
label it was given. With no label the block is what it always was.
|
|
200
|
+
"""
|
|
201
|
+
named = "" if label is None else f' data-label="{_attribute(label)}"'
|
|
202
|
+
return (
|
|
203
|
+
f'<script type="application/json" id="artifact"{named}>'
|
|
204
|
+
+ artifact_json.replace("<", "\\u003c")
|
|
205
|
+
+ "</script>\n"
|
|
206
|
+
)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def render(
|
|
210
|
+
artifact_json: str,
|
|
211
|
+
*,
|
|
212
|
+
second: str | None = None,
|
|
213
|
+
title: str = "gaspatchio",
|
|
214
|
+
label: str | None = None,
|
|
215
|
+
second_label: str | None = None,
|
|
216
|
+
movement: str | None = None,
|
|
217
|
+
) -> str:
|
|
218
|
+
"""Return one self-contained HTML document around one artifact, or two.
|
|
219
|
+
|
|
220
|
+
The artifact travels as text, not as a re-serialisation: whatever
|
|
221
|
+
``calc-graph`` wrote is what the page carries, byte for byte, so the seal
|
|
222
|
+
in the header is a seal over the bytes a reader can extract back out. The
|
|
223
|
+
one change made to it is the JSON escape ``\\u003c`` for ``<``, which is
|
|
224
|
+
what stops an artifact holding ``af.month < 12`` in a formula from closing
|
|
225
|
+
the element it is sitting in. JSON reads the escape back as ``<``, so the
|
|
226
|
+
document the page parses is the document the exporter wrote.
|
|
227
|
+
|
|
228
|
+
**The page ends with the third-party notices**, :func:`notices`, in a
|
|
229
|
+
comment after ``</html>``: the licences of the bundle's packages and of
|
|
230
|
+
the three font faces, which a page has to carry wherever it is sent.
|
|
231
|
+
Before the notices, the comment says what they are and how they are
|
|
232
|
+
escaped. A comment cannot safely hold two hyphens together, and a notice
|
|
233
|
+
can, so each backslash is written as two and each hyphen that follows a
|
|
234
|
+
hyphen has a backslash before it. Replacing each backslash and the
|
|
235
|
+
character after it with that character gives the file back byte for byte.
|
|
236
|
+
It costs every page about 34 KB, none of it on screen.
|
|
237
|
+
|
|
238
|
+
**A second artifact makes the page a comparison**, which is what ``gspio
|
|
239
|
+
diff --html`` writes: the first block is the *later* of the two documents
|
|
240
|
+
and the second is the earlier, and the page derives what moved between them
|
|
241
|
+
rather than being handed a verdict. Two blocks and never three -- a
|
|
242
|
+
comparison has two sides, and a page carrying a third would have no answer
|
|
243
|
+
to "compared with what".
|
|
244
|
+
|
|
245
|
+
Parameters
|
|
246
|
+
----------
|
|
247
|
+
artifact_json
|
|
248
|
+
The artifact, as ``calc-graph`` wrote it. On a comparison page this is
|
|
249
|
+
the later document, because it is the one every view is drawn from.
|
|
250
|
+
second
|
|
251
|
+
The earlier artifact, where the page is a comparison. It travels
|
|
252
|
+
exactly as the first does, under the same block and the same escape.
|
|
253
|
+
title
|
|
254
|
+
What to call the document. The command passes the model file's stem,
|
|
255
|
+
so a reader with six of these open reads six model names.
|
|
256
|
+
label
|
|
257
|
+
A short name for the artifact, in the caller's own words -- a path, or
|
|
258
|
+
a path at a revision, ``model.audit.json at v2026.Q2 (3f2a91c)``. It
|
|
259
|
+
travels on the artifact's block, and a comparison page shows it where
|
|
260
|
+
it names its two sides, beside the later document's date and seal. A
|
|
261
|
+
page carrying one document names its model and its graph rather than
|
|
262
|
+
the file it was read from, so it carries the label and does not show
|
|
263
|
+
it. Text, never markup, whatever it holds, and read back exactly as it
|
|
264
|
+
was given; a label holding NUL, which no page can carry, is refused.
|
|
265
|
+
second_label
|
|
266
|
+
The same for ``second``, which it needs: a label for an earlier
|
|
267
|
+
document the page does not carry is refused rather than dropped.
|
|
268
|
+
movement
|
|
269
|
+
On a comparison, ``gspio diff``'s ``values`` member as JSON, where the
|
|
270
|
+
command read the two runs' results files: how far each line moved over
|
|
271
|
+
the whole book. It travels in a block of its own, ``id="movement"``,
|
|
272
|
+
under the artifacts' escape. The page still derives every mark from
|
|
273
|
+
the two documents; this is shown beside them, and the page holds its
|
|
274
|
+
own reading of the policy it carries against it. Like ``second_label``
|
|
275
|
+
it needs ``second``.
|
|
276
|
+
|
|
277
|
+
Returns
|
|
278
|
+
-------
|
|
279
|
+
str
|
|
280
|
+
The whole page: title, favicon, styles, the artifacts, root, bundle,
|
|
281
|
+
and the notices after it.
|
|
282
|
+
|
|
283
|
+
Examples
|
|
284
|
+
--------
|
|
285
|
+
>>> page = render('{"schema": "gaspatchio-graph/v0-preview.2"}', title="term")
|
|
286
|
+
>>> page.startswith("<!doctype html>")
|
|
287
|
+
True
|
|
288
|
+
>>> "<title>term</title>" in page
|
|
289
|
+
True
|
|
290
|
+
>>> page.count('id="artifact"')
|
|
291
|
+
1
|
|
292
|
+
|
|
293
|
+
The notices close it, after ``</html>``:
|
|
294
|
+
|
|
295
|
+
>>> tail = page[page.index("</html>\\n") :]
|
|
296
|
+
>>> tail.startswith("</html>\\n<!--\\nThird-party notices:")
|
|
297
|
+
True
|
|
298
|
+
>>> tail.endswith("\\n-->\\n")
|
|
299
|
+
True
|
|
300
|
+
|
|
301
|
+
A comparison carries both, the later one first:
|
|
302
|
+
|
|
303
|
+
>>> both = render('{"n": "after"}', second='{"n": "before"}', title="term")
|
|
304
|
+
>>> both.count('id="artifact"')
|
|
305
|
+
2
|
|
306
|
+
>>> both.index('{"n": "after"}') < both.index('{"n": "before"}')
|
|
307
|
+
True
|
|
308
|
+
|
|
309
|
+
Each side can carry a label, which is text whatever it holds:
|
|
310
|
+
|
|
311
|
+
>>> named = render(
|
|
312
|
+
... '{"n": "after"}',
|
|
313
|
+
... second='{"n": "before"}',
|
|
314
|
+
... label="model.audit.json at v2026.Q2 (3f2a91c)",
|
|
315
|
+
... second_label='a "<label>" & </script>',
|
|
316
|
+
... )
|
|
317
|
+
>>> 'data-label="model.audit.json at v2026.Q2 (3f2a91c)"' in named
|
|
318
|
+
True
|
|
319
|
+
>>> 'data-label="a "<label>" & </script>"' in named
|
|
320
|
+
True
|
|
321
|
+
>>> '<script type="application/json" id="artifact">{"n": "before"}' in both
|
|
322
|
+
True
|
|
323
|
+
|
|
324
|
+
The book's movement travels after the two documents, in a block of its own:
|
|
325
|
+
|
|
326
|
+
>>> moved = render(
|
|
327
|
+
... '{"n": "after"}', second='{"n": "before"}', movement='{"lines": []}'
|
|
328
|
+
... )
|
|
329
|
+
>>> '<script type="application/json" id="movement">{"lines": []}</script>' in moved
|
|
330
|
+
True
|
|
331
|
+
"""
|
|
332
|
+
_no_nul("label", label)
|
|
333
|
+
_no_nul("second_label", second_label)
|
|
334
|
+
if second_label is not None and second is None:
|
|
335
|
+
msg = (
|
|
336
|
+
"second_label names the earlier document of a comparison, and this "
|
|
337
|
+
"page carries one document. Pass the earlier artifact as second= "
|
|
338
|
+
"as well, or leave second_label out."
|
|
339
|
+
)
|
|
340
|
+
raise ValueError(msg)
|
|
341
|
+
if movement is not None and second is None:
|
|
342
|
+
msg = (
|
|
343
|
+
"movement is what moved between the two documents of a comparison, "
|
|
344
|
+
"and this page carries one document. Pass the earlier artifact as "
|
|
345
|
+
"second= as well, or leave movement out."
|
|
346
|
+
)
|
|
347
|
+
raise ValueError(msg)
|
|
348
|
+
blocks = _block(artifact_json, label)
|
|
349
|
+
if second is not None:
|
|
350
|
+
blocks += _block(second, second_label)
|
|
351
|
+
if movement is not None:
|
|
352
|
+
blocks += (
|
|
353
|
+
'<script type="application/json" id="movement">'
|
|
354
|
+
+ movement.replace("<", "\\u003c")
|
|
355
|
+
+ "</script>\n"
|
|
356
|
+
)
|
|
357
|
+
return (
|
|
358
|
+
"<!doctype html>\n"
|
|
359
|
+
'<html lang="en">\n'
|
|
360
|
+
"<head>\n"
|
|
361
|
+
'<meta charset="utf-8">\n'
|
|
362
|
+
'<meta name="viewport" content="width=device-width, initial-scale=1">\n'
|
|
363
|
+
f"<title>{_escaped(title)}</title>\n"
|
|
364
|
+
f'<link rel="icon" href="{_favicon_href()}">\n'
|
|
365
|
+
f"<style>\n{styles()}\n</style>\n"
|
|
366
|
+
"</head>\n"
|
|
367
|
+
"<body>\n" + blocks + '<div id="root"></div>\n'
|
|
368
|
+
f"<script>\n{bundle()}\n</script>\n"
|
|
369
|
+
"</body>\n"
|
|
370
|
+
"</html>\n" + _notices_comment()
|
|
371
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><text y="52" font-size="56">🥫</text></svg>
|