Skip to content

Activities API reference

Activity detail

Authenticated route for the combined activity detail.

read_activity_detail

read_activity_detail(activity_id, token_user_id, db, response)

Return an activity with its laps, sets and workout steps in one read.

Equivalent to reading the activity and each collection separately, with the access decision made once. The activity carries its media when the caller owns it, and owner is the owner's public profile. Streams stay on their own route. The ETag is the activity's, to echo in If-Match when saving it.

Source code in backend/app/modules/activities/activity_detail/router.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
@router.get(
    "/detail",
    response_model=activity_detail_schema.ActivityDetailRead,
    responses={200: {"headers": core_openapi_contract.ETAG_HEADERS}},
    dependencies=[Security(auth_dependencies.check_scopes, scopes=["activities:read"])],
)
def read_activity_detail(
    activity_id: activity_dependencies.ActivityId,
    token_user_id: auth_dependencies.CurrentUserId,
    db: core_dependencies.DbSession,
    response: Response,
) -> activity_detail_schema.ActivityDetailRead:
    """Return an activity with its laps, sets and workout steps in one read.

    Equivalent to reading the activity and each collection separately, with the access decision made
    once. The activity carries its ``media`` when the caller owns it, and ``owner`` is the owner's
    public profile. Streams stay on their own route. The ``ETag`` is the activity's, to echo in
    ``If-Match`` when saving it.
    """
    detail = activity_detail_service.get_activity_detail(activity_id, token_user_id, db)
    if detail.activity.version is not None:
        core_etag.set_etag(response, detail.activity.version)
    return detail

Pydantic schema for the combined activity detail.

ActivityDetailRead

Bases: BaseModel

An activity together with the first page of each child collection the detail view shows.

Each collection is the page envelope its own route returns, so a client that finds a next page continues with that route. A collection hidden from the viewer, or one the activity has none of, is an empty page.

Attributes:

Name Type Description
activity ActivityRead

The activity, masked as the viewer may see it. Its media is filled for its owner only, as in the list responses.

owner UserPublicRead | None

The activity owner's public profile, the projection GET /users/{user_id} returns. null for an anonymous viewer when the server does not share user info publicly, and for an owner who is inactive or awaiting approval.

laps ActivityLapsPage

The activity's laps.

sets ActivitySetsPage

The activity's performed workout sets.

workout_steps ActivityWorkoutStepsPage

The activity's planned workout steps.

Source code in backend/app/modules/activities/activity_detail/schema.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class ActivityDetailRead(BaseModel):
    """An activity together with the first page of each child collection the detail view shows.

    Each collection is the page envelope its own route returns, so a client that finds a ``next`` page
    continues with that route. A collection hidden from the viewer, or one the activity has none of,
    is an empty page.

    Attributes:
        activity: The activity, masked as the viewer may see it. Its ``media`` is filled for its owner
            only, as in the list responses.
        owner: The activity owner's public profile, the projection ``GET /users/{user_id}`` returns.
            ``null`` for an anonymous viewer when the server does not share user info publicly, and
            for an owner who is inactive or awaiting approval.
        laps: The activity's laps.
        sets: The activity's performed workout sets.
        workout_steps: The activity's planned workout steps.
    """

    activity: activity_schema.ActivityRead
    owner: users_schema.UserPublicRead | None
    laps: activity_laps_schema.ActivityLapsPage
    sets: activity_sets_schema.ActivitySetsPage
    workout_steps: activity_workout_steps_schema.ActivityWorkoutStepsPage

Activity streams

Authenticated activity stream endpoints.

list_activity_streams

list_activity_streams(request, activity_id, token_user_id, db, page)

Return one page of the given activity's streams, with the matching total.

Source code in backend/app/modules/activities/activity_streams/router.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@router.get(
    "/streams",
    response_model=activity_streams_schema.ActivityStreamResponsePage,
    dependencies=[
        Security(
            auth_dependencies.check_scopes,
            scopes=["activities:read"],
        )
    ],
)
@core_rate_limit.limiter.limit(core_rate_limit.EXPENSIVE_READ)
def list_activity_streams(
    request: Request,
    activity_id: activity_dependencies.ActivityId,
    token_user_id: auth_dependencies.CurrentUserId,
    db: core_dependencies.DbSession,
    page: core_pagination.ChildPage,
) -> activity_streams_schema.ActivityStreamsPage:
    """Return one page of the given activity's streams, with the matching total."""
    return activity_streams_service.list_activity_streams(
        activity_id,
        token_user_id,
        db,
        page_number=page.page_number,
        num_records=page.num_records,
    )

read_activity_stream

read_activity_stream(request, activity_id, stream_type, token_user_id, db)

Get a specific stream type for an activity.

Not found when the activity has no such stream or is not visible to the caller. A single resource that does not exist is a 404 rather than 200 null, and the two cases are indistinguishable so the endpoint cannot be used to probe which activities exist.

Source code in backend/app/modules/activities/activity_streams/router.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@router.get(
    "/streams/{stream_type}",
    response_model=activity_streams_schema.ActivityStreamResponse,
    dependencies=[
        Security(
            auth_dependencies.check_scopes,
            scopes=["activities:read"],
        )
    ],
)
@core_rate_limit.limiter.limit(core_rate_limit.EXPENSIVE_READ)
def read_activity_stream(
    request: Request,
    activity_id: activity_dependencies.ActivityId,
    stream_type: activity_streams_dependencies.StreamType,
    token_user_id: auth_dependencies.CurrentUserId,
    db: core_dependencies.DbSession,
) -> activity_streams_schema.ActivityStreamsRead:
    """Get a specific stream type for an activity.

    Not found when the activity has no such stream or is not visible to the
    caller. A single resource that does not exist is a ``404`` rather than
    ``200 null``, and the two cases are indistinguishable so the endpoint cannot
    be used to probe which activities exist.
    """
    return activity_streams_service.get_activity_stream(
        activity_id,
        stream_type.stored,
        token_user_id,
        db,
    )

Pydantic schemas for activity stream data.

ActivityStreamZones

Bases: BaseModel

A stream's zone breakdowns, by metric.

Attributes:

Name Type Description
hr HrZoneBreakdown

The heart-rate zone breakdown.

Source code in backend/app/modules/activities/activity_streams/schema.py
44
45
46
47
48
49
50
51
class ActivityStreamZones(BaseModel):
    """A stream's zone breakdowns, by metric.

    Attributes:
        hr: The heart-rate zone breakdown.
    """

    hr: activity_streams_hr_zones.HrZoneBreakdown

ActivityStreamsBase

Bases: BaseModel

Schema for activity stream data.

Attributes:

Name Type Description
id

Unique stream identifier.

activity_id UUID

Parent activity identifier.

stream_type StrictInt

Stream type code, as stored (1-8); a client reads it as ActivityStreamType.

stream_waypoints list[dict[str, Any]]

Waypoint data points, as stored: JSON objects with a time and the stream's value key(s).

strava_activity_stream_id StrictInt | None

Strava stream ID.

Source code in backend/app/modules/activities/activity_streams/schema.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
class ActivityStreamsBase(BaseModel):
    """Schema for activity stream data.

    Attributes:
        id: Unique stream identifier.
        activity_id: Parent activity identifier.
        stream_type: Stream type code, as stored (1-8); a client reads it as ``ActivityStreamType``.
        stream_waypoints: Waypoint data points, as stored: JSON objects with a ``time`` and the stream's value key(s).
        strava_activity_stream_id: Strava stream ID.
    """

    model_config = ConfigDict(
        from_attributes=True,
        extra="forbid",
    )

    activity_id: uuid.UUID
    stream_type: StrictInt
    stream_waypoints: list[dict[str, Any]]
    strava_activity_stream_id: StrictInt | None = None

ActivityStreamsRead

Bases: ActivityStreamsBase

A stored stream, as the services handle it before it is typed for a client.

Its waypoints are the stored JSON objects. Routes answer with the typed :data:ActivityStreamResponse of the same stream.

Attributes:

Name Type Description
id UUID

Unique stream identifier.

zone_percentages ActivityStreamZones | None

The stream's zone breakdowns. Computed when the stream is served, from the owner's current thresholds; never stored, so it cannot go stale.

Source code in backend/app/modules/activities/activity_streams/schema.py
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
class ActivityStreamsRead(ActivityStreamsBase):
    """A stored stream, as the services handle it before it is typed for a client.

    Its waypoints are the stored JSON objects. Routes answer with the typed
    :data:`ActivityStreamResponse` of the same stream.

    Attributes:
        id: Unique stream identifier.
        zone_percentages: The stream's zone breakdowns. Computed when the stream
            is served, from the owner's current thresholds; never stored, so it
            cannot go stale.
    """

    id: uuid.UUID
    zone_percentages: ActivityStreamZones | None = None

CadenceStreamRead

Bases: _ActivityStreamResponse[CadenceWaypoint]

The cadence stream (cadence).

Source code in backend/app/modules/activities/activity_streams/schema.py
217
218
class CadenceStreamRead(_ActivityStreamResponse[CadenceWaypoint]):
    """The cadence stream (`cadence`)."""

CadenceWaypoint

Bases: StreamWaypoint

A sample of the cadence stream.

Attributes:

Name Type Description
cad _Number | None

Cadence in rpm (spm for running).

Source code in backend/app/modules/activities/activity_streams/schema.py
115
116
117
118
119
120
121
122
123
124
class CadenceWaypoint(StreamWaypoint):
    """A sample of the cadence stream.

    Attributes:
        cad: Cadence in rpm (spm for running).
    """

    cad: _Number | None = Field(
        default=None, description="Cadence in revolutions per minute (steps per minute for running)"
    )

ElevationStreamRead

Bases: _ActivityStreamResponse[ElevationWaypoint]

The elevation stream (elevation).

Source code in backend/app/modules/activities/activity_streams/schema.py
221
222
class ElevationStreamRead(_ActivityStreamResponse[ElevationWaypoint]):
    """The elevation stream (`elevation`)."""

ElevationWaypoint

Bases: StreamWaypoint

A sample of the elevation stream.

Attributes:

Name Type Description
ele _Number | None

Elevation in meters.

Source code in backend/app/modules/activities/activity_streams/schema.py
127
128
129
130
131
132
133
134
class ElevationWaypoint(StreamWaypoint):
    """A sample of the elevation stream.

    Attributes:
        ele: Elevation in meters.
    """

    ele: _Number | None = Field(default=None, description="Elevation in meters")

HeartRateStreamRead

Bases: _ActivityStreamResponse[HeartRateWaypoint]

The heart-rate stream (heart_rate).

Source code in backend/app/modules/activities/activity_streams/schema.py
209
210
class HeartRateStreamRead(_ActivityStreamResponse[HeartRateWaypoint]):
    """The heart-rate stream (`heart_rate`)."""

HeartRateWaypoint

Bases: StreamWaypoint

A sample of the heart-rate stream.

Attributes:

Name Type Description
hr _Number | None

Heart rate in bpm.

Source code in backend/app/modules/activities/activity_streams/schema.py
 95
 96
 97
 98
 99
100
101
102
class HeartRateWaypoint(StreamWaypoint):
    """A sample of the heart-rate stream.

    Attributes:
        hr: Heart rate in bpm.
    """

    hr: _Number | None = Field(default=None, description="Heart rate in beats per minute")

MapStreamRead

Bases: _ActivityStreamResponse[MapWaypoint]

The GPS map stream (map).

Source code in backend/app/modules/activities/activity_streams/schema.py
233
234
class MapStreamRead(_ActivityStreamResponse[MapWaypoint]):
    """The GPS map stream (`map`)."""

MapWaypoint

Bases: StreamWaypoint

A GPS sample of the map stream.

Attributes:

Name Type Description
lat _Number | None

Latitude in decimal degrees.

lon _Number | None

Longitude in decimal degrees.

Source code in backend/app/modules/activities/activity_streams/schema.py
157
158
159
160
161
162
163
164
165
166
class MapWaypoint(StreamWaypoint):
    """A GPS sample of the map stream.

    Attributes:
        lat: Latitude in decimal degrees.
        lon: Longitude in decimal degrees.
    """

    lat: _Number | None = Field(default=None, description="Latitude in decimal degrees")
    lon: _Number | None = Field(default=None, description="Longitude in decimal degrees")

PaceStreamRead

Bases: _ActivityStreamResponse[PaceWaypoint]

The pace stream (pace).

Source code in backend/app/modules/activities/activity_streams/schema.py
229
230
class PaceStreamRead(_ActivityStreamResponse[PaceWaypoint]):
    """The pace stream (`pace`)."""

PaceWaypoint

Bases: StreamWaypoint

A sample of the pace stream.

Attributes:

Name Type Description
pace _Number | None

Pace in s/m; 0 where the speed is 0.

Source code in backend/app/modules/activities/activity_streams/schema.py
147
148
149
150
151
152
153
154
class PaceWaypoint(StreamWaypoint):
    """A sample of the pace stream.

    Attributes:
        pace: Pace in s/m; 0 where the speed is 0.
    """

    pace: _Number | None = Field(default=None, description="Pace in seconds per meter; 0 where the speed is 0")

PowerStreamRead

Bases: _ActivityStreamResponse[PowerWaypoint]

The power stream (power).

Source code in backend/app/modules/activities/activity_streams/schema.py
213
214
class PowerStreamRead(_ActivityStreamResponse[PowerWaypoint]):
    """The power stream (`power`)."""

PowerWaypoint

Bases: StreamWaypoint

A sample of the power stream.

Attributes:

Name Type Description
power _Number | None

Power in watts.

Source code in backend/app/modules/activities/activity_streams/schema.py
105
106
107
108
109
110
111
112
class PowerWaypoint(StreamWaypoint):
    """A sample of the power stream.

    Attributes:
        power: Power in watts.
    """

    power: _Number | None = Field(default=None, description="Power in watts")

SpeedStreamRead

Bases: _ActivityStreamResponse[SpeedWaypoint]

The speed stream (speed).

Source code in backend/app/modules/activities/activity_streams/schema.py
225
226
class SpeedStreamRead(_ActivityStreamResponse[SpeedWaypoint]):
    """The speed stream (`speed`)."""

SpeedWaypoint

Bases: StreamWaypoint

A sample of the speed stream.

Attributes:

Name Type Description
vel _Number | None

Speed in m/s.

Source code in backend/app/modules/activities/activity_streams/schema.py
137
138
139
140
141
142
143
144
class SpeedWaypoint(StreamWaypoint):
    """A sample of the speed stream.

    Attributes:
        vel: Speed in m/s.
    """

    vel: _Number | None = Field(default=None, description="Speed in meters per second")

StreamWaypoint

Bases: BaseModel

What every stream sample carries, served as it was stored.

Attributes:

Name Type Description
time Annotated[str | _Number | None, Field(exclude_if=lambda value: value is None, description='When the sample was taken: a UTC timestamp, or seconds from the start for a Strava stream')]

When the sample was taken: a UTC YYYY-MM-DDTHH:MM:SS string, or seconds from the start for a stream imported from Strava. Absent when the activity hides its start time from the viewer.

Source code in backend/app/modules/activities/activity_streams/schema.py
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
class StreamWaypoint(BaseModel):
    """What every stream sample carries, served as it was stored.

    Attributes:
        time: When the sample was taken: a UTC ``YYYY-MM-DDTHH:MM:SS`` string, or seconds from the start for
            a stream imported from Strava. Absent when the activity hides its start time from the viewer.
    """

    model_config = ConfigDict(extra="allow")

    time: Annotated[
        str | _Number | None,
        Field(
            exclude_if=lambda value: value is None,
            description="When the sample was taken: a UTC timestamp, or seconds from the start for a Strava stream",
        ),
    ] = None

TemperatureStreamRead

Bases: _ActivityStreamResponse[TemperatureWaypoint]

The temperature stream (temperature).

Source code in backend/app/modules/activities/activity_streams/schema.py
237
238
class TemperatureStreamRead(_ActivityStreamResponse[TemperatureWaypoint]):
    """The temperature stream (`temperature`)."""

TemperatureWaypoint

Bases: StreamWaypoint

A sample of the temperature stream.

Attributes:

Name Type Description
temp _Number | None

Temperature in degrees Celsius.

Source code in backend/app/modules/activities/activity_streams/schema.py
169
170
171
172
173
174
175
176
class TemperatureWaypoint(StreamWaypoint):
    """A sample of the temperature stream.

    Attributes:
        temp: Temperature in degrees Celsius.
    """

    temp: _Number | None = Field(default=None, description="Temperature in degrees Celsius")

Activity summary

FastAPI routes for activity summaries (authenticated).

Thin HTTP adapter: it validates query parameters and delegates every decision to :mod:activity_summary_service. Mounted under /activities/summaries as a sub-resource of activities, and the period is a query parameter, not a path segment, because week/month/ year/lifetime are four views of one resource, not four resources.

read_activity_summary

read_activity_summary(request, token_user_id, db, period=activity_constants.SummaryPeriod.WEEK, anchor_date=None, target_year=None, activity_type=None)

Return the authenticated user's activity summary for one period.

Source code in backend/app/modules/activities/activity/summary_router.py
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@router.get(
    "",
    response_model=activity_summary_schema.SummaryResponse,
    dependencies=[Security(auth_dependencies.check_scopes, scopes=["activities:read"])],
)
@core_rate_limit.limiter.limit(core_rate_limit.EXPENSIVE_READ)
def read_activity_summary(
    request: Request,
    token_user_id: auth_dependencies.CurrentUserId,
    db: core_dependencies.DbSession,
    period: Annotated[activity_constants.SummaryPeriod, Query()] = activity_constants.SummaryPeriod.WEEK,
    anchor_date: Annotated[
        core_date_range.WindowDate | None,
        Query(
            alias="date",
            description=(
                "The caller's local calendar date, used to decide which week or month "
                "is current. Defaults to today in the caller's configured timezone."
            ),
        ),
    ] = None,
    target_year: Annotated[
        int | None,
        Query(
            alias="year",
            ge=activity_constants.MIN_SUMMARY_YEAR,
            le=9999,
            description=(
                "Target year for the yearly summary. Defaults to the anchor date's year. "
                "A year later than the caller's current year is refused."
            ),
        ),
    ] = None,
    activity_type: activity_dependencies.ActivityTypeFilter = None,
) -> activity_summary_schema.SummaryResponse:
    """Return the authenticated user's activity summary for one period."""
    return activity_summary_service.build_summary(
        token_user_id,
        period,
        db,
        anchor=anchor_date,
        target_year=target_year,
        activity_type=activity_type,
    )

Activity workout steps

Authenticated routes for activity workout steps.

list_activity_workout_steps

list_activity_workout_steps(activity_id, token_user_id, db, page)

Return one page of the activity's workout steps, with the matching total.

Source code in backend/app/modules/activities/activity_workout_steps/router.py
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
@router.get(
    "/workout-steps",
    response_model=activity_workout_steps_schema.ActivityWorkoutStepsPage,
    dependencies=[Security(auth_dependencies.check_scopes, scopes=["activities:read"])],
)
def list_activity_workout_steps(
    activity_id: activity_dependencies.ActivityId,
    token_user_id: auth_dependencies.CurrentUserId,
    db: core_dependencies.DbSession,
    page: core_pagination.ChildPage,
) -> activity_workout_steps_schema.ActivityWorkoutStepsPage:
    """Return one page of the activity's workout steps, with the matching total."""
    return activity_workout_steps_service.list_activity_workout_steps(
        activity_id,
        token_user_id,
        db,
        page_number=page.page_number,
        num_records=page.num_records,
    )

Activity workout steps schemas.

ActivityWorkoutStepsBase

Bases: BaseModel

Fields that describe one workout step.

Attributes:

Name Type Description
message_index StrictInt

Workout step message index.

duration_type StrictStr

Workout step duration type.

duration_value StrictFloat | None

Workout step duration value.

target_type StrictStr | None

Workout step target type.

target_value StrictInt | None

Workout step target value.

intensity StrictStr | None

Workout step intensity type.

notes StrictStr | None

Workout step notes.

exercise_category StrictInt | None

Workout step exercise category.

exercise_name StrictInt | None

Exercise name ID.

exercise_weight StrictFloat | None

Workout step exercise weight.

weight_display_unit StrictStr | None

Workout step weight display unit.

secondary_target_value StrictStr | None

Workout step secondary target value.

Source code in backend/app/modules/activities/activity_workout_steps/schema.py
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
class ActivityWorkoutStepsBase(BaseModel):
    """Fields that describe one workout step.

    Attributes:
        message_index: Workout step message index.
        duration_type: Workout step duration type.
        duration_value: Workout step duration value.
        target_type: Workout step target type.
        target_value: Workout step target value.
        intensity: Workout step intensity type.
        notes: Workout step notes.
        exercise_category: Workout step exercise
            category.
        exercise_name: Exercise name ID.
        exercise_weight: Workout step exercise weight.
        weight_display_unit: Workout step weight
            display unit.
        secondary_target_value: Workout step secondary
            target value.
    """

    message_index: StrictInt
    duration_type: StrictStr
    duration_value: StrictFloat | None = Field(
        default=None,
        description="Duration of the step, in the unit its duration_type names (seconds, meters and so on)",
    )
    target_type: StrictStr | None = None
    target_value: StrictInt | None = Field(
        default=None,
        description="Target of the step, in the unit its target_type names (beats per minute, watts and so on)",
    )
    intensity: StrictStr | None = None
    notes: StrictStr | None = None
    exercise_category: StrictInt | None = None
    exercise_name: StrictInt | None = None
    exercise_weight: StrictFloat | None = Field(default=None, description="Weight of the exercise in kilograms")
    weight_display_unit: StrictStr | None = None
    secondary_target_value: StrictStr | None = None

    model_config = ConfigDict(
        from_attributes=True,
        extra="forbid",
    )

ActivityWorkoutStepsRead

Bases: ActivityWorkoutStepsBase

A stored workout step, as the API returns it.

Attributes:

Name Type Description
id UUID

Primary key.

activity_id UUID

FK to activities table.

Source code in backend/app/modules/activities/activity_workout_steps/schema.py
63
64
65
66
67
68
69
70
71
72
class ActivityWorkoutStepsRead(ActivityWorkoutStepsBase):
    """A stored workout step, as the API returns it.

    Attributes:
        id: Primary key.
        activity_id: FK to activities table.
    """

    id: uuid.UUID
    activity_id: uuid.UUID

Activity file import

Public parser-registry operations for activity files.

auto_lap_distance_km

auto_lap_distance_km(imperial)

Return the distance of an automatic lap in the athlete's units.

Parameters:

Name Type Description Default
imperial bool

Whether the athlete uses imperial units.

required

Returns:

Type Description
float

One mile in km for imperial athletes, 1 km otherwise.

Source code in backend/app/modules/activities/activity_file_import/integration_service.py
30
31
32
33
34
35
36
37
38
39
40
41
42
43
def auto_lap_distance_km(imperial: bool) -> float:
    """Return the distance of an automatic lap in the athlete's units.

    Args:
        imperial: Whether the athlete uses imperial units.

    Returns:
        One mile in km for imperial athletes, 1 km otherwise.
    """
    return (
        activity_file_import_parser_utils.KM_PER_MILE
        if imperial
        else activity_file_import_parser_utils.DEFAULT_LAP_DISTANCE_KM
    )

get_parser

get_parser(file_extension)

Return the parser registered for a file extension.

Parameters:

Name Type Description Default
file_extension str

The file extension, including the dot.

required

Returns:

Type Description
FileParser | None

The parser, or None when the extension is unsupported.

Source code in backend/app/modules/activities/activity_file_import/integration_service.py
 9
10
11
12
13
14
15
16
17
18
def get_parser(file_extension: str) -> FileParser | None:
    """Return the parser registered for a file extension.

    Args:
        file_extension: The file extension, including the dot.

    Returns:
        The parser, or None when the extension is unsupported.
    """
    return activity_file_import_parser_registry.get_parser(file_extension)

supported_extensions

supported_extensions()

Return the file extensions accepted by the parser registry.

Returns:

Type Description
tuple[str, ...]

The accepted extensions.

Source code in backend/app/modules/activities/activity_file_import/integration_service.py
21
22
23
24
25
26
27
def supported_extensions() -> tuple[str, ...]:
    """Return the file extensions accepted by the parser registry.

    Returns:
        The accepted extensions.
    """
    return activity_file_import_parser_registry.supported_extensions()