Skip to main content

gitlab-ico github-ico docs-ico

licence-mpl20 pre-commit-ico

Konnect

Konnect is a project to make the power of the libcurl multi feature available through a Pythonic interface. It consists of this core package (konnect.curl) through which any protocol provided by libcurl can be accessed and some additional packages (e.g. konnect.http) which provide enhanced interfaces for specific protocols.

Basic Usage

Users must first create a class that implements the konnect.curl.abc.Request interface; the methods of this protocol are essentially hooks that are called at certain points in a transfer. The transfer commences when an instance of the request class is passed to konnect.curl.Multi.process() and the returned awaitable is awaited:

  • configure_handle is called prior to connection with a single konnect.curl.abc.ConfigHandle object as an argument. This object can be used to configure the request in a manner familiar to users of libcurl, by calling the konnect.curl.abc.ConfigHandle.setopt() method of the object. In particular users should configure libcurl callbacks to handle various additional events specific to the desired protocol.

  • The UpdateHandler methods has_update & get_update are called continuously throughout the transfer. The latter, if it returns anything, interrupts the transfer and returns the value from konnect.curl.Multi.process(). The user would normally then continue the transfer by calling konnect.curl.Multi.process() again with the same multi and request objects. It is up to the user to recognise when the return is an interim response or a final response, normally by checking the type of the response. If the implementation has nothing to return during the transfer has_update can simply return False every time it is called.

  • completed is called after the transfer is finished, with a konnect.curl.abc.GetInfoHandle object that may be used to examine information about the transfer in a way familiar to libcurl users, with it's konnect.curl.abc.GetInfoHandle.getinfo() and konnect.curl.abc.GetInfoHandle.getinfo_raw() methods.

Instances of konnect.curl.Multi are shareable within a thread and although it is possible to use multiple instances it is recommended for performance and resource usage reasons to use only one.

Streams

Streams can be created with the Multi methods Multi.get_send_stream() and Multi.get_receive_stream(). The streams implement the interfaces for byte streams in anyio: anyio.abc.ByteSendStream and anyio.abc.ByteReceiveStream respectively. When their respective send() and receive() methods are awaited they run the same procedures as Multi.process() to progress the transfer.

Streams SHOULD be used as async context managers to ensure they are closed. They MUST be closed for transfers to continue after the main body has been transferred.

Metadata

Release files for konnect.curl 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for konnect.curl 0.3.1
File Size Uploaded Provenance Actions
konnect_curl-0.3.1.tar.gz 36.1 kB Without provenance Details for konnect_curl-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for konnect.curl 0.3.1
File Interpreter ABI Platform Actions
konnect_curl-0.3.1-py3-none-any.whl Python 3 none any Details for konnect_curl-0.3.1-py3-none-any.whl

Total release size: 65.9 kB

Release files / konnect_curl-0.3.1.tar.gz

Download URL konnect_curl-0.3.1.tar.gz
Size 36.1 kB
Tags Source
SHA-256 checksum
How to use checksums
54c94e3cede3c8cc074ef78564a6aa63e5e3c39a2308f06aa4ecab7b7ccbdcdb
BLAKE2b-256 checksum
How to use checksums
7c90676890976298be48b7051d017dfbf6ca2bc0d2f7d1c12efa9081c6a0225b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.6

Release files / konnect_curl-0.3.1-py3-none-any.whl

Download URL konnect_curl-0.3.1-py3-none-any.whl
Size 29.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b746333f9af93a574f522ff07e5f964b74c784bc16787333bccbd7e3194fd557
BLAKE2b-256 checksum
How to use checksums
df5e335cf1a0b529795c2ef5cad14b55b743c1faee92f40d93ee279cbe205f58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.6

Security for konnect.curl 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page