Skip to main content
Ctrl+K

Qualitative Feedback Analysis 2.5.0

  • Ubiquitous Language
  • Developer guide
  • Architecture
  • Operations
  • REST API
    • Python API reference
    • EspoCRM integration
    • Migration guide — 0.14.0 (ubiquitous-language alignment)
  • Ubiquitous Language
  • Developer guide
  • Architecture
  • Operations
  • REST API
  • Python API reference
  • EspoCRM integration
  • Migration guide — 0.14.0 (ubiquitous-language alignment)

Section Navigation

  • qfa
    • qfa.adapters
      • qfa.adapters.db
      • qfa.adapters.embedding
      • qfa.adapters.env_auth
      • qfa.adapters.llm_client
      • qfa.adapters.presidio_anonymizer
      • qfa.adapters.tracking_llm
      • qfa.adapters.usage_repository
    • qfa.api
      • qfa.api.app
      • qfa.api.composition
      • qfa.api.dependencies
      • qfa.api.routes
      • qfa.api.routes_admin
      • qfa.api.routes_usage
      • qfa.api.schemas
      • qfa.api.schemas_usage
    • qfa.cli
      • qfa.cli.migrate
    • qfa.domain
      • qfa.domain.chunk_models
      • qfa.domain.clustering_models
      • qfa.domain.errors
      • qfa.domain.models
      • qfa.domain.ports
      • qfa.domain.sensitivity_types
      • qfa.domain.usage_models
    • qfa.main
    • qfa.resources
    • qfa.services
      • qfa.services.analyze
      • qfa.services.auth_orchestrator
      • qfa.services.call_context
      • qfa.services.clustering
      • qfa.services.coding
      • qfa.services.coding_classifier
      • qfa.services.coding_trends
      • qfa.services.hierarchical_prompts
      • qfa.services.language
      • qfa.services.llm_call_executor
      • qfa.services.prompts
      • qfa.services.record_links
      • qfa.services.sensitivity
      • qfa.services.summarize
    • qfa.settings
    • qfa.utils
  • Python API reference
  • qfa
  • qfa.services
  • qfa.services.coding_trends

qfa.services.coding_trends#

Deterministic, non-LLM coding-trend table.

Counts coding labels over time periods, assembled from feedback-record metadata. Best-effort: when created is absent or unparseable the table is omitted (None) and the reduce step degrades to text-only synthesis. No LLM, no port — pure services logic.

The period granularity is configurable (day / week / month) so a one-month corpus can still show meaningful trend buckets. week uses ISO week numbering (YYYY-Www) so the ISO year — not the calendar year — anchors the bucket, avoiding the silent off-by-one where 2024-12-30 would otherwise collide with truly-January-2024 records.

Functions

build_coding_trend_table(records, *, code_fields)

Build a code-by-period count table from record metadata.

render_coding_trend_table(table)

Render the table as a compact text grid for the reduce prompt.

qfa.services.coding_trends.build_coding_trend_table(records: tuple[FeedbackRecordModel, ...], *, code_fields: Sequence[str], period: Literal['day', 'week', 'month'] = 'week') → CodingTrendTable | None[source]#

Build a code-by-period count table from record metadata.

Parameters:
  • records (tuple[FeedbackRecordModel, ...]) – The full input record set.

  • code_fields (Sequence[str]) – Metadata keys holding coding labels (comma-separated strings).

  • period (TrendPeriod) – Bucket granularity. week (the default) is usually right; month is better for multi-year corpora; day for short-window deep-dives.

Returns:

The assembled table, or None when no record carries a parseable date in created (best-effort omission).

Return type:

CodingTrendTable | None

qfa.services.coding_trends.render_coding_trend_table(table: CodingTrendTable) → str[source]#

Render the table as a compact text grid for the reduce prompt.

Rows are codes, columns are periods, cells are integer counts. This is the faithfulness anchor the synthesis prompt cites.

previous

qfa.services.coding_classifier

next

qfa.services.hierarchical_prompts

On this page
  • build_coding_trend_table()
  • render_coding_trend_table()
Show Source

© Copyright 2026, Marius Helf, Paul van Houtum.

Created using Sphinx 9.1.0.

Built with the PyData Sphinx Theme 0.17.1.