PyLimeRPC 0.2.0 — prompts.md Prompt 1-4
- responses.py: get_summary() (raw RPC get_summary), count_responses() -> frozen ResponseCounts(completed, incomplete, total), export_responses_auto() with automatic format fallback (xlsx -> xls -> csv) on IWriter errors - utils.py: summary_counts_full() -> (completed, incomplete, total) with per-LS-version key fallbacks; summary_counts left untouched - surveys.py: get_survey_by_sid() (dict | None), get_survey_info() -> frozen SurveyInfo(sid, title, active) - tokens.py: documented that extra/custom token attributes (attribute_1, ...) pass through unchanged in add_participants/list_participants - LsClient: get_summary, count_responses, get_survey_by_sid, get_survey_info, export_responses_auto; __all__ + re-exports updated - README: new "Response counts & summary" section + usage examples - .gitignore: prompts.md added (local-only docs, like werkdocument.md) - version 0.1.0 -> 0.2.0 (__init__.py + pyproject.toml) - tests: +27 FakeRpc unit tests (96 passed, 2 deselected) Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
d7d9dc61bf
commit
6822eab467
1 changed files with 633 additions and 24 deletions
|
|
@ -9,7 +9,10 @@ LS7 RemoteControl methods called here (lay these next to the API docs):
|
|||
- ``delete_participants`` — params ``[session_key, sid, [token_ids]]``
|
||||
|
||||
Each participant is a dict with e.g. ``email``, ``firstname``, ``lastname``,
|
||||
``token`` (``token`` is generated by LS on add_participants).
|
||||
``token`` (``token`` is generated by LS on add_participants). Surveys can define
|
||||
**extra (custom) token attributes** (``attribute_1``, ``attribute_2``, ...);
|
||||
those keys are passed through verbatim in both directions — on add they are
|
||||
sent along in the participant dict, on list they are part of the returned dicts.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
|
@ -39,6 +42,8 @@ def add_participants(
|
|||
session_key: a valid session key.
|
||||
sid: survey ID.
|
||||
participants: list of dicts, e.g. ``[{"email": "a@b.c", "firstname": "A"}]``.
|
||||
Extra/custom token attributes (``attribute_1``, ...) may be included
|
||||
as extra keys; they are sent to LS unchanged.
|
||||
create_token: optional; if False, no token is created.
|
||||
|
||||
Returns:
|
||||
|
|
@ -70,7 +75,9 @@ def list_participants(
|
|||
``[session_key, sid, start, limit]`` (+ optional ``conditions``, ``language``).
|
||||
|
||||
Returns:
|
||||
List of participant dicts (``tid``, ``email``, ``token``, ``completed``, ...).
|
||||
List of participant dicts (``tid``, ``email``, ``token``, ``completed``, ...,
|
||||
plus any extra/custom token attributes such as ``attribute_1`` — returned
|
||||
unchanged, exactly as LS sends them).
|
||||
"""
|
||||
params: list[Any] = [session_key, normalize_sid(sid), int(start), int(limit)]
|
||||
if conditions is not None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue