Skip to content

Add pyld command-line interface - #305

Open
anatoly-scherbakov wants to merge 22 commits into
masterfrom
command-line-interface
Open

Add pyld command-line interface#305
anatoly-scherbakov wants to merge 22 commits into
masterfrom
command-line-interface

Conversation

@anatoly-scherbakov

@anatoly-scherbakov anatoly-scherbakov commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add pyld CLI (get, expand, cache clear) via pip install "PyLD[cli]".
  • Lazy console-script entry (cli_entry) so a bare install fails with an install hint instead of an import crash.
  • Compose ChoiceByTypeDocumentLoader + ChoiceBySchemeDocumentLoader + cached HTTP loader for Path vs URL inputs.
  • CLI docs (termynal examples), README/installation notes.

Stack

master#301 File → #302 Scheme → #304 ByType → #303 Sqlite lazy-init → #305 CLI (this PR).

Test plan

  • pytest tests/test_cli.py
  • CI green
  • make docs-build after docs deps install

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown

Coverage

Coverage Report
FileStmtsMissCoverMissing
lib/pyld
   canon.py218498%27, 180, 565–566
   context_resolver.py103892%78, 137, 151, 197, 203–205, 229
   iri_resolver.py141398%311–312, 322
   jsonld.py252115994%260–264, 313, 350, 355, 365, 382–397, 433–434, 476, 484, 504, 512–513, 621–626, 709–710, 725–726, 789–794, 819–820, 835–836, 846–847, 873, 916, 926, 947–948, 991, 998, 1066, 1089, 1111–1113, 1123–1126, 1141, 1164, 1176–1179, 1275, 1287–1290, 1310, 1339, 1372, 1376, 1413, 1456, 1475–1478, 1491, 1540, 1643–1650, 1677–1679, 1705–1708, 1884, 1922, 2228, 2359, 2368–2375, 2469, 2496, 2520, 2528, 3119, 3164, 3183, 3248, 3301, 3304, 3367, 3452, 3486, 3494, 3772, 3777, 3779, 3964–3968, 4079, 4121, 4184, 4419, 4707, 4839, 4873, 4902–4905, 4931–4932, 5115, 5179, 5206, 5280, 5282, 5300, 5398, 5447, 5679, 5681, 5720, 5722, 5731, 5873, 6001, 6088, 6208–6222, 6354, 6567, 6573–6577, 6616, 6619, 6709–6710, 6719
lib/pyld/cli
   __init__.py110595%67–69, 215, 235, 238
   entry.py12375%9–11, 24
lib/pyld/documentloader
   aiohttp.py712269%29–39, 68, 74, 86, 98–106, 118–121, 138, 153–156
   file.py36197%49
   requests.py52590%57, 71, 83–91
   requests_sqlite_cache.py25196%19
   scheme_directed.py15193%38
   type_directed.py15193%41
TOTAL363621394% 

Tests Skipped Failures Errors Time
1773 37 💤 0 ❌ 0 🔥 2m 59s ⏱️

@anatoly-scherbakov
anatoly-scherbakov changed the base branch from choice-by-type-document-loader to sqlite-cache-lazy-init July 26, 2026 17:39
@anatoly-scherbakov anatoly-scherbakov linked an issue Aug 10, 2026 that may be closed by this pull request
@mielvds
mielvds force-pushed the command-line-interface branch from 2f84958 to ac828f6 Compare August 26, 2026 07:14

@mielvds mielvds left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice work @anatoly-scherbakov , some minor comments. FYI, I won't publish v3.3.0 before #306, since the CLI is pretty incomplete now.

Comment thread lib/pyld/cli/__init__.py
Comment thread lib/pyld/cli.py Outdated
Comment thread lib/pyld/cli/__init__.py
Comment thread tests/test_cli.py Outdated
Comment thread tests/test_cli.py Outdated
@mielvds
mielvds force-pushed the command-line-interface branch from ac828f6 to 7c6d9b6 Compare August 26, 2026 08:00
Base automatically changed from sqlite-cache-lazy-init to master August 26, 2026 08:01
@mielvds
mielvds force-pushed the command-line-interface branch from 7c6d9b6 to 17671eb Compare August 26, 2026 08:01
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.

command-line tool

2 participants