Module python_odpt.types

Contains some shared types for properties

Classes

class File (payload: ,
file_name: str | None = None,
mime_type: str | None = None)

Contains information for file uploads

Method generated by attrs for class File.

Expand source code
@define
class File:
    """Contains information for file uploads"""

    payload: BinaryIO
    file_name: Optional[str] = None
    mime_type: Optional[str] = None

    def to_tuple(self) -> FileJsonType:
        """Return a tuple representation that httpx will accept for multipart/form-data"""
        return self.file_name, self.payload, self.mime_type

Instance variables

var file_name : str | None
var mime_type : str | None
var payload

Methods

def to_tuple(self) ‑> Tuple[str | None, BinaryIO, str | None]

Return a tuple representation that httpx will accept for multipart/form-data

class Response (status_code: http.HTTPStatus,
content: bytes,
headers: MutableMapping[str, str],
parsed: ~T | None)

A response from an endpoint

Method generated by attrs for class Response.

Expand source code
@define
class Response(Generic[T]):
    """A response from an endpoint"""

    status_code: HTTPStatus
    content: bytes
    headers: MutableMapping[str, str]
    parsed: Optional[T]

Ancestors

  • typing.Generic

Instance variables

var content : bytes
var headers : MutableMapping[str, str]
var parsed : ~T | None
var status_code : http.HTTPStatus
class Unset
Expand source code
class Unset:
    def __bool__(self) -> Literal[False]:
        return False