Types
- yadisk.types.AnyClient
-
alias of
Client|AsyncClient
- yadisk.types.AnyResponse
-
alias of
Response|AsyncResponse
- yadisk.types.AsyncConsumeCallback
Callback function (may be asynchronous) that is invoked to consume the streamed HTTP response body
alias of
Callable[[bytes],None] |Callable[[bytes],Awaitable[None]]
- class yadisk.types.AsyncFileLike(*args, **kwargs)[source]
Bases:
ProtocolThis protocol describes the bare minimum set of required methods for an async file-like object (open in either binary or unicode mode).
- async read(size: int = Ellipsis, /) str | bytes[source]
Reads size bytes or characters.
- Parameters:
size – int, number of bytes/characters to read from the file
- Returns:
data that was read from the file
- async seek(pos: int, whence: int = Ellipsis, /) int[source]
Performs a seek operation on a file.
- Parameters:
pos – int, position to seek to
whence – int, 0 (seek absolute position), 1 (seek relative to current position) or 2 (seek to file’s end)
- Returns:
int, absolute position within the file after the seek operation
- yadisk.types.AsyncFileOrPath
This is used to specify a source file to upload (async variant)
alias of
str|bytes|BinaryIO|AsyncFileLike|Callable[[],AsyncIterator[bytes]]
- yadisk.types.AsyncFileOrPathDestination
This is used to specify a destination file to download into (async variant)
alias of
str|bytes|BinaryIO|BinaryAsyncFileLike
- yadisk.types.AsyncOpenFileCallback
Function that is used for opening local files (async variant)
alias of
Callable[[str|bytes,Literal[‘rb’] |Literal[‘wb’]],Awaitable[BinaryAsyncFileLike]] |Callable[[str|bytes,Literal[‘rb’] |Literal[‘wb’]],Awaitable[BinaryIO]]
- yadisk.types.AsyncPayload
Request payload - data to be uploaded (async variant)
alias of
bytes|Iterator[bytes] |AsyncIterator[bytes] |BinaryIO|BinaryAsyncFileLike
- yadisk.types.AsyncSessionFactory
Function that returns an instance of
AsyncSessionalias of
Callable[[], AsyncSession]
- yadisk.types.AsyncSessionName
Valid asynchronous session name (see Available Session Implementations)
- class yadisk.types.AvailableUntilVerbose[source]
Bases:
TypedDictVerbose information about the expiration date of a shared resource.
- Variables:
enabled – bool, whether the expiration date is enabled
value – int, timestamp indicating the expiration date
- class yadisk.types.BinaryAsyncFileLike(*args, **kwargs)[source]
Bases:
ProtocolThis protocol describes the bare minimum set of required methods for an async file-like object open in binary mode.
- async read(size: int = Ellipsis, /) bytes[source]
Reads size bytes.
- Parameters:
size – int, number of bytes/characters to read from the file
- Returns:
data that was read from the file
- async seek(pos: int, whence: int = Ellipsis, /) int[source]
Performs a seek operation on a file.
- Parameters:
pos – int, position to seek to
whence – int, 0 (seek absolute position), 1 (seek relative to current position) or 2 (seek to file’s end)
- Returns:
int, absolute position within the file after the seek operation
- yadisk.types.ConsumeCallback
Callback function that is invoked to consume the streamed HTTP response body
- class yadisk.types.ExternalOrganizationIdVerbose[source]
Bases:
TypedDictVerbose information about the external organization ID of a shared resource.
- Variables:
enabled – bool, whether the external organization ID is enabled
value – str, external organization ID
- yadisk.types.FileOpenMode
File mode for
OpenFileCallbackandAsyncOpenFileCallback
- yadisk.types.FileOrPath
This is used to specify a source file to upload
alias of
str|bytes|BinaryIO|Callable[[],Iterator[bytes]]
- yadisk.types.FileOrPathDestination
This is used to specify a destination file to download into
- yadisk.types.HTTPMethod
HTTP request method
alias of
Literal[‘GET’] |Literal[‘POST’] |Literal[‘PUT’] |Literal[‘PATCH’] |Literal[‘DELETE’] |Literal[‘OPTIONS’] |Literal[‘HEAD’] |Literal[‘CONNECT’] |Literal[‘TRACE’]
- yadisk.types.OpenFileCallback
Function that is used for opening local files (like
open)alias of
Callable[[str|bytes,Literal[‘rb’] |Literal[‘wb’]],BinaryIO]
- yadisk.types.OperationStatus
Yandex.Disk’s asynchronous operation status
alias of
Literal[‘in-progress’] |Literal[‘success’] |Literal[‘failed’]
- class yadisk.types.PasswordVerbose[source]
Bases:
TypedDictVerbose information about the password of a shared resource.
- Variables:
enabled – bool, whether the password is enabled
value – str, password to access the resource
- yadisk.types.Payload
Request payload - data to be uploaded
- class yadisk.types.PublicSettings[source]
Bases:
TypedDictPublic settings of a shared resource. This type describes the input for requests that modify public settings. For the related response object, see
PublicSettingsObject.- Variables:
available_until – int, timestamp indicating the expiration date of the link
read_only – bool, whether the resource is read-only
available_until_verbose –
AvailableUntilVerbose, verbose information about the expiration datepassword – str, password to access the resource
password_verbose –
PasswordVerbose, verbose information about the passwordexternal_organization_id – str, external organization ID
external_organization_id_verbose –
ExternalOrganizationIdVerbose, verbose information about the external organization IDaccesses – List[PublicSettingsAccess], list of access settings
Note
It appears that passing
available_untilas an empty string disables the expiration date. Similarly, password can be disabled by passingFalseor0. This is not officially documented, though.
- class yadisk.types.PublicSettingsAccess[source]
Bases:
TypedDictAccess settings of a shared resource.
- Variables:
macros – List[Union[Literal[“employees”], Literal[“all”]]],, specifies who has access to the shared resource, must contain only one element
org_id – int, organization ID
user_ids – List[str], list of user IDs
group_ids – List[int], list of group IDs
department_ids – List[int], list of department IDs
rights – list[str], list of access rights
Valid access rights:
write: write access
read: read access
read_without_download: read access without download
read_with_password: read access with password
read_with_password_without_download: read access with password and without download
- yadisk.types.SessionFactory
Function that returns an instance of
Sessionalias of
Callable[[], Session]
- yadisk.types.SessionName
Valid session name (see Available Session Implementations)
alias of
Literal[‘httpx’] |Literal[‘pycurl’] |Literal[‘requests’]
- yadisk.types.TimeoutParameter
Request timeout (in seconds). Can be a single number, None or a tuple. If the timeout is specified as a tuple, then the first value is the connect timeout, and the second value is the read timeout. Otherwise, both connect and read timeouts are set to the same value. A value of None means no timeout. If the timeout’s value is
..., the default timeout is used (eithersettings.DEFAULT_TIMEOUTorsettings.DEFAULT_UPLOAD_TIMEOUT)