seanchai 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.
Files changed (68) hide show
  1. seanchai-0.1.0/LICENSE +21 -0
  2. seanchai-0.1.0/PKG-INFO +128 -0
  3. seanchai-0.1.0/README.md +95 -0
  4. seanchai-0.1.0/pyproject.toml +126 -0
  5. seanchai-0.1.0/pyproject.toml.orig +115 -0
  6. seanchai-0.1.0/src/seanchai/__init__.py +41 -0
  7. seanchai-0.1.0/src/seanchai/_correction_record.py +201 -0
  8. seanchai-0.1.0/src/seanchai/_prose.py +25 -0
  9. seanchai-0.1.0/src/seanchai/_ranges.py +401 -0
  10. seanchai-0.1.0/src/seanchai/_regenerate.py +676 -0
  11. seanchai-0.1.0/src/seanchai/_versions.py +137 -0
  12. seanchai-0.1.0/src/seanchai/cli.py +1522 -0
  13. seanchai-0.1.0/src/seanchai/corpus.py +1033 -0
  14. seanchai-0.1.0/src/seanchai/dad/__init__.py +7 -0
  15. seanchai-0.1.0/src/seanchai/dad/abnf.py +163 -0
  16. seanchai-0.1.0/src/seanchai/dad/ast.py +1305 -0
  17. seanchai-0.1.0/src/seanchai/dad/corrections.py +1904 -0
  18. seanchai-0.1.0/src/seanchai/dad/formatter.py +643 -0
  19. seanchai-0.1.0/src/seanchai/dad/parser.py +1138 -0
  20. seanchai-0.1.0/src/seanchai/dad/syntax/dad.tmLanguage.json +241 -0
  21. seanchai-0.1.0/src/seanchai/dictionary.py +638 -0
  22. seanchai-0.1.0/src/seanchai/downloader/__init__.py +50 -0
  23. seanchai-0.1.0/src/seanchai/downloader/catalog.py +228 -0
  24. seanchai-0.1.0/src/seanchai/downloader/core.py +1496 -0
  25. seanchai-0.1.0/src/seanchai/downloader/specs.toml +647 -0
  26. seanchai-0.1.0/src/seanchai/errors.py +22 -0
  27. seanchai-0.1.0/src/seanchai/export.py +1216 -0
  28. seanchai-0.1.0/src/seanchai/export_schema.py +369 -0
  29. seanchai-0.1.0/src/seanchai/extractor/__init__.py +8 -0
  30. seanchai-0.1.0/src/seanchai/extractor/errors.py +31 -0
  31. seanchai-0.1.0/src/seanchai/extractor/rfc_text.py +2379 -0
  32. seanchai-0.1.0/src/seanchai/extractor/sources.py +390 -0
  33. seanchai-0.1.0/src/seanchai/extractor/tgpp_docx/__init__.py +33 -0
  34. seanchai-0.1.0/src/seanchai/extractor/tgpp_docx/_avp_tables.py +658 -0
  35. seanchai-0.1.0/src/seanchai/extractor/tgpp_docx/_base.py +202 -0
  36. seanchai-0.1.0/src/seanchai/extractor/tgpp_docx/_collect.py +551 -0
  37. seanchai-0.1.0/src/seanchai/extractor/tgpp_docx/_commands.py +611 -0
  38. seanchai-0.1.0/src/seanchai/extractor/tgpp_docx/_docx.py +573 -0
  39. seanchai-0.1.0/src/seanchai/extractor/tgpp_docx/_enums.py +372 -0
  40. seanchai-0.1.0/src/seanchai/extractor/tgpp_docx/_extract.py +272 -0
  41. seanchai-0.1.0/src/seanchai/extractor/tgpp_docx/_origins.py +309 -0
  42. seanchai-0.1.0/src/seanchai/extractor/tgpp_docx/_quirks.py +280 -0
  43. seanchai-0.1.0/src/seanchai/extractor/tgpp_docx/_registries.py +225 -0
  44. seanchai-0.1.0/src/seanchai/extractor/tgpp_docx/_rules.py +300 -0
  45. seanchai-0.1.0/src/seanchai/extractor/tgpp_docx/_tables.py +260 -0
  46. seanchai-0.1.0/src/seanchai/extractor/tgpp_docx/_values.py +378 -0
  47. seanchai-0.1.0/src/seanchai/extractor/transcription.py +86 -0
  48. seanchai-0.1.0/src/seanchai/linter/__init__.py +31 -0
  49. seanchai-0.1.0/src/seanchai/linter/_definitions.py +252 -0
  50. seanchai-0.1.0/src/seanchai/linter/_findings.py +121 -0
  51. seanchai-0.1.0/src/seanchai/linter/_index.py +130 -0
  52. seanchai-0.1.0/src/seanchai/linter/_lint.py +165 -0
  53. seanchai-0.1.0/src/seanchai/linter/_origins.py +262 -0
  54. seanchai-0.1.0/src/seanchai/linter/_referencing.py +264 -0
  55. seanchai-0.1.0/src/seanchai/linter/_registry.py +411 -0
  56. seanchai-0.1.0/src/seanchai/linter/_reused.py +559 -0
  57. seanchai-0.1.0/src/seanchai/linter/_tables.py +312 -0
  58. seanchai-0.1.0/src/seanchai/model/__init__.py +73 -0
  59. seanchai-0.1.0/src/seanchai/model/_draft.py +236 -0
  60. seanchai-0.1.0/src/seanchai/model/_errors.py +54 -0
  61. seanchai-0.1.0/src/seanchai/model/_flags.py +105 -0
  62. seanchai-0.1.0/src/seanchai/model/_model.py +744 -0
  63. seanchai-0.1.0/src/seanchai/model/_resolution.py +590 -0
  64. seanchai-0.1.0/src/seanchai/model/_supply.py +110 -0
  65. seanchai-0.1.0/src/seanchai/model/_types.py +633 -0
  66. seanchai-0.1.0/src/seanchai/model/_view.py +120 -0
  67. seanchai-0.1.0/src/seanchai/oracle.py +532 -0
  68. seanchai-0.1.0/src/seanchai/py.typed +0 -0
seanchai-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 sliva0
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,128 @@
1
+ Metadata-Version: 2.4
2
+ Name: seanchai
3
+ Version: 0.1.0
4
+ Summary: Machine-readable Diameter schemas from 3GPP documents and RFCs
5
+ Keywords: diameter,3gpp,avp,abnf,rfc6733
6
+ Author: sliva0
7
+ Author-email: sliva0 <sliva0mk@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Intended Audience :: Telecommunications Industry
13
+ Classifier: Programming Language :: Python :: 3 :: Only
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Topic :: Communications :: Telephony
18
+ Classifier: Topic :: Software Development :: Code Generators
19
+ Classifier: Topic :: System :: Networking
20
+ Classifier: Typing :: Typed
21
+ Requires-Dist: click>=8.5.1
22
+ Requires-Dist: pydantic>=2.14.3
23
+ Requires-Dist: seanchai-corpus>=2026.11.11 ; extra == 'corpus'
24
+ Requires-Dist: pypdf[crypto]>=7.0.1 ; extra == 'extract'
25
+ Requires-Dist: python-docx>=1.2.0 ; extra == 'extract'
26
+ Requires-Python: >=3.12
27
+ Project-URL: Homepage, https://github.com/sliva0/seanchai
28
+ Project-URL: Documentation, https://github.com/sliva0/seanchai/tree/main/docs
29
+ Project-URL: Issues, https://github.com/sliva0/seanchai/issues
30
+ Provides-Extra: corpus
31
+ Provides-Extra: extract
32
+ Description-Content-Type: text/markdown
33
+
34
+ # Seanchaí
35
+
36
+ Seanchaí extracts Diameter command ABNFs and AVP definitions from 3GPP
37
+ specifications, RFCs and a few other documents into one plain-text format,
38
+ `.dad`. It gives you a parser and a resolved model over the result, so
39
+ generating your stack's dictionary, or checking it against the
40
+ specifications, takes a short script.
41
+
42
+ Each `.dad` file records what its source document says, mistakes included.
43
+ The only edits are declared patches and corrections, each with its reason.
44
+ The [linter][linter] reports contradictions, and the
45
+ [Wireshark oracle][oracle] compares the corpus with Wireshark's dictionary.
46
+
47
+ ## Installing
48
+
49
+ Seanchaí needs Python 3.12 or newer.
50
+
51
+ ```sh
52
+ pip install "seanchai[corpus]" # the library and the corpus
53
+ pip install "seanchai[extract]" # also rebuild the corpus from source documents
54
+ ```
55
+
56
+ The library (`seanchai`) and the data (`seanchai-corpus`) are separate
57
+ packages with separate versions ([what the version covers][versions]).
58
+
59
+ ```python
60
+ from seanchai.model import Model
61
+
62
+ model = Model.installed()
63
+ model.resolve("TS29.229", "Public-Identity")
64
+ ```
65
+
66
+ ## Commands
67
+
68
+ Read the installed corpus, with no checkout and no downloads:
69
+
70
+ ```sh
71
+ seanchai show NAME_OR_IDENTITY [--json] # one AVP and its other readings
72
+ seanchai commands [REF | --application ID] [--json]
73
+ seanchai dictionary -o OUT.json # the corpus as JSON, to generate from
74
+ seanchai export -o DIR # the corpus as JSON for the static site
75
+ seanchai export -o DIR --include-pdfs --specifications specifications
76
+ ```
77
+
78
+ Check and rewrite `.dad` files, the corpus's or your own sidecars:
79
+
80
+ ```sh
81
+ seanchai lint [--corpus DIR | --no-corpus] [--show-accepted] [FILE.dad | DIR]...
82
+ seanchai format [--check] [FILE.dad | DIR]... # canonical form, ;; comments kept
83
+ ```
84
+
85
+ Maintain the corpus, from the root of a checkout:
86
+
87
+ ```sh
88
+ seanchai corpus download # fetch the catalog into specifications/
89
+ seanchai corpus download --no-convert # without LibreOffice; .doc unread
90
+ seanchai corpus download --only wireshark # one source, keeping the others
91
+ seanchai corpus download --only transcribed # the hand transcriptions' PDFs
92
+ seanchai corpus download --spec SPECREF --version X.Y.Z # an older version
93
+ seanchai corpus regenerate [--add SPECREF] # rebuild the corpus from the downloads
94
+ seanchai corpus regenerate --expand-ranges # also widen stale declaration ranges
95
+ seanchai corpus extract DOCX --pdf PDF --link URL [--corrections DIR] -o OUT.dad
96
+ seanchai corpus extract-rfc RFC.txt --link URL [--corrections DIR] -o OUT.dad
97
+ seanchai corpus correct RAW.dad --corrections DIR -o OUT.dad
98
+ seanchai corpus crosscheck [FILE.dad | DIR]... # against Wireshark's dictionary
99
+ ```
100
+
101
+ Commands exit 1 on an error or a finding and 2 on a usage error.
102
+ `corpus crosscheck` exits 0 on findings.
103
+
104
+ ## Documentation
105
+
106
+ - [Using the model, the CLI's JSON and the corpus][consumers]
107
+ - [The site export][website]
108
+ - [The `.dad` format][format]
109
+ - [Extraction][extractor] and [corrections][corrections]
110
+ - [Checking traffic with a Wireshark plugin][validator]
111
+ - [Development][development]
112
+
113
+ ## License
114
+
115
+ MIT, see [LICENSE][license]. The corpus contains text from 3GPP, ETSI, 3GPP2,
116
+ OMA, oneM2M and IETF documents, which stay under their publishers' terms.
117
+
118
+ [consumers]: https://github.com/sliva0/seanchai/blob/main/docs/consumers.md
119
+ [corrections]: https://github.com/sliva0/seanchai/blob/main/docs/corrections.md
120
+ [development]: https://github.com/sliva0/seanchai/blob/main/docs/development.md
121
+ [extractor]: https://github.com/sliva0/seanchai/blob/main/docs/extractor.md
122
+ [format]: https://github.com/sliva0/seanchai/blob/main/docs/dad-format.md
123
+ [license]: https://github.com/sliva0/seanchai/blob/main/LICENSE
124
+ [linter]: https://github.com/sliva0/seanchai/blob/main/docs/linter.md
125
+ [oracle]: https://github.com/sliva0/seanchai/blob/main/docs/oracle.md
126
+ [validator]: https://github.com/sliva0/seanchai/blob/main/integrations/wireshark/validator/README.md
127
+ [versions]: https://github.com/sliva0/seanchai/blob/main/docs/consumers.md#what-the-version-covers
128
+ [website]: https://github.com/sliva0/seanchai/blob/main/docs/website.md
@@ -0,0 +1,95 @@
1
+ # Seanchaí
2
+
3
+ Seanchaí extracts Diameter command ABNFs and AVP definitions from 3GPP
4
+ specifications, RFCs and a few other documents into one plain-text format,
5
+ `.dad`. It gives you a parser and a resolved model over the result, so
6
+ generating your stack's dictionary, or checking it against the
7
+ specifications, takes a short script.
8
+
9
+ Each `.dad` file records what its source document says, mistakes included.
10
+ The only edits are declared patches and corrections, each with its reason.
11
+ The [linter][linter] reports contradictions, and the
12
+ [Wireshark oracle][oracle] compares the corpus with Wireshark's dictionary.
13
+
14
+ ## Installing
15
+
16
+ Seanchaí needs Python 3.12 or newer.
17
+
18
+ ```sh
19
+ pip install "seanchai[corpus]" # the library and the corpus
20
+ pip install "seanchai[extract]" # also rebuild the corpus from source documents
21
+ ```
22
+
23
+ The library (`seanchai`) and the data (`seanchai-corpus`) are separate
24
+ packages with separate versions ([what the version covers][versions]).
25
+
26
+ ```python
27
+ from seanchai.model import Model
28
+
29
+ model = Model.installed()
30
+ model.resolve("TS29.229", "Public-Identity")
31
+ ```
32
+
33
+ ## Commands
34
+
35
+ Read the installed corpus, with no checkout and no downloads:
36
+
37
+ ```sh
38
+ seanchai show NAME_OR_IDENTITY [--json] # one AVP and its other readings
39
+ seanchai commands [REF | --application ID] [--json]
40
+ seanchai dictionary -o OUT.json # the corpus as JSON, to generate from
41
+ seanchai export -o DIR # the corpus as JSON for the static site
42
+ seanchai export -o DIR --include-pdfs --specifications specifications
43
+ ```
44
+
45
+ Check and rewrite `.dad` files, the corpus's or your own sidecars:
46
+
47
+ ```sh
48
+ seanchai lint [--corpus DIR | --no-corpus] [--show-accepted] [FILE.dad | DIR]...
49
+ seanchai format [--check] [FILE.dad | DIR]... # canonical form, ;; comments kept
50
+ ```
51
+
52
+ Maintain the corpus, from the root of a checkout:
53
+
54
+ ```sh
55
+ seanchai corpus download # fetch the catalog into specifications/
56
+ seanchai corpus download --no-convert # without LibreOffice; .doc unread
57
+ seanchai corpus download --only wireshark # one source, keeping the others
58
+ seanchai corpus download --only transcribed # the hand transcriptions' PDFs
59
+ seanchai corpus download --spec SPECREF --version X.Y.Z # an older version
60
+ seanchai corpus regenerate [--add SPECREF] # rebuild the corpus from the downloads
61
+ seanchai corpus regenerate --expand-ranges # also widen stale declaration ranges
62
+ seanchai corpus extract DOCX --pdf PDF --link URL [--corrections DIR] -o OUT.dad
63
+ seanchai corpus extract-rfc RFC.txt --link URL [--corrections DIR] -o OUT.dad
64
+ seanchai corpus correct RAW.dad --corrections DIR -o OUT.dad
65
+ seanchai corpus crosscheck [FILE.dad | DIR]... # against Wireshark's dictionary
66
+ ```
67
+
68
+ Commands exit 1 on an error or a finding and 2 on a usage error.
69
+ `corpus crosscheck` exits 0 on findings.
70
+
71
+ ## Documentation
72
+
73
+ - [Using the model, the CLI's JSON and the corpus][consumers]
74
+ - [The site export][website]
75
+ - [The `.dad` format][format]
76
+ - [Extraction][extractor] and [corrections][corrections]
77
+ - [Checking traffic with a Wireshark plugin][validator]
78
+ - [Development][development]
79
+
80
+ ## License
81
+
82
+ MIT, see [LICENSE][license]. The corpus contains text from 3GPP, ETSI, 3GPP2,
83
+ OMA, oneM2M and IETF documents, which stay under their publishers' terms.
84
+
85
+ [consumers]: https://github.com/sliva0/seanchai/blob/main/docs/consumers.md
86
+ [corrections]: https://github.com/sliva0/seanchai/blob/main/docs/corrections.md
87
+ [development]: https://github.com/sliva0/seanchai/blob/main/docs/development.md
88
+ [extractor]: https://github.com/sliva0/seanchai/blob/main/docs/extractor.md
89
+ [format]: https://github.com/sliva0/seanchai/blob/main/docs/dad-format.md
90
+ [license]: https://github.com/sliva0/seanchai/blob/main/LICENSE
91
+ [linter]: https://github.com/sliva0/seanchai/blob/main/docs/linter.md
92
+ [oracle]: https://github.com/sliva0/seanchai/blob/main/docs/oracle.md
93
+ [validator]: https://github.com/sliva0/seanchai/blob/main/integrations/wireshark/validator/README.md
94
+ [versions]: https://github.com/sliva0/seanchai/blob/main/docs/consumers.md#what-the-version-covers
95
+ [website]: https://github.com/sliva0/seanchai/blob/main/docs/website.md
@@ -0,0 +1,126 @@
1
+ [project]
2
+ name = "seanchai"
3
+ version = "0.1.0"
4
+ description = "Machine-readable Diameter schemas from 3GPP documents and RFCs"
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ license = "MIT"
8
+ license-files = ["LICENSE"]
9
+ keywords = [
10
+ "diameter",
11
+ "3gpp",
12
+ "avp",
13
+ "abnf",
14
+ "rfc6733",
15
+ ]
16
+ classifiers = [
17
+ "Environment :: Console",
18
+ "Intended Audience :: Developers",
19
+ "Intended Audience :: Telecommunications Industry",
20
+ "Programming Language :: Python :: 3 :: Only",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Programming Language :: Python :: 3.14",
24
+ "Topic :: Communications :: Telephony",
25
+ "Topic :: Software Development :: Code Generators",
26
+ "Topic :: System :: Networking",
27
+ "Typing :: Typed",
28
+ ]
29
+ dependencies = [
30
+ "click>=8.5.1",
31
+ "pydantic>=2.14.3",
32
+ ]
33
+
34
+ [[project.authors]]
35
+ name = "sliva0"
36
+ email = "sliva0mk@gmail.com"
37
+
38
+ [project.optional-dependencies]
39
+ corpus = ["seanchai-corpus>=2026.11.11"]
40
+ extract = [
41
+ "pypdf[crypto]>=7.0.1",
42
+ "python-docx>=1.2.0",
43
+ ]
44
+
45
+ [project.scripts]
46
+ seanchai = "seanchai.cli:main"
47
+
48
+ [project.urls]
49
+ Homepage = "https://github.com/sliva0/seanchai"
50
+ Documentation = "https://github.com/sliva0/seanchai/tree/main/docs"
51
+ Issues = "https://github.com/sliva0/seanchai/issues"
52
+
53
+ [build-system]
54
+ requires = ["uv_build>=0.10.2,<0.14.0"]
55
+ build-backend = "uv_build"
56
+
57
+ [dependency-groups]
58
+ dev = [
59
+ "basedpyright>=1.40.2",
60
+ "pytest>=9.2.0",
61
+ "python-diameter>=0.9.0",
62
+ "ruff>=0.17.4",
63
+ "rumdl>=0.3.2",
64
+ "seanchai-corpus",
65
+ "seanchai[extract]",
66
+ "ty>=0.0.100",
67
+ ]
68
+
69
+ [tool.uv.workspace]
70
+ members = ["packages/seanchai-corpus"]
71
+
72
+ [tool.uv.sources.seanchai-corpus]
73
+ workspace = true
74
+
75
+ [tool.pytest.ini_options]
76
+ testpaths = ["tests"]
77
+ addopts = "-q"
78
+ markers = ["sources: needs the downloaded source documents under specifications/"]
79
+
80
+ [tool.ruff]
81
+ target-version = "py312"
82
+
83
+ [tool.ruff.lint]
84
+ select = [
85
+ "E",
86
+ "F",
87
+ "I",
88
+ "UP",
89
+ "B",
90
+ "SIM",
91
+ "RUF",
92
+ ]
93
+
94
+ [tool.rumdl]
95
+ enable = ["MD013"]
96
+ cache = false
97
+
98
+ [tool.rumdl.MD013]
99
+ line-length = 80
100
+ code-blocks = false
101
+ tables = false
102
+ stern = true
103
+ ignore-link-urls = false
104
+ length-mode = "chars"
105
+
106
+ [tool.ty.environment]
107
+ python = ".venv"
108
+ python-version = "3.12"
109
+
110
+ [tool.ty.src]
111
+ include = [
112
+ "src",
113
+ "packages/seanchai-corpus/src",
114
+ "tests",
115
+ ]
116
+
117
+ [tool.basedpyright]
118
+ typeCheckingMode = "standard"
119
+ pythonVersion = "3.12"
120
+ include = [
121
+ "src",
122
+ "packages/seanchai-corpus/src",
123
+ "tests",
124
+ ]
125
+ venvPath = "."
126
+ venv = ".venv"
@@ -0,0 +1,115 @@
1
+ [project]
2
+ name = "seanchai"
3
+ version = "0.1.0"
4
+ description = "Machine-readable Diameter schemas from 3GPP documents and RFCs"
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "sliva0", email = "sliva0mk@gmail.com" }
8
+ ]
9
+ requires-python = ">=3.12"
10
+ license = "MIT"
11
+ license-files = ["LICENSE"]
12
+ keywords = ["diameter", "3gpp", "avp", "abnf", "rfc6733"]
13
+ classifiers = [
14
+ "Environment :: Console",
15
+ "Intended Audience :: Developers",
16
+ "Intended Audience :: Telecommunications Industry",
17
+ "Programming Language :: Python :: 3 :: Only",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
20
+ "Programming Language :: Python :: 3.14",
21
+ "Topic :: Communications :: Telephony",
22
+ "Topic :: Software Development :: Code Generators",
23
+ "Topic :: System :: Networking",
24
+ "Typing :: Typed",
25
+ ]
26
+ dependencies = [
27
+ "click>=8.5.1",
28
+ "pydantic>=2.14.3",
29
+ ]
30
+
31
+ [project.optional-dependencies]
32
+ corpus = ["seanchai-corpus>=2026.11.11"]
33
+ # What reading and validating source documents takes (and lxml, through
34
+ # python-docx). The model, the export and the lookup commands import neither.
35
+ extract = [
36
+ "pypdf[crypto]>=7.0.1",
37
+ "python-docx>=1.2.0",
38
+ ]
39
+
40
+ [project.scripts]
41
+ seanchai = "seanchai.cli:main"
42
+
43
+ [project.urls]
44
+ Homepage = "https://github.com/sliva0/seanchai"
45
+ Documentation = "https://github.com/sliva0/seanchai/tree/main/docs"
46
+ Issues = "https://github.com/sliva0/seanchai/issues"
47
+
48
+ [build-system]
49
+ requires = ["uv_build>=0.10.2,<0.14.0"]
50
+ build-backend = "uv_build"
51
+
52
+ [dependency-groups]
53
+ dev = [
54
+ "basedpyright>=1.40.2",
55
+ "pytest>=9.2.0",
56
+ "python-diameter>=0.9.0",
57
+ "ruff>=0.17.4",
58
+ "rumdl>=0.3.2",
59
+ "seanchai-corpus",
60
+ "seanchai[extract]",
61
+ "ty>=0.0.100",
62
+ ]
63
+
64
+ [tool.uv.workspace]
65
+ members = ["packages/seanchai-corpus"]
66
+
67
+ [tool.uv.sources]
68
+ seanchai-corpus = { workspace = true }
69
+
70
+ [tool.pytest.ini_options]
71
+ testpaths = ["tests"]
72
+ addopts = "-q"
73
+ markers = [
74
+ "sources: needs the downloaded source documents under specifications/",
75
+ ]
76
+
77
+ # The floor requires-python names, not the 3.14 the venv runs, so that ruff
78
+ # and both type checkers flag syntax and standard-library calls newer than it.
79
+ [tool.ruff]
80
+ target-version = "py312"
81
+
82
+ [tool.ruff.lint]
83
+ select = ["E", "F", "I", "UP", "B", "SIM", "RUF"]
84
+
85
+ [tool.rumdl]
86
+ # Line length only: the check is about formatting, not Markdown style.
87
+ enable = ["MD013"]
88
+ cache = false
89
+
90
+ # Tables and fenced code may run long, and so may a line that is one unbroken
91
+ # token or one whole link, even a link whose label could wrap. That is `stern`:
92
+ # rumdl's default also passes a line whose last word merely crosses the limit,
93
+ # and `strict` flags tables and code as well. Link targets count and columns are
94
+ # plain characters, so 80 means what `len` says.
95
+ [tool.rumdl.MD013]
96
+ line-length = 80
97
+ code-blocks = false
98
+ tables = false
99
+ stern = true
100
+ ignore-link-urls = false
101
+ length-mode = "chars"
102
+
103
+ [tool.ty.environment]
104
+ python = ".venv"
105
+ python-version = "3.12"
106
+
107
+ [tool.ty.src]
108
+ include = ["src", "packages/seanchai-corpus/src", "tests"]
109
+
110
+ [tool.basedpyright]
111
+ typeCheckingMode = "standard"
112
+ pythonVersion = "3.12"
113
+ include = ["src", "packages/seanchai-corpus/src", "tests"]
114
+ venvPath = "."
115
+ venv = ".venv"
@@ -0,0 +1,41 @@
1
+ """Seanchaí: Diameter specifications as reviewable `.dad` files.
2
+
3
+ This package holds only the shared error base and the version, so importing
4
+ `seanchai` pulls in no docx, PDF or HTTP code. The command line lives in `cli`.
5
+
6
+ - `seanchai.model`: the corpus resolved into objects a consumer uses, the place
7
+ to start (docs/consumers.md);
8
+ - `seanchai.corpus`: a set of parsed `.dad` files, and the rules for resolving
9
+ between them;
10
+ - `seanchai.dictionary`: the JSON `seanchai dictionary` writes, as pydantic
11
+ models, and its builder;
12
+ - `seanchai.export` and `seanchai.export_schema`: the JSON `seanchai export`
13
+ writes for the static site, and its shape;
14
+ - `seanchai.dad`: the `.dad` AST, parser, canonical formatter, corrections and
15
+ the ABNF syntax they share;
16
+ - `seanchai.linter`: the rules reporting what a file or the corpus contradicts;
17
+ - `seanchai.oracle`: the cross-check against Wireshark's Diameter dictionary;
18
+ - `seanchai.errors`: the error base, and the error naming a missing extra;
19
+ - `seanchai.extractor`: 3GPP docx/PDF and RFC text to AST, the former with the
20
+ `seanchai[extract]` extra;
21
+ - `seanchai.downloader`: fetches the source documents the corpus is built from,
22
+ with that extra for whatever it has to open as docx or PDF.
23
+
24
+ Semantic versioning covers the names in the `__all__` of this package and of
25
+ each module listed above (for `seanchai.downloader`, the package's own; for
26
+ `seanchai.extractor`, its modules'), the command line's commands, options and
27
+ exit statuses, the format versions of the two JSON outputs
28
+ (`dictionary.FORMAT_VERSION`, `export_schema.SCHEMA_VERSION`) and the corpus
29
+ formats the library reads (`corpus.FORMATS`). Modules whose names start with an
30
+ underscore, names outside an `__all__`, and the Python of `seanchai.cli` may
31
+ change in any release.
32
+ """
33
+
34
+ from importlib.metadata import version
35
+
36
+ from .errors import SeanchaiError
37
+
38
+ __all__ = ["SeanchaiError", "__version__"]
39
+
40
+ # Kept once, in this package's pyproject.
41
+ __version__ = version("seanchai")