archivebox.api.v1_coreο
Module Contentsο
Classesο
Functionsο
List all ArchiveResult entries matching these filters. |
|
Get a specific ArchiveResult by id. |
|
Mark an uploaded ArchiveResultβs Snapshot as dirty without finalizing it. |
|
Create or update an ArchiveResult with one or more output files. |
|
Append or replace files on an existing ArchiveResult. |
|
List all Snapshot entries matching these filters. |
|
Return matching snapshots as an RSS feed, newest first. |
|
Get a specific Snapshot by id. |
|
Update a snapshot (e.g., set status=sealed to cancel queued work). |
|
Get any object by its ID (e.g. snapshot, archiveresult, tag, crawl, etc.). |
|
Return detailed tag cards for admin/live-search UIs. |
|
Return tags matching the query for autocomplete. |
|
Create a new tag or return existing one. |
|
Add a tag to a snapshot. Creates the tag if it doesnβt exist. |
|
Remove a tag from a snapshot. |
Dataο
APIο
- archivebox.api.v1_core.ARCHIVERESULT_UPLOAD_HOOK_NAME[source]ο
βon_Snapshot__archivebox_browser_extension_uploadβ
- class archivebox.api.v1_core.CustomPagination[source]ο
Bases:
ninja.pagination.PaginationBase
- class archivebox.api.v1_core.ArchiveResultFilterSchema[source]ο
Bases:
ninja.FilterSchema- id: Annotated[str | None, FilterLookup(['id__startswith', 'snapshot__id__startswith', 'snapshot__timestamp__startswith'])][source]ο
None
- search: Annotated[str | None, FilterLookup(['snapshot__url__icontains', 'snapshot__title__icontains', 'snapshot__tags__name__icontains', 'plugin', 'output_str__icontains', 'id__startswith', 'snapshot__id__startswith', 'snapshot__timestamp__startswith'])][source]ο
None
- snapshot_id: Annotated[str | None, FilterLookup(['snapshot__id__startswith', 'snapshot__timestamp__startswith'])][source]ο
None
- snapshot_tag: Annotated[str | None, FilterLookup('snapshot__tags__name__icontains')][source]ο
None
- archivebox.api.v1_core.get_archiveresults(request: django.http.HttpRequest, filters: ninja.Query[archivebox.api.v1_core.ArchiveResultFilterSchema])[source]ο
List all ArchiveResult entries matching these filters.
- archivebox.api.v1_core.get_archiveresult(request: django.http.HttpRequest, archiveresult_id: str)[source]ο
Get a specific ArchiveResult by id.
- archivebox.api.v1_core._normalize_uploaded_archiveresult_output_path(output_path: str, *, filename: str) str[source]ο
- archivebox.api.v1_core._parse_archiveresult_output_json(output_json: str | None) dict[str, Any] | None[source]ο
- archivebox.api.v1_core._get_archiveresult_upload_files(request: django.http.HttpRequest, *, allow_empty: bool = False) list[ninja.UploadedFile][source]ο
- archivebox.api.v1_core._get_archiveresult_upload_form_values(request: django.http.HttpRequest, *field_names: str) list[str][source]ο
- archivebox.api.v1_core._get_archiveresult_upload_form_value(request: django.http.HttpRequest, *field_names: str) str[source]ο
- archivebox.api.v1_core._parse_archiveresult_upload_int(value: str, field_name: str, *, default: int | None = None) int[source]ο
- archivebox.api.v1_core._summarize_archiveresult_output_files(output_files: dict[str, dict[str, Any]]) tuple[int, str][source]ο
- archivebox.api.v1_core._queue_archiveresult_snapshot_maintenance(snapshot: archivebox.core.models.Snapshot) None[source]ο
Mark an uploaded ArchiveResultβs Snapshot as dirty without finalizing it.
Upload API handlers are allowed to persist files and ArchiveResult rows, but Snapshot save() side effects, sealing, symlink creation, and index/details rewrites belong to the runner. retry_at is the scheduler signal the runner already watches, so only bump rows that are final or otherwise invisible.
- archivebox.api.v1_core._merge_archiveresult_output_file_maps(results: list[archivebox.core.models.ArchiveResult]) dict[str, dict[str, Any]][source]ο
- archivebox.api.v1_core._write_archiveresult_files(request: django.http.HttpRequest, snapshot: archivebox.core.models.Snapshot, plugin_name: str, *, existing_output_files: dict[str, dict[str, Any]] | None = None, allow_empty: bool = False) dict[str, dict[str, Any]][source]ο
- archivebox.api.v1_core.create_archiveresult(request: django.http.HttpRequest, snapshot_id: str = Form(...), plugin: str = Form(...), output_str: str = Form(''), hook_name: str = Form(ARCHIVERESULT_UPLOAD_HOOK_NAME), status: str = Form(str(ArchiveResult.StatusChoices.SUCCEEDED)), output_json: str = Form(''))[source]ο
Create or update an ArchiveResult with one or more output files.
- archivebox.api.v1_core.patch_archiveresult(request: django.http.HttpRequest, archiveresult_id: str)[source]ο
Append or replace files on an existing ArchiveResult.
- class archivebox.api.v1_core.SnapshotSchema[source]ο
Bases:
ninja.Schema- archiveresults: list[archivebox.api.v1_core.MinimalArchiveResultSchema][source]ο
None
- archivebox.api.v1_core._filter_snapshots_for_rss(*, crawl_id: str = '', created_by: str = '', before: str | None = None, limit: int = 50)[source]ο
- archivebox.api.v1_core._snapshots_rss_response(request: django.http.HttpRequest, *, snapshots, title: str = 'ArchiveBox Snapshots') django.http.HttpResponse[source]ο
- class archivebox.api.v1_core.SnapshotFilterSchema[source]ο
Bases:
ninja.FilterSchema- id: Annotated[str | None, FilterLookup(['id__istartswith', 'id__iendswith', 'timestamp__startswith'])][source]ο
None
- created_by_username: Annotated[str | None, FilterLookup('crawl__created_by__username__icontains')][source]ο
None
- created_at__gte: Annotated[datetime.datetime | None, FilterLookup('created_at__gte')][source]ο
None
- modified_at__gte: Annotated[datetime.datetime | None, FilterLookup('modified_at__gte')][source]ο
None
- modified_at__lt: Annotated[datetime.datetime | None, FilterLookup('modified_at__lt')][source]ο
None
- bookmarked_at__gte: Annotated[datetime.datetime | None, FilterLookup('bookmarked_at__gte')][source]ο
None
- archivebox.api.v1_core.get_snapshots(request: django.http.HttpRequest, filters: ninja.Query[archivebox.api.v1_core.SnapshotFilterSchema], with_archiveresults: bool = False)[source]ο
List all Snapshot entries matching these filters.
- archivebox.api.v1_core.get_snapshots_rss(request: django.http.HttpRequest, crawl_id: str = '', created_by: str = '', limit: int = 50, before: str | None = None)[source]ο
Return matching snapshots as an RSS feed, newest first.
- archivebox.api.v1_core.get_snapshot(request: django.http.HttpRequest, snapshot_id: str, with_archiveresults: bool = True)[source]ο
Get a specific Snapshot by id.
- archivebox.api.v1_core.create_snapshot(request: django.http.HttpRequest, data: archivebox.api.v1_core.SnapshotCreateSchema)[source]ο
- archivebox.api.v1_core.patch_snapshot(request: django.http.HttpRequest, snapshot_id: str, data: archivebox.api.v1_core.SnapshotUpdateSchema)[source]ο
Update a snapshot (e.g., set status=sealed to cancel queued work).
- archivebox.api.v1_core.delete_snapshot(request: django.http.HttpRequest, snapshot_id: str)[source]ο
- class archivebox.api.v1_core.TagSchema[source]ο
Bases:
ninja.Schema- snapshots: list[archivebox.api.v1_core.SnapshotSchema][source]ο
None
- archivebox.api.v1_core.get_tag(request: django.http.HttpRequest, tag_id: str, with_snapshots: bool = True)[source]ο
- archivebox.api.v1_core.get_any(request: django.http.HttpRequest, id: str)[source]ο
Get any object by its ID (e.g. snapshot, archiveresult, tag, crawl, etc.).
- class archivebox.api.v1_core.TagSearchCardSchema[source]ο
Bases:
ninja.Schema- snapshots: list[archivebox.api.v1_core.TagSearchSnapshotSchema][source]ο
None
- class archivebox.api.v1_core.TagSearchResponseSchema[source]ο
Bases:
ninja.Schema- tags: list[archivebox.api.v1_core.TagSearchCardSchema][source]ο
None
- archivebox.api.v1_core._get_snapshot_for_tag_edit(snapshot_ref: str) archivebox.core.models.Snapshot[source]ο
- archivebox.api.v1_core.search_tags(request: django.http.HttpRequest, q: str = '', sort: str = 'created_desc', created_by: str = '', year: str = '', has_snapshots: str = 'all')[source]ο
Return detailed tag cards for admin/live-search UIs.
- archivebox.api.v1_core._request_has_tag_autocomplete_access(request: django.http.HttpRequest) bool[source]ο
- archivebox.api.v1_core.tags_autocomplete(request: django.http.HttpRequest, q: str = '')[source]ο
Return tags matching the query for autocomplete.
- archivebox.api.v1_core.tags_create(request: django.http.HttpRequest, data: archivebox.api.v1_core.TagCreateSchema)[source]ο
Create a new tag or return existing one.
- archivebox.api.v1_core.rename_tag(request: django.http.HttpRequest, tag_id: int, data: archivebox.api.v1_core.TagUpdateSchema)[source]ο
- archivebox.api.v1_core.tag_snapshots_export(request: django.http.HttpRequest, tag_id: int)[source]ο
- archivebox.api.v1_core.tags_add_to_snapshot(request: django.http.HttpRequest, data: archivebox.api.v1_core.TagSnapshotRequestSchema)[source]ο
Add a tag to a snapshot. Creates the tag if it doesnβt exist.
- archivebox.api.v1_core.tags_remove_from_snapshot(request: django.http.HttpRequest, data: archivebox.api.v1_core.TagSnapshotRequestSchema)[source]ο
Remove a tag from a snapshot.