Skip to content

python(feat): report templates API resource - #672

Merged
wei-sift merged 5 commits into
mainfrom
fd-70-low-level-wrapper-report-report-templates
Jul 2, 2026
Merged

wei-sift merged 5 commits into
mainfrom
fd-70-low-level-wrapper-report-report-templates

Conversation

@wei-sift

@wei-sift wei-sift commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a report template API to sift_client:

template = client.reports.templates.create({"name": "Motor Checkout", "rule_ids": [r.id_ for r in rules]})
job = template.create_report(run=run)  # or client.reports.create_from_template(...); objects or IDs
  • New client.reports.templates (sync and async) with get (by ID or client key), list_, find, create, update, archive, unarchive
  • New ReportTemplate, ReportTemplateRule, ReportTemplateCreate, ReportTemplateUpdate types.
    • Templates reference existing rules: attach them by rule ID (rule_ids, also accepts Rule objects) or by rule client key (rule_client_keys), one scheme per request (validated client-side); templates return rules sorted by display_order
    • ReportTemplate.create_report(run=...) creates a report from the template in one call
  • New ReportTemplatesLowLevelClient wrapping ReportTemplateService
  • generate_sync_api gains nested_resources support: nested APIs get a cached property on the sync class that wraps the async instance held by the parent, with correct type stubs
  • Updated generated docs to order by source (definition order) rather than alphabetical
  • Breaking: reports.create_from_template now takes report_template (a ReportTemplate or ID) and run (a Run or ID) instead of report_template_id/run_id, matching the other create_from_* methods (CHANGELOG updated)

Test plan

  • Unit tests across the type, low-level, resource, and sync wrapper layers
  • Manual QA: find an existing rule, create a template from it, get by ID and client key, list/find, update (rename, rule replace, tag clear), create a report from the template (object and ID forms), and archive/unarchive

@wei-sift
wei-sift marked this pull request as ready for review July 1, 2026 22:19
@github-actions

github-actions Bot commented Jul 1, 2026 •

Copy link
Copy Markdown
Contributor

Python docs preview: https://sift-stack.github.io/sift/python/pr-672/

Deployed from 19be404. The link may take up to a minute to become live as GitHub Pages propagates.

@wei-sift
wei-sift requested a review from taylor-sift July 1, 2026 23:01
@wei-sift
wei-sift merged commit 18606a8 into main Jul 2, 2026
26 checks passed
@wei-sift
wei-sift deleted the fd-70-low-level-wrapper-report-report-templates branch July 2, 2026 00:16
alexluck-sift pushed a commit that referenced this pull request Jul 11, 2026
Bump version to 0.19.0 and update the changelog for the PRs merged
since v0.18.0: ABAC attributes (#646), get_data cache improvements
(#650), pytest docstring cleaning (#658), ULog data imports (#663),
access control API grouping (#666), report templates (#672),
download_file extra headers (#677), and the get_data pagination fix
plus progress bars (#678).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y5U49rrpvQm5bPbvEjR4xr
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