downloads¶
Downloads domain.
- class OS[source]¶
Bases:
AuditBase,ContentManageableMixin,NameSlugMixin- __init__(**kwargs)¶
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created: Mapped[datetime]¶
- created_at: Mapped[datetime.datetime]¶
Date/time of instance creation.
- creator¶
- creator_id¶
- id: Mapped[UUID]¶
UUID Primary key column.
- last_modified_by¶
- last_modified_by_id¶
- name: Mapped[str]¶
- slug: Mapped[str]¶
- updated: Mapped[datetime]¶
- updated_at: Mapped[datetime.datetime]¶
Date/time of instance last update.
- class DownloadPageData[source]¶
Bases:
BaseModelSchema for download page template data.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class DownloadsPageController[source]¶
Bases:
ControllerController for download HTML pages.
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
- class OSController[source]¶
Bases:
ControllerController for OS CRUD operations.
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
- class OSCreate[source]¶
Bases:
OSBaseSchema for creating a new OS.
- model_config: ClassVar[ConfigDict] = {'json_schema_extra': {'example': {'name': 'macOS', 'slug': 'macos'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OSRead[source]¶
Bases:
OSBaseSchema for reading OS data.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'json_schema_extra': {'example': {'created_at': '2025-01-01T00:00:00Z', 'id': '550e8400-e29b-41d4-a716-446655440001', 'name': 'macOS', 'slug': 'macos', 'updated_at': '2025-01-01T00:00:00Z'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OSRepository[source]¶
Bases:
SQLAlchemyAsyncRepository[OS]Repository for OS database operations.
- class OSService[source]¶
Bases:
SQLAlchemyAsyncRepositoryService[OS, Any]Service for OS business logic.
- match_fields: ClassVar[Optional[Union[list[str], str]]] = ['slug']¶
List of dialects that prefer to use
field.id = ANY(:1)instead offield.id IN (...).
- repository_type¶
alias of
OSRepository
- class Release[source]¶
Bases:
AuditBase,ContentManageableMixin,NameSlugMixin- __init__(**kwargs)¶
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created: Mapped[datetime]¶
- created_at: Mapped[datetime.datetime]¶
Date/time of instance creation.
- creator¶
- creator_id¶
- id: Mapped[UUID]¶
UUID Primary key column.
- property is_eol: bool¶
Check if this release series has reached end of life.
- Returns:
True if status is EOL or eol_date has passed.
- property is_prerelease: bool¶
Check if this is a pre-release version (alpha, beta, RC).
- Returns:
True if status is prerelease or pre_release flag is set.
- last_modified_by¶
- last_modified_by_id¶
- property major_version: str¶
Extract major version string (e.g., ‘3’ from ‘3.12.1’).
- Returns:
Major version string or full name if parsing fails.
- property minor_version: str¶
Extract minor version string (e.g., ‘3.12’ from ‘3.12.1’).
- Returns:
Minor version string or full name if parsing fails.
- name: Mapped[str]¶
- slug: Mapped[str]¶
- updated: Mapped[datetime]¶
- updated_at: Mapped[datetime.datetime]¶
Date/time of instance last update.
- class ReleaseController[source]¶
Bases:
ControllerController for Release CRUD operations.
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
- class ReleaseCreate[source]¶
Bases:
ReleaseBaseSchema for creating a new release.
- model_config: ClassVar[ConfigDict] = {'json_schema_extra': {'example': {'content': 'Python 3.13.1 is the first maintenance release of Python 3.13...', 'eol_date': '2029-10-31', 'is_latest': True, 'is_published': True, 'name': 'Python 3.13.1', 'pre_release': False, 'release_date': '2025-01-15', 'release_notes_url': 'https://docs.python.org/release/3.13.1/whatsnew/changelog.html', 'release_page_id': '550e8400-e29b-41d4-a716-446655440100', 'show_on_download_page': True, 'slug': 'python-3131', 'status': 'bugfix', 'version': 'python3'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ReleaseDetailPageData[source]¶
Bases:
BaseModelSchema for release detail page template data.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ReleaseFile[source]¶
Bases:
AuditBase,ContentManageableMixin,NameSlugMixin- __init__(**kwargs)¶
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created: Mapped[datetime]¶
- created_at: Mapped[datetime.datetime]¶
Date/time of instance creation.
- creator¶
- creator_id¶
- id: Mapped[UUID]¶
UUID Primary key column.
- last_modified_by¶
- last_modified_by_id¶
- name: Mapped[str]¶
- slug: Mapped[str]¶
- updated: Mapped[datetime]¶
- updated_at: Mapped[datetime.datetime]¶
Date/time of instance last update.
- class ReleaseFileController[source]¶
Bases:
ControllerController for ReleaseFile CRUD operations.
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
- class ReleaseFileCreate[source]¶
Bases:
ReleaseFileBaseSchema for creating a new release file.
- model_config: ClassVar[ConfigDict] = {'json_schema_extra': {'example': {'description': 'macOS 64-bit universal2 installer', 'download_button': True, 'filesize': 45678901, 'is_source': False, 'md5_sum': 'abc123def456...', 'name': 'python-3.13.1-macos11.pkg', 'os_id': '550e8400-e29b-41d4-a716-446655440001', 'release_id': '550e8400-e29b-41d4-a716-446655440010', 'sha256_sum': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'slug': 'python-3131-macos11-pkg', 'url': 'https://www.python.org/ftp/python/3.13.1/python-3.13.1-macos11.pkg'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ReleaseFileRead[source]¶
Bases:
ReleaseFileBaseSchema for reading release file data.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'json_schema_extra': {'example': {'created_at': '2025-01-15T00:00:00Z', 'description': 'macOS 64-bit universal2 installer', 'download_button': True, 'filesize': 45678901, 'gpg_signature_file': '', 'id': '550e8400-e29b-41d4-a716-446655440020', 'is_source': False, 'md5_sum': 'abc123def456...', 'name': 'python-3.13.1-macos11.pkg', 'os_id': '550e8400-e29b-41d4-a716-446655440001', 'release_id': '550e8400-e29b-41d4-a716-446655440010', 'sbom_spdx2_file': '', 'sha256_sum': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'sigstore_bundle_file': '', 'sigstore_cert_file': '', 'sigstore_signature_file': '', 'slug': 'python-3131-macos11-pkg', 'updated_at': '2025-01-15T00:00:00Z', 'url': 'https://www.python.org/ftp/python/3.13.1/python-3.13.1-macos11.pkg'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ReleaseFileRepository[source]¶
Bases:
SQLAlchemyAsyncRepository[ReleaseFile]Repository for ReleaseFile database operations.
- async get_by_os_id(os_id, limit=100)[source]¶
Get all files for a specific OS.
- Parameters:
- Return type:
- Returns:
List of release files.
- async get_by_release_id(release_id)[source]¶
Get all files for a specific release.
- Parameters:
release_id (
UUID) – The release ID to search for.- Return type:
- Returns:
List of release files.
- async get_by_slug(slug)[source]¶
Get a release file by slug.
- Parameters:
slug (
str) – The slug to search for.- Return type:
- Returns:
The release file if found, None otherwise.
- async get_source_files(release_id)[source]¶
Get all source files for a release.
- Parameters:
release_id (
UUID) – The release ID to search for.- Return type:
- Returns:
List of source release files.
- model_type¶
alias of
ReleaseFile
- class ReleaseFileService[source]¶
Bases:
SQLAlchemyAsyncRepositoryService[ReleaseFile, Any]Service for ReleaseFile business logic.
- async get_by_os_id(os_id, limit=100)[source]¶
Get all files for a specific OS.
- Parameters:
- Return type:
- Returns:
List of release files.
- async get_by_release_id(release_id)[source]¶
Get all files for a specific release.
- Parameters:
release_id (
UUID) – The release ID to search for.- Return type:
- Returns:
List of release files.
- async get_by_slug(slug)[source]¶
Get a release file by slug.
- Parameters:
slug (
str) – The slug to search for.- Return type:
- Returns:
The release file if found, None otherwise.
- async get_download_button_file(release_id, os_id)[source]¶
Get the download button file for a release and OS.
- Parameters:
- Return type:
- Returns:
The release file marked as download button, None if not found.
- async get_source_files(release_id)[source]¶
Get all source files for a release.
- Parameters:
release_id (
UUID) – The release ID to search for.- Return type:
- Returns:
List of source release files.
- match_fields: ClassVar[Optional[Union[list[str], str]]] = ['slug']¶
List of dialects that prefer to use
field.id = ANY(:1)instead offield.id IN (...).
- repository_type¶
alias of
ReleaseFileRepository
- class ReleaseFileWithOS[source]¶
Bases:
ReleaseFileReadSchema for release file with OS information.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'json_schema_extra': {'example': {'created_at': '2025-01-15T00:00:00Z', 'description': 'macOS 64-bit universal2 installer', 'download_button': True, 'filesize': 45678901, 'id': '550e8400-e29b-41d4-a716-446655440020', 'is_source': False, 'md5_sum': 'abc123def456...', 'name': 'python-3.13.1-macos11.pkg', 'os': {'created_at': '2025-01-01T00:00:00Z', 'id': '550e8400-e29b-41d4-a716-446655440001', 'name': 'macOS', 'slug': 'macos', 'updated_at': '2025-01-01T00:00:00Z'}, 'os_id': '550e8400-e29b-41d4-a716-446655440001', 'release_id': '550e8400-e29b-41d4-a716-446655440010', 'slug': 'python-3131-macos11-pkg', 'updated_at': '2025-01-15T00:00:00Z', 'url': 'https://www.python.org/ftp/python/3.13.1/python-3.13.1-macos11.pkg'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ReleaseList[source]¶
Bases:
BaseModelSchema for release list items.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'json_schema_extra': {'example': {'eol_date': '2029-10-31', 'id': '550e8400-e29b-41d4-a716-446655440010', 'is_latest': True, 'is_published': True, 'name': 'Python 3.13.1', 'pre_release': False, 'release_date': '2025-01-15', 'slug': 'python-3131', 'status': 'bugfix', 'version': 'python3'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ReleaseRead[source]¶
Bases:
ReleaseBaseSchema for reading release data.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'json_schema_extra': {'example': {'content': 'Python 3.13.1 is the first maintenance release...', 'created_at': '2025-01-15T00:00:00Z', 'eol_date': '2029-10-31', 'id': '550e8400-e29b-41d4-a716-446655440010', 'is_latest': True, 'is_published': True, 'name': 'Python 3.13.1', 'pre_release': False, 'release_date': '2025-01-15', 'release_notes_url': 'https://docs.python.org/release/3.13.1/whatsnew/changelog.html', 'release_page_id': '550e8400-e29b-41d4-a716-446655440100', 'show_on_download_page': True, 'slug': 'python-3131', 'status': 'bugfix', 'updated_at': '2025-01-15T00:00:00Z', 'version': 'python3'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ReleaseRepository[source]¶
Bases:
SQLAlchemyAsyncRepository[Release]Repository for Release database operations.
- async get_by_version(version, limit=100)[source]¶
Get all releases for a specific Python version.
- Parameters:
version (
PythonVersion) – The Python version to filter by.limit (
int) – Maximum number of releases to return.
- Return type:
- Returns:
List of releases for the specified version.
- async get_latest(version=PythonVersion.PYTHON3)[source]¶
Get the latest stable release for a Python version.
- Parameters:
version (
PythonVersion) – The Python version to search for.- Return type:
- Returns:
The latest release if found, None otherwise.
- class ReleaseService[source]¶
Bases:
SQLAlchemyAsyncRepositoryService[Release, Any]Service for Release business logic.
- async get_by_version(version, limit=100)[source]¶
Get all releases for a specific Python version.
- Parameters:
version (
PythonVersion) – The Python version to filter by.limit (
int) – Maximum number of releases to return.
- Return type:
- Returns:
List of releases for the specified version.
- async get_files_grouped_by_os(release_id)[source]¶
Get release files grouped by OS slug.
- Parameters:
release_id (
UUID) – The release ID to get files for.- Return type:
dict[str,list[ReleaseFile]]- Returns:
Dictionary mapping OS slug to list of release files.
- async get_latest(version=PythonVersion.PYTHON3)[source]¶
Get the latest stable release for a Python version.
- Parameters:
version (
PythonVersion) – The Python version to search for.- Return type:
- Returns:
The latest release if found, None otherwise.
- async get_releases_grouped_by_minor_version(limit=500)[source]¶
Get releases grouped by major and then minor version.
Returns a nested dict structure:
{ "3": { "3.14": [releases...], "3.13": [releases...], ... }, "2": { "2.7": [releases...], } }
- async mark_as_latest(release_id, version)[source]¶
Mark a release as the latest for its Python version.
This will unmark any other releases as latest for the same version.
- Parameters:
release_id (
UUID) – The release ID to mark as latest.version (
PythonVersion) – The Python version.
- Return type:
- Returns:
The updated release instance.
- match_fields: ClassVar[Optional[Union[list[str], str]]] = ['slug']¶
List of dialects that prefer to use
field.id = ANY(:1)instead offield.id IN (...).
- repository_type¶
alias of
ReleaseRepository
- class ReleaseUpdate[source]¶
Bases:
BaseModelSchema for updating a release.
- model_config: ClassVar[ConfigDict] = {'json_schema_extra': {'example': {'content': 'Updated release notes for Python 3.13.1...', 'is_latest': True, 'is_published': True, 'status': 'bugfix'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
models¶
Downloads domain models.
- class OS[source]¶
Bases:
AuditBase,ContentManageableMixin,NameSlugMixin- __init__(**kwargs)¶
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created: Mapped[datetime]¶
- created_at: Mapped[datetime.datetime]¶
Date/time of instance creation.
- creator¶
- creator_id¶
- id: Mapped[UUID]¶
UUID Primary key column.
- last_modified_by¶
- last_modified_by_id¶
- name: Mapped[str]¶
- slug: Mapped[str]¶
- updated: Mapped[datetime]¶
- updated_at: Mapped[datetime.datetime]¶
Date/time of instance last update.
- class Release[source]¶
Bases:
AuditBase,ContentManageableMixin,NameSlugMixin- property minor_version: str¶
Extract minor version string (e.g., ‘3.12’ from ‘3.12.1’).
- Returns:
Minor version string or full name if parsing fails.
- property major_version: str¶
Extract major version string (e.g., ‘3’ from ‘3.12.1’).
- Returns:
Major version string or full name if parsing fails.
- property is_eol: bool¶
Check if this release series has reached end of life.
- Returns:
True if status is EOL or eol_date has passed.
- property is_prerelease: bool¶
Check if this is a pre-release version (alpha, beta, RC).
- Returns:
True if status is prerelease or pre_release flag is set.
- __init__(**kwargs)¶
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created: Mapped[datetime]¶
- created_at: Mapped[datetime.datetime]¶
Date/time of instance creation.
- creator¶
- creator_id¶
- id: Mapped[UUID]¶
UUID Primary key column.
- last_modified_by¶
- last_modified_by_id¶
- name: Mapped[str]¶
- slug: Mapped[str]¶
- updated: Mapped[datetime]¶
- updated_at: Mapped[datetime.datetime]¶
Date/time of instance last update.
- class ReleaseFile[source]¶
Bases:
AuditBase,ContentManageableMixin,NameSlugMixin- __init__(**kwargs)¶
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created: Mapped[datetime]¶
- created_at: Mapped[datetime.datetime]¶
Date/time of instance creation.
- creator¶
- creator_id¶
- id: Mapped[UUID]¶
UUID Primary key column.
- last_modified_by¶
- last_modified_by_id¶
- name: Mapped[str]¶
- slug: Mapped[str]¶
- updated: Mapped[datetime]¶
- updated_at: Mapped[datetime.datetime]¶
Date/time of instance last update.
- class DownloadStatistic[source]¶
Bases:
UUIDAuditBaseDaily download statistics for release files.
Stores aggregated download counts per file per day for analytics. Redis provides real-time counters; this table provides historical data.
- __init__(**kwargs)¶
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and values in
kwargs.Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.
- created_at: Mapped[datetime.datetime]¶
Date/time of instance creation.
- id: Mapped[UUID]¶
UUID Primary key column.
- updated_at: Mapped[datetime.datetime]¶
Date/time of instance last update.
schemas¶
Downloads domain Pydantic schemas.
- class OSBase[source]¶
Bases:
BaseModelBase OS schema with common fields.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OSCreate[source]¶
Bases:
OSBaseSchema for creating a new OS.
- model_config: ClassVar[ConfigDict] = {'json_schema_extra': {'example': {'name': 'macOS', 'slug': 'macos'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class OSRead[source]¶
Bases:
OSBaseSchema for reading OS data.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'json_schema_extra': {'example': {'created_at': '2025-01-01T00:00:00Z', 'id': '550e8400-e29b-41d4-a716-446655440001', 'name': 'macOS', 'slug': 'macos', 'updated_at': '2025-01-01T00:00:00Z'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ReleaseBase[source]¶
Bases:
BaseModelBase release schema with common fields.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ReleaseCreate[source]¶
Bases:
ReleaseBaseSchema for creating a new release.
- model_config: ClassVar[ConfigDict] = {'json_schema_extra': {'example': {'content': 'Python 3.13.1 is the first maintenance release of Python 3.13...', 'eol_date': '2029-10-31', 'is_latest': True, 'is_published': True, 'name': 'Python 3.13.1', 'pre_release': False, 'release_date': '2025-01-15', 'release_notes_url': 'https://docs.python.org/release/3.13.1/whatsnew/changelog.html', 'release_page_id': '550e8400-e29b-41d4-a716-446655440100', 'show_on_download_page': True, 'slug': 'python-3131', 'status': 'bugfix', 'version': 'python3'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ReleaseUpdate[source]¶
Bases:
BaseModelSchema for updating a release.
- model_config: ClassVar[ConfigDict] = {'json_schema_extra': {'example': {'content': 'Updated release notes for Python 3.13.1...', 'is_latest': True, 'is_published': True, 'status': 'bugfix'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ReleaseRead[source]¶
Bases:
ReleaseBaseSchema for reading release data.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'json_schema_extra': {'example': {'content': 'Python 3.13.1 is the first maintenance release...', 'created_at': '2025-01-15T00:00:00Z', 'eol_date': '2029-10-31', 'id': '550e8400-e29b-41d4-a716-446655440010', 'is_latest': True, 'is_published': True, 'name': 'Python 3.13.1', 'pre_release': False, 'release_date': '2025-01-15', 'release_notes_url': 'https://docs.python.org/release/3.13.1/whatsnew/changelog.html', 'release_page_id': '550e8400-e29b-41d4-a716-446655440100', 'show_on_download_page': True, 'slug': 'python-3131', 'status': 'bugfix', 'updated_at': '2025-01-15T00:00:00Z', 'version': 'python3'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ReleaseList[source]¶
Bases:
BaseModelSchema for release list items.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'json_schema_extra': {'example': {'eol_date': '2029-10-31', 'id': '550e8400-e29b-41d4-a716-446655440010', 'is_latest': True, 'is_published': True, 'name': 'Python 3.13.1', 'pre_release': False, 'release_date': '2025-01-15', 'slug': 'python-3131', 'status': 'bugfix', 'version': 'python3'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ReleaseFileBase[source]¶
Bases:
BaseModelBase release file schema with common fields.
- model_config: ClassVar[ConfigDict] = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ReleaseFileCreate[source]¶
Bases:
ReleaseFileBaseSchema for creating a new release file.
- model_config: ClassVar[ConfigDict] = {'json_schema_extra': {'example': {'description': 'macOS 64-bit universal2 installer', 'download_button': True, 'filesize': 45678901, 'is_source': False, 'md5_sum': 'abc123def456...', 'name': 'python-3.13.1-macos11.pkg', 'os_id': '550e8400-e29b-41d4-a716-446655440001', 'release_id': '550e8400-e29b-41d4-a716-446655440010', 'sha256_sum': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'slug': 'python-3131-macos11-pkg', 'url': 'https://www.python.org/ftp/python/3.13.1/python-3.13.1-macos11.pkg'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ReleaseFileRead[source]¶
Bases:
ReleaseFileBaseSchema for reading release file data.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'json_schema_extra': {'example': {'created_at': '2025-01-15T00:00:00Z', 'description': 'macOS 64-bit universal2 installer', 'download_button': True, 'filesize': 45678901, 'gpg_signature_file': '', 'id': '550e8400-e29b-41d4-a716-446655440020', 'is_source': False, 'md5_sum': 'abc123def456...', 'name': 'python-3.13.1-macos11.pkg', 'os_id': '550e8400-e29b-41d4-a716-446655440001', 'release_id': '550e8400-e29b-41d4-a716-446655440010', 'sbom_spdx2_file': '', 'sha256_sum': 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 'sigstore_bundle_file': '', 'sigstore_cert_file': '', 'sigstore_signature_file': '', 'slug': 'python-3131-macos11-pkg', 'updated_at': '2025-01-15T00:00:00Z', 'url': 'https://www.python.org/ftp/python/3.13.1/python-3.13.1-macos11.pkg'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class ReleaseFileWithOS[source]¶
Bases:
ReleaseFileReadSchema for release file with OS information.
- model_config: ClassVar[ConfigDict] = {'from_attributes': True, 'json_schema_extra': {'example': {'created_at': '2025-01-15T00:00:00Z', 'description': 'macOS 64-bit universal2 installer', 'download_button': True, 'filesize': 45678901, 'id': '550e8400-e29b-41d4-a716-446655440020', 'is_source': False, 'md5_sum': 'abc123def456...', 'name': 'python-3.13.1-macos11.pkg', 'os': {'created_at': '2025-01-01T00:00:00Z', 'id': '550e8400-e29b-41d4-a716-446655440001', 'name': 'macOS', 'slug': 'macos', 'updated_at': '2025-01-01T00:00:00Z'}, 'os_id': '550e8400-e29b-41d4-a716-446655440001', 'release_id': '550e8400-e29b-41d4-a716-446655440010', 'slug': 'python-3131-macos11-pkg', 'updated_at': '2025-01-15T00:00:00Z', 'url': 'https://www.python.org/ftp/python/3.13.1/python-3.13.1-macos11.pkg'}}}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
services¶
Downloads domain services for business logic.
- class OSService[source]¶
Bases:
SQLAlchemyAsyncRepositoryService[OS, Any]Service for OS business logic.
- repository_type¶
alias of
OSRepository
- match_fields: ClassVar[Optional[Union[list[str], str]]] = ['slug']¶
List of dialects that prefer to use
field.id = ANY(:1)instead offield.id IN (...).
- class ReleaseService[source]¶
Bases:
SQLAlchemyAsyncRepositoryService[Release, Any]Service for Release business logic.
- repository_type¶
alias of
ReleaseRepository
- match_fields: ClassVar[Optional[Union[list[str], str]]] = ['slug']¶
List of dialects that prefer to use
field.id = ANY(:1)instead offield.id IN (...).
- async get_latest(version=PythonVersion.PYTHON3)[source]¶
Get the latest stable release for a Python version.
- Parameters:
version (
PythonVersion) – The Python version to search for.- Return type:
- Returns:
The latest release if found, None otherwise.
- async get_by_version(version, limit=100)[source]¶
Get all releases for a specific Python version.
- Parameters:
version (
PythonVersion) – The Python version to filter by.limit (
int) – Maximum number of releases to return.
- Return type:
- Returns:
List of releases for the specified version.
- async get_files_grouped_by_os(release_id)[source]¶
Get release files grouped by OS slug.
- Parameters:
release_id (
UUID) – The release ID to get files for.- Return type:
dict[str,list[ReleaseFile]]- Returns:
Dictionary mapping OS slug to list of release files.
- async get_releases_grouped_by_minor_version(limit=500)[source]¶
Get releases grouped by major and then minor version.
Returns a nested dict structure:
{ "3": { "3.14": [releases...], "3.13": [releases...], ... }, "2": { "2.7": [releases...], } }
- async mark_as_latest(release_id, version)[source]¶
Mark a release as the latest for its Python version.
This will unmark any other releases as latest for the same version.
- Parameters:
release_id (
UUID) – The release ID to mark as latest.version (
PythonVersion) – The Python version.
- Return type:
- Returns:
The updated release instance.
- class ReleaseFileService[source]¶
Bases:
SQLAlchemyAsyncRepositoryService[ReleaseFile, Any]Service for ReleaseFile business logic.
- repository_type¶
alias of
ReleaseFileRepository
- match_fields: ClassVar[Optional[Union[list[str], str]]] = ['slug']¶
List of dialects that prefer to use
field.id = ANY(:1)instead offield.id IN (...).
- async get_by_release_id(release_id)[source]¶
Get all files for a specific release.
- Parameters:
release_id (
UUID) – The release ID to search for.- Return type:
- Returns:
List of release files.
- async get_by_os_id(os_id, limit=100)[source]¶
Get all files for a specific OS.
- Parameters:
- Return type:
- Returns:
List of release files.
- async get_by_slug(slug)[source]¶
Get a release file by slug.
- Parameters:
slug (
str) – The slug to search for.- Return type:
- Returns:
The release file if found, None otherwise.
controllers¶
Downloads domain API and page controllers.
- class OSController[source]¶
Bases:
ControllerController for OS CRUD operations.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
- class ReleaseController[source]¶
Bases:
ControllerController for Release CRUD operations.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
- class ReleaseFileController[source]¶
Bases:
ControllerController for ReleaseFile CRUD operations.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
- class DownloadsPageController[source]¶
Bases:
ControllerController for download HTML pages.
- path: str¶
A path fragment for the controller.
All route handlers under the controller will have the fragment appended to them. If not set it defaults to
/.
- include_in_schema: bool | EmptyType¶
A boolean flag dictating whether the route handler should be documented in the OpenAPI schema
- after_request: AfterRequestHookHandler | None¶
A sync or async function executed before a
Requestis passed to any route handler.If this function returns a value, the request will not reach the route handler, and instead this value will be used.
- after_response: AfterResponseHookHandler | None¶
A sync or async function called after the response has been awaited.
It receives the
Requestinstance and should not return any values.
- before_request: BeforeRequestHookHandler | None¶
A sync or async function called immediately before calling the route handler.
It receives the
Requestinstance and any non-Nonereturn value is used for the response, bypassing the route handler.
- cache_control: CacheControlHeader | None¶
A
CacheControlHeaderheader to add to route handlers of this controller.Can be overridden by route handlers.
- dependencies: Dependencies | None¶
A string keyed dictionary of dependency
Providerinstances.
- dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for (de)serializing and validation of request data.
- etag: ETag | None¶
An
etagheader of typeETagto add to route handlers of this controller.Can be overridden by route handlers.
- exception_handlers: ExceptionHandlersMap | None¶
A map of handler functions to status codes and/or exception types.
- guards: Sequence[Guard] | None¶
A sequence of
Guardcallables.
- middleware: Sequence[Middleware] | None¶
A sequence of
Middleware.
- opt: Mapping[str, Any] | None¶
A string key mapping of arbitrary values that can be accessed in
Guardsor wherever you have access toRequestorASGI Scope.
- owner: Router¶
The
RouterorLitestarapp that owns the controller.This value is set internally by Litestar and it should not be set when subclassing the controller.
- parameters: ParametersMap | None¶
A mapping of
Parameterdefinitions available to all application paths.
- request_class: type[Request] | None¶
A custom subclass of
Requestto be used as the default request for all route handlers under the controller.
- request_max_body_size: int | None | EmptyType¶
Maximum allowed size of the request body in bytes. If this size is exceeded, a ‘413 - Request Entity Too Large’ error response is returned.
- response_class: type[Response] | None¶
A custom subclass of
Responseto be used as the default response for all route handlers under the controller.
- response_cookies: ResponseCookies | None¶
A list of
Cookieinstances.
- response_headers: ResponseHeaders | None¶
A string keyed dictionary mapping
ResponseHeaderinstances.
- return_dto: type[AbstractDTO] | None | EmptyType¶
AbstractDTOto use for serializing outbound response data.
- security: Sequence[SecurityRequirement] | None¶
A sequence of dictionaries that to the schema of all route handlers under the controller.
- signature_namespace: dict[str, Any]¶
A mapping of names to types for use in forward reference resolution during signature modelling.
- signature_types: Sequence[Any]¶
A sequence of types for use in forward reference resolution during signature modelling.
These types will be added to the signature namespace using their
__name__attribute.
- tags: Sequence[str] | None¶
A sequence of string tags that will be appended to the schema of all route handlers under the controller.
- type_decoders: TypeDecodersSequence | None¶
A sequence of tuples, each composed of a predicate testing for type identity and a msgspec hook for deserialization.
- type_encoders: TypeEncodersMap | None¶
A mapping of types to callables that transform them into types supported for serialization.
- websocket_class: type[WebSocket] | None¶
A custom subclass of
WebSocketto be used as the default websocket for all route handlers under the controller.
repositories¶
Downloads domain repositories for database access.
- class OSRepository[source]¶
Bases:
SQLAlchemyAsyncRepository[OS]Repository for OS database operations.
- class ReleaseRepository[source]¶
Bases:
SQLAlchemyAsyncRepository[Release]Repository for Release database operations.
- async get_latest(version=PythonVersion.PYTHON3)[source]¶
Get the latest stable release for a Python version.
- Parameters:
version (
PythonVersion) – The Python version to search for.- Return type:
- Returns:
The latest release if found, None otherwise.
- async get_by_version(version, limit=100)[source]¶
Get all releases for a specific Python version.
- Parameters:
version (
PythonVersion) – The Python version to filter by.limit (
int) – Maximum number of releases to return.
- Return type:
- Returns:
List of releases for the specified version.
- class ReleaseFileRepository[source]¶
Bases:
SQLAlchemyAsyncRepository[ReleaseFile]Repository for ReleaseFile database operations.
- model_type¶
alias of
ReleaseFile
- async get_by_release_id(release_id)[source]¶
Get all files for a specific release.
- Parameters:
release_id (
UUID) – The release ID to search for.- Return type:
- Returns:
List of release files.
- async get_by_os_id(os_id, limit=100)[source]¶
Get all files for a specific OS.
- Parameters:
- Return type:
- Returns:
List of release files.
- async get_by_slug(slug)[source]¶
Get a release file by slug.
- Parameters:
slug (
str) – The slug to search for.- Return type:
- Returns:
The release file if found, None otherwise.