itqan-cli 0.6.0__tar.gz → 0.7.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.
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/CHANGELOG.md +13 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/PKG-INFO +3 -2
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/README.md +2 -1
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/pyproject.toml +2 -1
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/browse.py +8 -2
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/client.py +10 -2
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/main.py +7 -4
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_browse.py +14 -1
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/.gitignore +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/LICENSE +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/RELEASING.md +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/dart/.gitignore +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/dart/README.md +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/dart/analysis_options.yaml +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/dart/bin/itqan.dart +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/dart/lib/itqan_cli.dart +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/dart/lib/src/launcher.dart +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/dart/lib/src/version.dart +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/dart/pubspec.yaml +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/dart/test/launcher_test.dart +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/npm/README.md +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/npm/bin/itqan.js +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/scripts/dart_package.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/scripts/homebrew_formula.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/scripts/npm_packages.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/__init__.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/__main__.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/add.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/autoupdate.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/columns_comment.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/credentials.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/downloader.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/exceptions.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/flutter.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/init_template.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/lockfile.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/manifest.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/progress.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/semver.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/updates.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/src/itqan_cli/usage.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/__init__.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/conftest.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_access.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_add.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_assets_dir.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_autoupdate.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_cli_integration.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_client.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_columns_comment.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_dart_package.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_downloader.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_entry_points.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_flutter.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_homebrew_formula.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_init.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_install_progress.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_languages.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_lockfile.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_login.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_manifest.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_npm_packages.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_progress.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_updates.py +0 -0
- {itqan_cli-0.6.0 → itqan_cli-0.7.0}/tests/test_usage.py +0 -0
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## v0.7.0 (2026-11-14)
|
|
2
|
+
|
|
3
|
+
### BREAKING CHANGE
|
|
4
|
+
|
|
5
|
+
- the registry now reports tafsirs and translations as category `text` with tags such as `tafsir`
|
|
6
|
+
or `translation`. `itqan browse --category tafsir` and `--category translation` now fail with
|
|
7
|
+
the registry's `category_renamed` error; use `--tag` instead.
|
|
8
|
+
|
|
9
|
+
### Feat
|
|
10
|
+
|
|
11
|
+
- `itqan browse` shows each package's tags, in the table and in `--json` output.
|
|
12
|
+
- `itqan browse --tag/-t <tag>` filters the catalog by tag, for example `itqan browse --tag tafsir`.
|
|
13
|
+
|
|
1
14
|
## v0.6.0 (2026-11-03)
|
|
2
15
|
|
|
3
16
|
### Feat
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: itqan-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: Itqan Quranic Asset Manager: install and pin Itqan Quranic assets in your project.
|
|
5
5
|
Project-URL: Homepage, https://github.com/Itqan-community/itqan-cli
|
|
6
6
|
Project-URL: Repository, https://github.com/Itqan-community/itqan-cli
|
|
@@ -195,7 +195,8 @@ The asset's name is the one `itqan browse` and each asset's page in the
|
|
|
195
195
|
|
|
196
196
|
In `itqan browse`, type to filter the list, press Enter to add the highlighted asset, or press
|
|
197
197
|
Space on several and then Enter. `itqan browse tafsir` starts with a search, and
|
|
198
|
-
`itqan browse --
|
|
198
|
+
`itqan browse --tag translation` shows one kind of text asset (`--category font` does the same
|
|
199
|
+
for the other categories).
|
|
199
200
|
|
|
200
201
|
## Use the assets in your app
|
|
201
202
|
|
|
@@ -164,7 +164,8 @@ The asset's name is the one `itqan browse` and each asset's page in the
|
|
|
164
164
|
|
|
165
165
|
In `itqan browse`, type to filter the list, press Enter to add the highlighted asset, or press
|
|
166
166
|
Space on several and then Enter. `itqan browse tafsir` starts with a search, and
|
|
167
|
-
`itqan browse --
|
|
167
|
+
`itqan browse --tag translation` shows one kind of text asset (`--category font` does the same
|
|
168
|
+
for the other categories).
|
|
168
169
|
|
|
169
170
|
## Use the assets in your app
|
|
170
171
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "itqan-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.7.0"
|
|
4
4
|
description = "Itqan Quranic Asset Manager: install and pin Itqan Quranic assets in your project."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "MIT"
|
|
@@ -85,5 +85,6 @@ name = "cz_conventional_commits"
|
|
|
85
85
|
version_provider = "pep621"
|
|
86
86
|
version_scheme = "pep440"
|
|
87
87
|
tag_format = "v$version"
|
|
88
|
+
major_version_zero = true
|
|
88
89
|
update_changelog_on_bump = true
|
|
89
90
|
changelog_file = "CHANGELOG.md"
|
|
@@ -207,13 +207,18 @@ def access_footer(packages: list[CatalogPackage], has_api_key: bool) -> list[str
|
|
|
207
207
|
return lines
|
|
208
208
|
|
|
209
209
|
|
|
210
|
+
def kind_text(package: CatalogPackage) -> str:
|
|
211
|
+
"""The category, narrowed by the tags of a text asset: `text: tafsir`."""
|
|
212
|
+
return f"{package.category}: {', '.join(package.tags)}" if package.tags else package.category
|
|
213
|
+
|
|
214
|
+
|
|
210
215
|
def render_table(packages: list[CatalogPackage], targets: set[Target]) -> str:
|
|
211
216
|
"""Plain-text listing for pipes, CI and `--no-interactive`."""
|
|
212
217
|
header = ("SLUG", "CATEGORY", "LANGUAGES", "LATEST", "ACCESS", "NAME")
|
|
213
218
|
rows = [header] + [
|
|
214
219
|
(
|
|
215
220
|
("* " if package.languages and not missing_languages(targets, package) else "") + package.slug,
|
|
216
|
-
package
|
|
221
|
+
kind_text(package),
|
|
217
222
|
_languages_text(package),
|
|
218
223
|
_latest_text(package),
|
|
219
224
|
_access_column(package),
|
|
@@ -231,6 +236,7 @@ def to_json(packages: list[CatalogPackage], targets: set[Target]) -> list[dict]:
|
|
|
231
236
|
"slug": package.slug,
|
|
232
237
|
"name": package.name,
|
|
233
238
|
"category": package.category,
|
|
239
|
+
"tags": list(package.tags),
|
|
234
240
|
"is_open_access": package.is_open_access,
|
|
235
241
|
"access": package.access,
|
|
236
242
|
"access_request_url": package.access_request_url,
|
|
@@ -261,7 +267,7 @@ def choice_titles(packages: list[CatalogPackage], reasons: list[str | None], max
|
|
|
261
267
|
"""One aligned row per package that fits in ``max_width`` columns, leaving
|
|
262
268
|
room for the picker's ` (<reason>)` note on rows that can't be picked."""
|
|
263
269
|
columns = [
|
|
264
|
-
(package.slug, package
|
|
270
|
+
(package.slug, kind_text(package), _languages_text(package), _latest_text(package)) for package in packages
|
|
265
271
|
]
|
|
266
272
|
widths = [max(len(row[col]) for row in columns) for col in range(4)]
|
|
267
273
|
titles = []
|
|
@@ -63,6 +63,8 @@ class CatalogPackage:
|
|
|
63
63
|
# a registry that predates it, which only says whether the asset is open.
|
|
64
64
|
access: str | None = None
|
|
65
65
|
access_request_url: str | None = None
|
|
66
|
+
# Text assets: what kind of text it holds (tafsir, translation, ...). Slugs only.
|
|
67
|
+
tags: tuple[str, ...] = ()
|
|
66
68
|
|
|
67
69
|
|
|
68
70
|
@dataclass(frozen=True, slots=True)
|
|
@@ -164,6 +166,7 @@ class RegistryClient:
|
|
|
164
166
|
open_access: bool | None = None,
|
|
165
167
|
search: str | None = None,
|
|
166
168
|
category: str | None = None,
|
|
169
|
+
tag: str | None = None,
|
|
167
170
|
page_size: int = 50,
|
|
168
171
|
) -> list[CatalogPackage]:
|
|
169
172
|
"""Call GET /packages/ for the first page of installable assets.
|
|
@@ -172,7 +175,7 @@ class RegistryClient:
|
|
|
172
175
|
RegistryApiError when the registry can't be reached or answers badly.
|
|
173
176
|
"""
|
|
174
177
|
packages, _ = self._catalog_page(
|
|
175
|
-
open_access=open_access, search=search, category=category, page=1, page_size=page_size
|
|
178
|
+
open_access=open_access, search=search, category=category, tag=tag, page=1, page_size=page_size
|
|
176
179
|
)
|
|
177
180
|
return packages
|
|
178
181
|
|
|
@@ -182,6 +185,7 @@ class RegistryClient:
|
|
|
182
185
|
open_access: bool | None = None,
|
|
183
186
|
search: str | None = None,
|
|
184
187
|
category: str | None = None,
|
|
188
|
+
tag: str | None = None,
|
|
185
189
|
page_size: int = 50,
|
|
186
190
|
) -> list[CatalogPackage]:
|
|
187
191
|
"""Every installable asset matching the filters, following GET /packages/ pagination.
|
|
@@ -193,7 +197,7 @@ class RegistryClient:
|
|
|
193
197
|
page = 1
|
|
194
198
|
while True:
|
|
195
199
|
batch, count = self._catalog_page(
|
|
196
|
-
open_access=open_access, search=search, category=category, page=page, page_size=page_size
|
|
200
|
+
open_access=open_access, search=search, category=category, tag=tag, page=page, page_size=page_size
|
|
197
201
|
)
|
|
198
202
|
packages.extend(batch)
|
|
199
203
|
if not batch or len(packages) >= count:
|
|
@@ -206,6 +210,7 @@ class RegistryClient:
|
|
|
206
210
|
open_access: bool | None,
|
|
207
211
|
search: str | None,
|
|
208
212
|
category: str | None,
|
|
213
|
+
tag: str | None,
|
|
209
214
|
page: int,
|
|
210
215
|
page_size: int,
|
|
211
216
|
) -> tuple[list[CatalogPackage], int]:
|
|
@@ -219,6 +224,8 @@ class RegistryClient:
|
|
|
219
224
|
params["search"] = search
|
|
220
225
|
if category:
|
|
221
226
|
params["category"] = category
|
|
227
|
+
if tag:
|
|
228
|
+
params["tag"] = tag
|
|
222
229
|
try:
|
|
223
230
|
response = self.session.get(
|
|
224
231
|
f"{self.base_url}/packages/", params=params, headers=self._headers(), timeout=self.timeout
|
|
@@ -241,6 +248,7 @@ class RegistryClient:
|
|
|
241
248
|
publisher_name=item.get("publisher_name"),
|
|
242
249
|
access=item.get("access"),
|
|
243
250
|
access_request_url=item.get("access_request_url"),
|
|
251
|
+
tags=tuple(tag_item["slug"] for tag_item in item.get("tags") or ()),
|
|
244
252
|
languages=tuple(
|
|
245
253
|
CatalogLanguage(
|
|
246
254
|
language=lang["language"],
|
|
@@ -529,6 +529,7 @@ def init_command(manifest_path: str, assets_dir: str, registry_url: str, api_key
|
|
|
529
529
|
browse_command.callback(
|
|
530
530
|
query=None,
|
|
531
531
|
category=None,
|
|
532
|
+
tag=None,
|
|
532
533
|
manifest_path=str(m_path),
|
|
533
534
|
lockfile_path="itqan-assets.lock",
|
|
534
535
|
interactive=True,
|
|
@@ -546,7 +547,8 @@ def init_command(manifest_path: str, assets_dir: str, registry_url: str, api_key
|
|
|
546
547
|
|
|
547
548
|
@cli.command("browse", short_help="Search the catalog and add assets to the manifest.")
|
|
548
549
|
@click.argument("query", required=False)
|
|
549
|
-
@click.option("--category", "-c", default=None, help="Only assets of this category (mushaf,
|
|
550
|
+
@click.option("--category", "-c", default=None, help="Only assets of this category (mushaf, font, text, ...).")
|
|
551
|
+
@click.option("--tag", "-t", default=None, help="Only text assets with this tag (tafsir, translation, ...).")
|
|
550
552
|
@click.option(
|
|
551
553
|
"--manifest",
|
|
552
554
|
"-m",
|
|
@@ -587,6 +589,7 @@ def init_command(manifest_path: str, assets_dir: str, registry_url: str, api_key
|
|
|
587
589
|
def browse_command(
|
|
588
590
|
query: str | None,
|
|
589
591
|
category: str | None,
|
|
592
|
+
tag: str | None,
|
|
590
593
|
manifest_path: str,
|
|
591
594
|
lockfile_path: str,
|
|
592
595
|
interactive: bool | None,
|
|
@@ -596,7 +599,7 @@ def browse_command(
|
|
|
596
599
|
) -> None:
|
|
597
600
|
"""Browse installable assets and add them to itqan-assets.yaml.
|
|
598
601
|
|
|
599
|
-
QUERY searches names, slugs, descriptions and
|
|
602
|
+
QUERY searches names, slugs, descriptions, publishers and tags on the registry;
|
|
600
603
|
without it, every asset is listed and you can filter by typing in the picker.
|
|
601
604
|
"""
|
|
602
605
|
if interactive is None:
|
|
@@ -610,7 +613,7 @@ def browse_command(
|
|
|
610
613
|
manifest = load_manifest(m_path) if m_path.exists() else None
|
|
611
614
|
targets = browse.manifest_targets(manifest)
|
|
612
615
|
client = RegistryClient(base_url=registry_url, api_key=api_key)
|
|
613
|
-
packages = client.list_all_packages(search=query, category=category)
|
|
616
|
+
packages = client.list_all_packages(search=query, category=category, tag=tag)
|
|
614
617
|
except ItqanCliError as exc:
|
|
615
618
|
click.echo(f"Error: {exc.message}", err=True)
|
|
616
619
|
sys.exit(exc.exit_code)
|
|
@@ -619,7 +622,7 @@ def browse_command(
|
|
|
619
622
|
click.echo(json.dumps(browse.to_json(packages, targets), ensure_ascii=False, indent=2))
|
|
620
623
|
return
|
|
621
624
|
if not packages:
|
|
622
|
-
click.echo("No assets match." if query or category else "The registry has no installable assets yet.")
|
|
625
|
+
click.echo("No assets match." if query or category or tag else "The registry has no installable assets yet.")
|
|
623
626
|
return
|
|
624
627
|
if not interactive:
|
|
625
628
|
click.echo(browse.render_table(packages, targets))
|
|
@@ -20,7 +20,8 @@ REGISTRY = "https://cms.itqan.dev"
|
|
|
20
20
|
MULTILINGUAL = {
|
|
21
21
|
"slug": "tafsir-jalalayn",
|
|
22
22
|
"name": "Tafsir al-Jalalayn",
|
|
23
|
-
"category": "
|
|
23
|
+
"category": "text",
|
|
24
|
+
"tags": [{"slug": "tafsir", "name": "Tafsir"}],
|
|
24
25
|
"is_open_access": True,
|
|
25
26
|
"publisher_name": "Publisher",
|
|
26
27
|
"languages": [
|
|
@@ -89,6 +90,18 @@ def test_list_all_packages_where_catalog_has_two_pages_should_return_both():
|
|
|
89
90
|
assert [package.slug for package in packages] == ["mushaf-madinah", "tafsir-jalalayn"]
|
|
90
91
|
|
|
91
92
|
|
|
93
|
+
@responses.activate
|
|
94
|
+
def test_list_all_packages_where_tag_given_should_send_it():
|
|
95
|
+
# Arrange
|
|
96
|
+
_mock_catalog([MULTILINGUAL], query={"page_size": "50", "tag": "tafsir"})
|
|
97
|
+
|
|
98
|
+
# Act
|
|
99
|
+
packages = RegistryClient(base_url=REGISTRY).list_all_packages(tag="tafsir")
|
|
100
|
+
|
|
101
|
+
# Assert
|
|
102
|
+
assert [package.tags for package in packages] == [("tafsir",)]
|
|
103
|
+
|
|
104
|
+
|
|
92
105
|
@responses.activate
|
|
93
106
|
def test_list_all_packages_where_search_and_category_given_should_send_them():
|
|
94
107
|
# Arrange
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|