sslabdata 3.0.0__tar.gz → 4.0.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 (39) hide show
  1. {sslabdata-3.0.0/sslabdata.egg-info → sslabdata-4.0.0}/PKG-INFO +77 -7
  2. {sslabdata-3.0.0 → sslabdata-4.0.0}/README.md +76 -6
  3. {sslabdata-3.0.0 → sslabdata-4.0.0}/SPEC.md +97 -34
  4. {sslabdata-3.0.0 → sslabdata-4.0.0}/pyproject.toml +8 -5
  5. sslabdata-4.0.0/schema/input/v1/collaborators.schema.json +24 -0
  6. sslabdata-4.0.0/schema/input/v1/lab.schema.json +71 -0
  7. sslabdata-4.0.0/schema/input/v1/people.schema.json +47 -0
  8. sslabdata-4.0.0/schema/input/v1/projects.schema.json +34 -0
  9. sslabdata-4.0.0/schema/v6/output.schema.json +481 -0
  10. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata/__init__.py +3 -2
  11. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata/assembler.py +3 -1
  12. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata/cli.py +139 -2
  13. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata/config.py +12 -0
  14. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata/diagnostics.py +8 -0
  15. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata/models.py +18 -2
  16. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata/parsers/bibtex.py +269 -33
  17. sslabdata-4.0.0/sslabdata/templates/init/bib/publications.bib +14 -0
  18. sslabdata-4.0.0/sslabdata/templates/init/collaborators.yaml +8 -0
  19. sslabdata-4.0.0/sslabdata/templates/init/lab.yaml +28 -0
  20. sslabdata-4.0.0/sslabdata/templates/init/people.yaml +13 -0
  21. sslabdata-4.0.0/sslabdata/templates/init/projects.yaml +10 -0
  22. {sslabdata-3.0.0 → sslabdata-4.0.0/sslabdata.egg-info}/PKG-INFO +77 -7
  23. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata.egg-info/SOURCES.txt +11 -1
  24. {sslabdata-3.0.0 → sslabdata-4.0.0}/LICENSE +0 -0
  25. {sslabdata-3.0.0 → sslabdata-4.0.0}/MANIFEST.in +0 -0
  26. {sslabdata-3.0.0 → sslabdata-4.0.0}/schema/__init__.py +0 -0
  27. {sslabdata-3.0.0 → sslabdata-4.0.0}/schema/v3/output.schema.json +0 -0
  28. {sslabdata-3.0.0 → sslabdata-4.0.0}/schema/v4/output.schema.json +0 -0
  29. {sslabdata-3.0.0 → sslabdata-4.0.0}/schema/v5/output.schema.json +0 -0
  30. {sslabdata-3.0.0 → sslabdata-4.0.0}/setup.cfg +0 -0
  31. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata/exporters.py +0 -0
  32. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata/loaders.py +0 -0
  33. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata/parsers/__init__.py +0 -0
  34. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata/parsers/latex.py +0 -0
  35. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata/resolver.py +0 -0
  36. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata.egg-info/dependency_links.txt +0 -0
  37. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata.egg-info/entry_points.txt +0 -0
  38. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata.egg-info/requires.txt +0 -0
  39. {sslabdata-3.0.0 → sslabdata-4.0.0}/sslabdata.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sslabdata
3
- Version: 3.0.0
3
+ Version: 4.0.0
4
4
  Summary: Renderer-agnostic academic lab data assembler: BibTeX + YAML → structured data
5
5
  Author: Siddhartha Srinivasa
6
6
  License-Expression: MIT
@@ -37,6 +37,11 @@ Dynamic: license-file
37
37
 
38
38
  # sslabdata
39
39
 
40
+ [![PyPI](https://img.shields.io/pypi/v/sslabdata.svg)](https://pypi.org/project/sslabdata/)
41
+ [![Python](https://img.shields.io/pypi/pyversions/sslabdata.svg)](https://pypi.org/project/sslabdata/)
42
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/siddhss5/sslabdata/blob/main/LICENSE)
43
+ [![Tests](https://github.com/siddhss5/sslabdata/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/siddhss5/sslabdata/actions/workflows/test.yml)
44
+
40
45
  sslabdata compiles BibTeX and a little YAML into one schema-specified document —
41
46
  works, people, projects and the links between them — that any website, CV or
42
47
  script can read.
@@ -56,10 +61,11 @@ sslabdata --config lab.yaml --output lab.yml
56
61
  order the lists are in, which fields are derived, when the version changes.
57
62
  - [`CHANGELOG.md`](https://github.com/siddhss5/sslabdata/blob/main/CHANGELOG.md) — what changed at each release, and what it
58
63
  replaced.
59
- - [`schema/v5/output.schema.json`](https://github.com/siddhss5/sslabdata/blob/main/schema/v5/output.schema.json) — the
64
+ - [`schema/v6/output.schema.json`](https://github.com/siddhss5/sslabdata/blob/main/schema/v6/output.schema.json) — the
60
65
  document's JSON Schema. Published versions are immutable and live at their
61
- own paths; [`schema/v3/`](https://github.com/siddhss5/sslabdata/blob/main/schema/v3/output.schema.json) and
62
- [`schema/v4/`](https://github.com/siddhss5/sslabdata/blob/main/schema/v4/output.schema.json) are still there.
66
+ own paths; [`schema/v3/`](https://github.com/siddhss5/sslabdata/blob/main/schema/v3/output.schema.json),
67
+ [`schema/v4/`](https://github.com/siddhss5/sslabdata/blob/main/schema/v4/output.schema.json) and
68
+ [`schema/v5/`](https://github.com/siddhss5/sslabdata/blob/main/schema/v5/output.schema.json) are still there.
63
69
  - [`tests/COVERAGE.md`](https://github.com/siddhss5/sslabdata/blob/main/tests/COVERAGE.md) — every input case sslabdata
64
70
  supports, and every case it does not, with the fixture and test for each.
65
71
 
@@ -91,6 +97,21 @@ pytest
91
97
 
92
98
  The `test` extra installs `pytest` and `jsonschema`, which the tests need.
93
99
 
100
+ ## Start a new lab
101
+
102
+ ```bash
103
+ sslabdata init mylab
104
+ cd mylab && sslabdata --config lab.yaml --validate --strict
105
+ ```
106
+
107
+ `init` writes `lab.yaml`, `bib/publications.bib`, `people.yaml`,
108
+ `projects.yaml` and `collaborators.yaml` into `mylab/` (the current directory
109
+ if you name none), each with one fictional record and a comment on each
110
+ field. Replace them with your own. It never overwrites a file that is already
111
+ there and names each one it refuses; `--force` overwrites those files and
112
+ nothing else. The paths in `lab.yaml` are relative to the directory you run
113
+ sslabdata from, so run it from `mylab/`.
114
+
94
115
  ## Write `lab.yaml`
95
116
 
96
117
  ```yaml
@@ -107,7 +128,7 @@ bib_files:
107
128
  - name: "conference.bib"
108
129
  category: "Conference Papers"
109
130
 
110
- pdf_base_url: "https://mylab.example.org/pdfs"
131
+ pdf_base_url: "https://mylab.example.org/pdfs" # optional; leave out to guess no PDF links
111
132
  people_file: "data/people.yaml" # optional
112
133
  projects_file: "data/projects.yaml" # optional
113
134
  collaborators_file: "data/collaborators.yaml" # optional
@@ -167,6 +188,7 @@ nothing else:
167
188
  | `doi`, `isbn`, `issn`, `eprint` + `archivePrefix` (or `eprinttype`) | `identifiers`, an open map from scheme to a list of identifiers, plus the links built from them. An `eprint`'s scheme is the repository `archivePrefix` or `eprinttype` named, lower-cased, so that field needs no property of its own — and an `eprint` in a repository other than arXiv gets no arXiv link |
168
189
  | `abstract` | `abstract` |
169
190
  | `note` | `note` |
191
+ | `award` | `awards`, a list of `{name, year}` (see below). `note` is never read for awards |
170
192
  | `url` | A link of kind `video` when its host is YouTube or Vimeo (or a subdomain of either), otherwise of kind `url` |
171
193
  | `video` | A link of kind `video`, whatever its host, so `url` can hold the work's website |
172
194
  | `pdf` | The work's one link of kind `pdf`. An entry without it gets `pdf_base_url` plus its citation key, when `pdf_base_url` is set |
@@ -177,6 +199,26 @@ The entry is also re-serialized into a `bibtex` field, so fields sslabdata does
177
199
  not interpret are still carried. It is a re-serialization, not a copy
178
200
  ([`SPEC.md` §5](https://github.com/siddhss5/sslabdata/blob/main/SPEC.md#5-input-versus-derived)).
179
201
 
202
+ ### Awards
203
+
204
+ A paper's awards go in its `award` field. Several are separated by `and`, as
205
+ the names in `author` are, and braces keep an `and` inside one name. An award
206
+ may start with the year it was given, as `YYYY:` and a space, when that is not
207
+ the paper's year:
208
+
209
+ ```bibtex
210
+ award = {2026: Test of Time Award and {Best Systems and Software Paper Award}}
211
+ ```
212
+
213
+ Each award becomes `{name, year}` in the work's `awards`, in the order
214
+ written, with its name converted from LaTeX as `title` is. An award without a
215
+ year takes the work's `year`, or `null` when the work has none. `awards` is
216
+ `[]` for a work with no `award` field. An empty award, or a prefix that looks
217
+ like a year and is not four digits, a colon and a space, is reported
218
+ (`BIB-AWARD-EMPTY`, `BIB-AWARD-YEAR-MALFORMED`); a malformed prefix stays in
219
+ the name. Awards a person holds, such as fellowships, are not part of the
220
+ document.
221
+
180
222
  ### The `project` tag
181
223
 
182
224
  sslabdata adds one custom BibTeX field, `project`, to link a paper to a research
@@ -190,6 +232,7 @@ project:
190
232
  year = {2024},
191
233
  eprint = {2406.99812},
192
234
  archivePrefix = {arXiv},
235
+ award = {Best Paper Award},
193
236
  project = {homebot}
194
237
  }
195
238
  ```
@@ -260,6 +303,30 @@ reported under `RESOLVE-COLLABORATOR-ALIAS-IS-MEMBER` and left to the member.
260
303
  person's `photo`, and is `null` when absent. It is carried as plain text:
261
304
  deciding which URLs are safe to render is the renderer's job.
262
305
 
306
+ ### Checking inputs in an editor
307
+
308
+ Each input file has a JSON Schema in
309
+ [`schema/input/v1/`](https://github.com/siddhss5/sslabdata/tree/main/schema/input/v1):
310
+ `lab.schema.json`, `people.schema.json`, `projects.schema.json` and
311
+ `collaborators.schema.json`. The wheel installs them under
312
+ `sslabdata/schema/input/v1/`. An editor can use them to check and complete
313
+ the files as you write; `--validate` stays the check, and also reports what
314
+ a schema cannot see, such as a repeated id or a missing file. With the YAML
315
+ language server (the VS Code YAML extension, among others), name the schema
316
+ in a comment at the top of the file:
317
+
318
+ ```yaml
319
+ # yaml-language-server: $schema=https://raw.githubusercontent.com/siddhss5/sslabdata/input-schema-v1/schema/input/v1/people.schema.json
320
+ - id: "aadams"
321
+ name: "Alice Adams"
322
+ role: "professor"
323
+ ```
324
+
325
+ The URL is the schema's `$id`, served from the `input-schema-v1` tag, which is
326
+ never moved ([`SPEC.md` §6](https://github.com/siddhss5/sslabdata/blob/main/SPEC.md#6-version-policy)).
327
+ Use `lab.schema.json`, `projects.schema.json` or `collaborators.schema.json`
328
+ in the same way for the other files.
329
+
263
330
  ## How author matching works
264
331
 
265
332
  sslabdata matches the structured parts of each BibTeX author name (given, von,
@@ -310,7 +377,7 @@ pip install jsonschema
310
377
  python -c "
311
378
  import json, yaml, jsonschema
312
379
  from importlib.resources import files
313
- schema = json.loads(files('sslabdata.schema').joinpath('v5/output.schema.json').read_text())
380
+ schema = json.loads(files('sslabdata.schema').joinpath('v6/output.schema.json').read_text())
314
381
  jsonschema.Draft202012Validator(schema).validate(yaml.safe_load(open('lab.yml')))
315
382
  print('valid')
316
383
  "
@@ -381,7 +448,10 @@ Trusted Publishing; no token is stored anywhere. The version is written in
381
448
  2. **Release.** Set both versions to `3.0.0`, date the CHANGELOG heading,
382
449
  merge, and push the tag `v3.0.0`. The PyPI job waits in the `release`
383
450
  environment for a reviewer's approval, then publishes the files the run
384
- checked and creates the GitHub Release with them.
451
+ checked and creates the GitHub Release with them. A release that ships a
452
+ new schema version also pushes that version's tag, `schema-vN` or
453
+ `input-schema-vN`, at the same commit, since the schema's `$id` points
454
+ there.
385
455
  3. **Approve** from the Actions page, or from the command line:
386
456
 
387
457
  ```bash
@@ -1,5 +1,10 @@
1
1
  # sslabdata
2
2
 
3
+ [![PyPI](https://img.shields.io/pypi/v/sslabdata.svg)](https://pypi.org/project/sslabdata/)
4
+ [![Python](https://img.shields.io/pypi/pyversions/sslabdata.svg)](https://pypi.org/project/sslabdata/)
5
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/siddhss5/sslabdata/blob/main/LICENSE)
6
+ [![Tests](https://github.com/siddhss5/sslabdata/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/siddhss5/sslabdata/actions/workflows/test.yml)
7
+
3
8
  sslabdata compiles BibTeX and a little YAML into one schema-specified document —
4
9
  works, people, projects and the links between them — that any website, CV or
5
10
  script can read.
@@ -19,10 +24,11 @@ sslabdata --config lab.yaml --output lab.yml
19
24
  order the lists are in, which fields are derived, when the version changes.
20
25
  - [`CHANGELOG.md`](https://github.com/siddhss5/sslabdata/blob/main/CHANGELOG.md) — what changed at each release, and what it
21
26
  replaced.
22
- - [`schema/v5/output.schema.json`](https://github.com/siddhss5/sslabdata/blob/main/schema/v5/output.schema.json) — the
27
+ - [`schema/v6/output.schema.json`](https://github.com/siddhss5/sslabdata/blob/main/schema/v6/output.schema.json) — the
23
28
  document's JSON Schema. Published versions are immutable and live at their
24
- own paths; [`schema/v3/`](https://github.com/siddhss5/sslabdata/blob/main/schema/v3/output.schema.json) and
25
- [`schema/v4/`](https://github.com/siddhss5/sslabdata/blob/main/schema/v4/output.schema.json) are still there.
29
+ own paths; [`schema/v3/`](https://github.com/siddhss5/sslabdata/blob/main/schema/v3/output.schema.json),
30
+ [`schema/v4/`](https://github.com/siddhss5/sslabdata/blob/main/schema/v4/output.schema.json) and
31
+ [`schema/v5/`](https://github.com/siddhss5/sslabdata/blob/main/schema/v5/output.schema.json) are still there.
26
32
  - [`tests/COVERAGE.md`](https://github.com/siddhss5/sslabdata/blob/main/tests/COVERAGE.md) — every input case sslabdata
27
33
  supports, and every case it does not, with the fixture and test for each.
28
34
 
@@ -54,6 +60,21 @@ pytest
54
60
 
55
61
  The `test` extra installs `pytest` and `jsonschema`, which the tests need.
56
62
 
63
+ ## Start a new lab
64
+
65
+ ```bash
66
+ sslabdata init mylab
67
+ cd mylab && sslabdata --config lab.yaml --validate --strict
68
+ ```
69
+
70
+ `init` writes `lab.yaml`, `bib/publications.bib`, `people.yaml`,
71
+ `projects.yaml` and `collaborators.yaml` into `mylab/` (the current directory
72
+ if you name none), each with one fictional record and a comment on each
73
+ field. Replace them with your own. It never overwrites a file that is already
74
+ there and names each one it refuses; `--force` overwrites those files and
75
+ nothing else. The paths in `lab.yaml` are relative to the directory you run
76
+ sslabdata from, so run it from `mylab/`.
77
+
57
78
  ## Write `lab.yaml`
58
79
 
59
80
  ```yaml
@@ -70,7 +91,7 @@ bib_files:
70
91
  - name: "conference.bib"
71
92
  category: "Conference Papers"
72
93
 
73
- pdf_base_url: "https://mylab.example.org/pdfs"
94
+ pdf_base_url: "https://mylab.example.org/pdfs" # optional; leave out to guess no PDF links
74
95
  people_file: "data/people.yaml" # optional
75
96
  projects_file: "data/projects.yaml" # optional
76
97
  collaborators_file: "data/collaborators.yaml" # optional
@@ -130,6 +151,7 @@ nothing else:
130
151
  | `doi`, `isbn`, `issn`, `eprint` + `archivePrefix` (or `eprinttype`) | `identifiers`, an open map from scheme to a list of identifiers, plus the links built from them. An `eprint`'s scheme is the repository `archivePrefix` or `eprinttype` named, lower-cased, so that field needs no property of its own — and an `eprint` in a repository other than arXiv gets no arXiv link |
131
152
  | `abstract` | `abstract` |
132
153
  | `note` | `note` |
154
+ | `award` | `awards`, a list of `{name, year}` (see below). `note` is never read for awards |
133
155
  | `url` | A link of kind `video` when its host is YouTube or Vimeo (or a subdomain of either), otherwise of kind `url` |
134
156
  | `video` | A link of kind `video`, whatever its host, so `url` can hold the work's website |
135
157
  | `pdf` | The work's one link of kind `pdf`. An entry without it gets `pdf_base_url` plus its citation key, when `pdf_base_url` is set |
@@ -140,6 +162,26 @@ The entry is also re-serialized into a `bibtex` field, so fields sslabdata does
140
162
  not interpret are still carried. It is a re-serialization, not a copy
141
163
  ([`SPEC.md` §5](https://github.com/siddhss5/sslabdata/blob/main/SPEC.md#5-input-versus-derived)).
142
164
 
165
+ ### Awards
166
+
167
+ A paper's awards go in its `award` field. Several are separated by `and`, as
168
+ the names in `author` are, and braces keep an `and` inside one name. An award
169
+ may start with the year it was given, as `YYYY:` and a space, when that is not
170
+ the paper's year:
171
+
172
+ ```bibtex
173
+ award = {2026: Test of Time Award and {Best Systems and Software Paper Award}}
174
+ ```
175
+
176
+ Each award becomes `{name, year}` in the work's `awards`, in the order
177
+ written, with its name converted from LaTeX as `title` is. An award without a
178
+ year takes the work's `year`, or `null` when the work has none. `awards` is
179
+ `[]` for a work with no `award` field. An empty award, or a prefix that looks
180
+ like a year and is not four digits, a colon and a space, is reported
181
+ (`BIB-AWARD-EMPTY`, `BIB-AWARD-YEAR-MALFORMED`); a malformed prefix stays in
182
+ the name. Awards a person holds, such as fellowships, are not part of the
183
+ document.
184
+
143
185
  ### The `project` tag
144
186
 
145
187
  sslabdata adds one custom BibTeX field, `project`, to link a paper to a research
@@ -153,6 +195,7 @@ project:
153
195
  year = {2024},
154
196
  eprint = {2406.99812},
155
197
  archivePrefix = {arXiv},
198
+ award = {Best Paper Award},
156
199
  project = {homebot}
157
200
  }
158
201
  ```
@@ -223,6 +266,30 @@ reported under `RESOLVE-COLLABORATOR-ALIAS-IS-MEMBER` and left to the member.
223
266
  person's `photo`, and is `null` when absent. It is carried as plain text:
224
267
  deciding which URLs are safe to render is the renderer's job.
225
268
 
269
+ ### Checking inputs in an editor
270
+
271
+ Each input file has a JSON Schema in
272
+ [`schema/input/v1/`](https://github.com/siddhss5/sslabdata/tree/main/schema/input/v1):
273
+ `lab.schema.json`, `people.schema.json`, `projects.schema.json` and
274
+ `collaborators.schema.json`. The wheel installs them under
275
+ `sslabdata/schema/input/v1/`. An editor can use them to check and complete
276
+ the files as you write; `--validate` stays the check, and also reports what
277
+ a schema cannot see, such as a repeated id or a missing file. With the YAML
278
+ language server (the VS Code YAML extension, among others), name the schema
279
+ in a comment at the top of the file:
280
+
281
+ ```yaml
282
+ # yaml-language-server: $schema=https://raw.githubusercontent.com/siddhss5/sslabdata/input-schema-v1/schema/input/v1/people.schema.json
283
+ - id: "aadams"
284
+ name: "Alice Adams"
285
+ role: "professor"
286
+ ```
287
+
288
+ The URL is the schema's `$id`, served from the `input-schema-v1` tag, which is
289
+ never moved ([`SPEC.md` §6](https://github.com/siddhss5/sslabdata/blob/main/SPEC.md#6-version-policy)).
290
+ Use `lab.schema.json`, `projects.schema.json` or `collaborators.schema.json`
291
+ in the same way for the other files.
292
+
226
293
  ## How author matching works
227
294
 
228
295
  sslabdata matches the structured parts of each BibTeX author name (given, von,
@@ -273,7 +340,7 @@ pip install jsonschema
273
340
  python -c "
274
341
  import json, yaml, jsonschema
275
342
  from importlib.resources import files
276
- schema = json.loads(files('sslabdata.schema').joinpath('v5/output.schema.json').read_text())
343
+ schema = json.loads(files('sslabdata.schema').joinpath('v6/output.schema.json').read_text())
277
344
  jsonschema.Draft202012Validator(schema).validate(yaml.safe_load(open('lab.yml')))
278
345
  print('valid')
279
346
  "
@@ -344,7 +411,10 @@ Trusted Publishing; no token is stored anywhere. The version is written in
344
411
  2. **Release.** Set both versions to `3.0.0`, date the CHANGELOG heading,
345
412
  merge, and push the tag `v3.0.0`. The PyPI job waits in the `release`
346
413
  environment for a reviewer's approval, then publishes the files the run
347
- checked and creates the GitHub Release with them.
414
+ checked and creates the GitHub Release with them. A release that ships a
415
+ new schema version also pushes that version's tag, `schema-vN` or
416
+ `input-schema-vN`, at the same commit, since the schema's `$id` points
417
+ there.
348
418
  3. **Approve** from the Actions page, or from the command line:
349
419
 
350
420
  ```bash