Summary
Currently, Literal type parameters that map directly to API query parameters use camelCase values, matching the API convention. For example:
sort_by: Literal['createdAt', 'stats.lastRunStartedAt'] | None = 'createdAt'
ownership: Literal['ownedByMe', 'sharedWithMe'] | None = None
This works, but it's not idiomatic Python — users would expect snake_case values in the Python interface.
Proposal
Introduce a conversion mechanism that allows snake_case values in the Python-facing API and converts them to camelCase before sending to the Apify API. For example:
# Python interface
ownership: Literal['owned_by_me', 'shared_with_me'] | None = None
# Converted to `ownedByMe` / `sharedWithMe` in the HTTP request
Context
This was identified during the review of #696 — see this comment.
Should be considered before v3.
Summary
Currently,
Literaltype parameters that map directly to API query parameters usecamelCasevalues, matching the API convention. For example:This works, but it's not idiomatic Python — users would expect
snake_casevalues in the Python interface.Proposal
Introduce a conversion mechanism that allows
snake_casevalues in the Python-facing API and converts them tocamelCasebefore sending to the Apify API. For example:Context
This was identified during the review of #696 — see this comment.
Should be considered before v3.