Skip to content

json output format and json edit tab - #77

Merged
linuxrider merged 5 commits into
echemdb:mainfrom
linuxrider:json
Jul 12, 2026
Merged

linuxrider merged 5 commits into
echemdb:mainfrom
linuxrider:json

Conversation

@linuxrider

Copy link
Copy Markdown
Contributor

Add support for json output and json edit tab.

linuxrider and others added 2 commits July 11, 2026 18:16
Adds a JSON serialization option for sidecar metadata files, selectable
via a Format combo (independent of the suffix), and a raw JSON editor tab
that mirrors the whole document and syncs with the Form and YAML views.
Tour gains steps for the output format selector and the JSON editor.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Comment thread autotag_metadata/core/metadata_writer.py Outdated
Comment on lines +65 to +66
if fmt == "json":
json.dump(parameters, metadata_file, indent=2, ensure_ascii=False)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in yaml_utils.py you have a json dump, but not to file. I remeber that there were some datetime issues with json dump in svgdigitizer.

https://github.com/echemdb/svgdigitizer/blob/3b3e103928197a6ef16b0a57aa764d55a7ac50b5/svgdigitizer/entrypoint.py#L530

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right.

linuxrider and others added 3 commits July 12, 2026 06:26
Co-authored-by: Albert Engstfeld <albert.engstfeld@gmail.com>
YAML parses timestamps (e.g. `2026-07-12 06:36:55`) into datetime objects,
which json.dump cannot encode — writing a JSON sidecar with such a field
crashed. Add a shared json_default in yaml_utils that renders
datetime/date/time as ISO 8601, and wire it into both dump_json (JSON tab)
and write_metadata's json.dump (sidecar writer).

Replace the "yaml"/"json" magic strings with a str-based MetadataFormat
enum (single source of truth, typed). Being a str subclass keeps it
backward-compatible with existing TOML configs and Qt userData. The format
dropdown is now generated by iterating the enum.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Annotate every remaining function (returns and the params that go with
them) so the codebase is fully typed: core/ business logic, Config
accessors, the AutotagApp controller, and the ui/ widgets (Qt event
overrides typed with their concrete event classes).

Also fix the pixi `typecheck` task, which failed before checking any
code when a stale VIRTUAL_ENV from another project was inherited: pass
the interpreter explicitly via `ty check --python $CONDA_PREFIX`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@linuxrider
linuxrider merged commit b4d5b26 into echemdb:main Jul 12, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants