Skip to content

Add directory management helper script - #339

Open
rrakso wants to merge 1 commit into
SpaceApi:masterfrom
rrakso:directory-management-script
Open

Add directory management helper script#339
rrakso wants to merge 1 commit into
SpaceApi:masterfrom
rrakso:directory-management-script

Conversation

@rrakso

@rrakso rrakso commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Tooling for maintaining directory.json (no data change).

  • manage_directory.py (Python 3, standard library only):
    • sort rewrites directory.json in the CI-canonical form (byte-identical
      to jq -S), so a sorted file passes the sort CI job.
    • add [-n NAME -u URL] adds an entry, rejecting duplicate names and
      normalized-duplicate URLs, and validating the endpoint against the
      SpaceAPI validator (/v2/validateURL): schema plus reachability, HTTPS,
      certificate and CORS. Works interactively or non-interactively.
    • Writes atomically (temp file + rename) and preserves the file mode.
  • pyproject.toml: ruff configuration (format + lint) for the script.
  • README.md: documents the script under "Adding or sorting entries".

Add manage_directory.py, a standard-library-only helper that keeps
directory.json sorted (byte-identical to the CI `jq -S` canonical form)
and adds new entries after validating them against the SpaceAPI
validator (schema plus reachability, HTTPS, CORS and certificate). Add a
ruff configuration in pyproject.toml and document the script in README.
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.

1 participant