pyformatters-json-rem 1.6.1__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.
@@ -0,0 +1,34 @@
1
+ /.idea/
2
+ /.vscode/
3
+ /dist/
4
+ dist
5
+ .git
6
+ .cache
7
+ **/.pytest_cache
8
+ models
9
+ log
10
+ **/__pycache__/
11
+ *.pyc
12
+ **/test-reports
13
+ **/.passwd-pypi
14
+ **/.env
15
+ **/results.xml
16
+
17
+ # Specific
18
+ .idea/
19
+ .groovylintrc.json
20
+ .emailNotif
21
+ uv.lock
22
+
23
+ # SBOMs
24
+ **/sbom*.json
25
+ **/trivy*.html
26
+ **/audit*.json
27
+ **/audit*.md
28
+
29
+ # Corpus de dépêches annotées : contenu AFP + sorties des LLM, non redistribuable
30
+ # (un répertoire par modèle, plus les étalons gold/ et gold-fable/)
31
+ /tests/data/*/
32
+
33
+ # Exemples des pages d aide Sherpa, enregistres par les tests
34
+ build/
@@ -0,0 +1,4 @@
1
+ [submodule "submodules/python-archetype"]
2
+ path = submodules/python-archetype
3
+ url = git@bitbucket.org:kairntech/python-archetype.git
4
+ branch = master
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,17 @@
1
+ Copyright (c) 2026 Kairntech. All rights reserved.
2
+
3
+ This software and its documentation are the proprietary and confidential
4
+ property of Kairntech. They are protected by copyright law and international
5
+ treaties.
6
+
7
+ No part of this software may be used, copied, modified, merged, published,
8
+ distributed, sublicensed or sold, in source or binary form, without the prior
9
+ written permission of Kairntech, except as expressly permitted by a separate
10
+ license agreement signed with Kairntech.
11
+
12
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
15
+ KAIRNTECH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
16
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
17
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,136 @@
1
+ Metadata-Version: 2.5
2
+ Name: pyformatters-json-rem
3
+ Version: 1.6.1
4
+ Summary: Json REM formatter for Sherpa
5
+ Project-URL: Homepage, https://kairntech.com/
6
+ Author-email: Olivier Terrier <olivier.terrier@kairntech.com>
7
+ License: Proprietary
8
+ License-File: LICENSE
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: Information Technology
12
+ Classifier: Intended Audience :: System Administrators
13
+ Classifier: License :: Other/Proprietary License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Software Development
17
+ Classifier: Topic :: Software Development :: Libraries
18
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Requires-Python: >=3.12
21
+ Requires-Dist: pymultirole-plugins<1.7.0,>=1.6.0
22
+ Provides-Extra: sbom
23
+ Requires-Dist: cyclonedx-bom; extra == 'sbom'
24
+ Requires-Dist: pip-audit; extra == 'sbom'
25
+ Provides-Extra: test
26
+ Requires-Dist: pytest; extra == 'test'
27
+ Requires-Dist: pytest-cov; extra == 'test'
28
+ Requires-Dist: ruff; extra == 'test'
29
+ Description-Content-Type: text/markdown
30
+
31
+ # pyformatters_json_rem
32
+
33
+ [![license](https://img.shields.io/badge/license-proprietary-red)](LICENSE)
34
+
35
+ ## Requirements
36
+
37
+ - Python 3.8+
38
+ - Flit to put Python packages and modules on PyPI
39
+ - Pydantic for the data parts.
40
+
41
+ ## Installation
42
+ ```
43
+ pip install flit
44
+ pip install pyconverters-plugins
45
+ ```
46
+
47
+ ## Development
48
+
49
+ The build is driven by [Task](https://taskfile.dev) and [uv](https://docs.astral.sh/uv/),
50
+ with the shared stages coming from the `python-archetype` submodule.
51
+
52
+ ### Getting started
53
+
54
+ The stages live in a Git submodule, so **clone with `--recurse-submodules`**:
55
+
56
+ ```bash
57
+ git clone --recurse-submodules git@bitbucket.org:kairntech/pyformatters_json_rem.git
58
+ cd pyformatters_json_rem
59
+ sh -c "$(curl -sSL https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
60
+ task
61
+ ```
62
+
63
+ Already cloned without it? The submodule directory is empty, and `task` fails on:
64
+
65
+ ```
66
+ task: No Taskfile found at ".../submodules/python-archetype/resources/Taskfile.yml"
67
+ ```
68
+
69
+ which means exactly that, and nothing worse:
70
+
71
+ ```bash
72
+ git submodule update --init
73
+ ```
74
+
75
+ **Task is the only manual prerequisite.** An archetype cannot bootstrap itself: uv and the
76
+ Python interpreter install themselves on demand (every task that runs uv depends on an
77
+ internal `install-python` task), but the thing that runs them does not. Make sure
78
+ `~/.local/bin` is on your `PATH` — that is where `task` and `uv` both land.
79
+
80
+ ### Running the pipeline
81
+
82
+ ```bash
83
+ task stages # print the pipeline stages, in order
84
+ task # run the pipeline up to (but excluding) py:publish
85
+ task -- --skip-tests # same, without the test stage
86
+ task up-to -- py:lint # run the pipeline up to and including one stage
87
+ task jenkins # run every stage, exactly what Jenkins runs
88
+ ```
89
+
90
+ `task` with no argument is safe by construction: it runs every stage but the last, and that
91
+ bound is computed from the `STAGES` list rather than written down. The last stage is the
92
+ only one with an effect outside your machine.
93
+
94
+ `STAGES`, declared once in `Taskfile.yml`, is the single definition of the pipeline order —
95
+ so what you run locally is what Jenkins runs.
96
+
97
+ ### Individual stages
98
+
99
+ | Task | Description |
100
+ |---------------------------------|-------------------------------------------------------|
101
+ | `task py:sync` | Install the project and its dependencies (uv sync) |
102
+ | `task py:lint` | `ruff check` and `ruff format --check` |
103
+ | `task py:format` | Reformat the code with ruff |
104
+ | `task py:test` | Run the test suite |
105
+ | `task py:test-marker -- <m>` | Run the tests carrying one pytest marker |
106
+ | `task py:sbom` | Generate a CycloneDX SBOM of the resolved environment |
107
+ | `task py:check-vulnerabilities` | Check for known CVEs |
108
+ | `task py:check-updates` | Check for dependency updates |
109
+ | `task py:build` | Build the wheel and sdist (uv build) |
110
+ | `task py:publish` | Publish the distributions (uv publish) |
111
+ | `task py:version-file` | Print the path of the file carrying `__version__` |
112
+ | `task py:set-version VERSION=x` | Write that version into it |
113
+
114
+ `uv.lock` is not versioned here, so `py:sync` always resolves from scratch (`--upgrade`):
115
+ a stale lock lying around on a machine would otherwise make you test and audit versions the
116
+ CI never sees.
117
+
118
+ ### SBOM & vulnerability check
119
+
120
+ `task py:sbom` and `task py:check-vulnerabilities` wrap the underlying tools. To run them
121
+ by hand:
122
+
123
+ ```bash
124
+ uv sync --extra test --extra sbom
125
+ uv run cyclonedx-py environment -o sbom.cdx.json --output-format json
126
+ uv run pip-audit --skip-editable --format json --output audit-report.json
127
+ ```
128
+
129
+ Ask for **all** the extras, not just `sbom`: `uv sync` synchronises rather than adds, so
130
+ whatever the requested extras do not pull in gets removed. `--extra sbom` on its own
131
+ uninstalls `ruff` and `pytest`, leaving an environment that can no longer lint or test.
132
+
133
+ `--skip-editable` skips the project itself, which no advisory database can know about. The
134
+ tasks do the same, and pip-audit still exits non-zero when it finds a real vulnerability —
135
+ which is the contract the CI relies on. Avoid `--strict`: it turns "dependency not found on
136
+ PyPI" into a fatal error, so it breaks as soon as the local version is not a published one.
@@ -0,0 +1,106 @@
1
+ # pyformatters_json_rem
2
+
3
+ [![license](https://img.shields.io/badge/license-proprietary-red)](LICENSE)
4
+
5
+ ## Requirements
6
+
7
+ - Python 3.8+
8
+ - Flit to put Python packages and modules on PyPI
9
+ - Pydantic for the data parts.
10
+
11
+ ## Installation
12
+ ```
13
+ pip install flit
14
+ pip install pyconverters-plugins
15
+ ```
16
+
17
+ ## Development
18
+
19
+ The build is driven by [Task](https://taskfile.dev) and [uv](https://docs.astral.sh/uv/),
20
+ with the shared stages coming from the `python-archetype` submodule.
21
+
22
+ ### Getting started
23
+
24
+ The stages live in a Git submodule, so **clone with `--recurse-submodules`**:
25
+
26
+ ```bash
27
+ git clone --recurse-submodules git@bitbucket.org:kairntech/pyformatters_json_rem.git
28
+ cd pyformatters_json_rem
29
+ sh -c "$(curl -sSL https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
30
+ task
31
+ ```
32
+
33
+ Already cloned without it? The submodule directory is empty, and `task` fails on:
34
+
35
+ ```
36
+ task: No Taskfile found at ".../submodules/python-archetype/resources/Taskfile.yml"
37
+ ```
38
+
39
+ which means exactly that, and nothing worse:
40
+
41
+ ```bash
42
+ git submodule update --init
43
+ ```
44
+
45
+ **Task is the only manual prerequisite.** An archetype cannot bootstrap itself: uv and the
46
+ Python interpreter install themselves on demand (every task that runs uv depends on an
47
+ internal `install-python` task), but the thing that runs them does not. Make sure
48
+ `~/.local/bin` is on your `PATH` — that is where `task` and `uv` both land.
49
+
50
+ ### Running the pipeline
51
+
52
+ ```bash
53
+ task stages # print the pipeline stages, in order
54
+ task # run the pipeline up to (but excluding) py:publish
55
+ task -- --skip-tests # same, without the test stage
56
+ task up-to -- py:lint # run the pipeline up to and including one stage
57
+ task jenkins # run every stage, exactly what Jenkins runs
58
+ ```
59
+
60
+ `task` with no argument is safe by construction: it runs every stage but the last, and that
61
+ bound is computed from the `STAGES` list rather than written down. The last stage is the
62
+ only one with an effect outside your machine.
63
+
64
+ `STAGES`, declared once in `Taskfile.yml`, is the single definition of the pipeline order —
65
+ so what you run locally is what Jenkins runs.
66
+
67
+ ### Individual stages
68
+
69
+ | Task | Description |
70
+ |---------------------------------|-------------------------------------------------------|
71
+ | `task py:sync` | Install the project and its dependencies (uv sync) |
72
+ | `task py:lint` | `ruff check` and `ruff format --check` |
73
+ | `task py:format` | Reformat the code with ruff |
74
+ | `task py:test` | Run the test suite |
75
+ | `task py:test-marker -- <m>` | Run the tests carrying one pytest marker |
76
+ | `task py:sbom` | Generate a CycloneDX SBOM of the resolved environment |
77
+ | `task py:check-vulnerabilities` | Check for known CVEs |
78
+ | `task py:check-updates` | Check for dependency updates |
79
+ | `task py:build` | Build the wheel and sdist (uv build) |
80
+ | `task py:publish` | Publish the distributions (uv publish) |
81
+ | `task py:version-file` | Print the path of the file carrying `__version__` |
82
+ | `task py:set-version VERSION=x` | Write that version into it |
83
+
84
+ `uv.lock` is not versioned here, so `py:sync` always resolves from scratch (`--upgrade`):
85
+ a stale lock lying around on a machine would otherwise make you test and audit versions the
86
+ CI never sees.
87
+
88
+ ### SBOM & vulnerability check
89
+
90
+ `task py:sbom` and `task py:check-vulnerabilities` wrap the underlying tools. To run them
91
+ by hand:
92
+
93
+ ```bash
94
+ uv sync --extra test --extra sbom
95
+ uv run cyclonedx-py environment -o sbom.cdx.json --output-format json
96
+ uv run pip-audit --skip-editable --format json --output audit-report.json
97
+ ```
98
+
99
+ Ask for **all** the extras, not just `sbom`: `uv sync` synchronises rather than adds, so
100
+ whatever the requested extras do not pull in gets removed. `--extra sbom` on its own
101
+ uninstalls `ruff` and `pytest`, leaving an environment that can no longer lint or test.
102
+
103
+ `--skip-editable` skips the project itself, which no advisory database can know about. The
104
+ tasks do the same, and pip-audit still exits non-zero when it finds a real vulnerability —
105
+ which is the contract the CI relies on. Avoid `--strict`: it turns "dependency not found on
106
+ PyPI" into a fatal error, so it breaks as soon as the local version is not a published one.
@@ -0,0 +1,33 @@
1
+ version: '3'
2
+
3
+ includes:
4
+ # Les tasks Python, sous le namespace 'py:'.
5
+ py:
6
+ taskfile: submodules/python-archetype/resources/Taskfile.yml
7
+ vars:
8
+ # Le module qui porte __version__. Déclaré ICI et non dans le Jenkinsfile, pour
9
+ # que 'task py:set-version' et 'task py:version-file' servent aussi au
10
+ # développeur : le bump de version n'était jusqu'ici reproductible que par la CI.
11
+ #
12
+ # Chemin depuis la racine, et pas nom de module : l'archétype en fait
13
+ # '{{.MODULE}}/__init__.py'. Ce dépôt a son paquet à plat, contrairement à la
14
+ # plupart des dépôts pymultirole, qui sont en layout src/.
15
+ MODULE: pyformatters_json_rem
16
+ # uv.lock n'est pas versionné ici (il est dans .gitignore) : sync doit résoudre à
17
+ # neuf, sinon un lock périmé traînant sur un poste fait tester et auditer autre
18
+ # chose que ce que produit la CI.
19
+ LOCK_VERSIONED: "false"
20
+ # Le lanceur de pipeline, à plat, pour que 'task', 'task up-to' et
21
+ # 'task jenkins' soient au premier niveau.
22
+ _:
23
+ taskfile: submodules/python-archetype/resources/Stages.yml
24
+ flatten: true
25
+ vars:
26
+ # La seule définition de l'ordre du pipeline. pythonPipeline joue ces stages, plus
27
+ # les siens qui n'ont de sens que dans Jenkins (init, version, py:publish), et son
28
+ # checkStageDrift() vérifie que cette liste en est un sous-ensemble ORDONNÉ.
29
+ STAGES: >-
30
+ py:sync py:lint py:test py:help-check
31
+ py:sbom py:check-vulnerabilities
32
+ py:build py:publish
33
+ TEST_STAGE: py:test
@@ -0,0 +1,37 @@
1
+ Objet : Banc d'essai REM — résultats et recommandation
2
+
3
+ Bonjour,
4
+
5
+ Le banc d'essai est terminé. Du 21 août au 4 septembre, huit LLM ont enrichi les mêmes
6
+ entités NER sur les 641 dépêches que vous nous avez transmises — six langues, 9 041 entités.
7
+ Le NER étant calculé une seule fois puis soumis aux huit, tout écart vient du modèle seul.
8
+
9
+ **Deux mesures, qui ne donnent pas le même ordre.** Sur la discipline — le respect des règles
10
+ du prompt, sur les 641 dépêches : gemma_4_12b 97,3 % des personnes et organisations
11
+ correctement étiquetées, ministral_3_14b 93,9 %, qwen3_next 92,2 %, gemma_4_26b 91,3 %. Sur
12
+ l'exactitude, contre un étalon annoté de 30 dépêches : gemma_4_26b 79,4 %, gemma_4_12b et
13
+ qwen3_next 70,8 %, ministral_3_14b 66,8 %.
14
+
15
+ **Deux contraintes écartent les premiers.** Aucun modèle Gemma 4 ne figure dans la table du
16
+ batch Bedrock (relevé du 4 septembre) : nos deux meilleurs sur l'exactitude sont hors jeu. Et
17
+ le risque de biais orientés dans les réponses écarte qwen3_next, ainsi que qwen3_32b et
18
+ glm_4_7_flash.
19
+
20
+ **Nous recommandons ministral_3_14b**, éligible au batch Bedrock en Irlande, Londres et Milan
21
+ sans profil américain. Deuxième sur la discipline, régulier dans les six langues, meilleur que
22
+ qwen3_next sur les prises de parole comme sur les entités étiquetées (6,1 % d'oublis contre
23
+ 7,8 %), et dense à 14 milliards de paramètres, donc peu coûteux à servir. Son défaut est
24
+ identifié : il promeut trop largement en acteur principal — 92 % de rappel pour 52 % de
25
+ précision — et c'est ce qui lui coûte l'exactitude. Derrière lui, il n'y a pas de repli
26
+ sérieux.
27
+
28
+ **Une chose de votre côté.** L'écart d'exactitude entre les modèles se joue entièrement sur la
29
+ frontière acteur principal / secondaire, et notre étalon a été annoté par des LLM, pas par un
30
+ humain : une relecture de 5 dépêches par un journaliste, sur cette seule question, la
31
+ trancherait. Confirmez-nous aussi que le batch Bedrock est une contrainte ferme — si oui, une
32
+ seconde campagne sur le catalogue batch lui-même se justifie, gpt-oss-120b et les petits
33
+ Ministral 3 y étant éligibles depuis l'Europe et non testés.
34
+
35
+ Bien cordialement,
36
+ Olivier Terrier
37
+ Kairntech
@@ -0,0 +1,3 @@
1
+ """Sherpa Json REM formatter"""
2
+
3
+ __version__ = "1.6.1"