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_handleis called prior to connection with a singlekonnect.curl.abc.ConfigHandleobject as an argument. This object can be used to configure the request in a manner familiar to users of libcurl, by calling thekonnect.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
UpdateHandlermethodshas_update&get_updateare called continuously throughout the transfer. The latter, if it returns anything, interrupts the transfer and returns the value fromkonnect.curl.Multi.process(). The user would normally then continue the transfer by callingkonnect.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 transferhas_updatecan simply returnFalseevery time it is called. -
completedis called after the transfer is finished, with akonnect.curl.abc.GetInfoHandleobject that may be used to examine information about the transfer in a way familiar to libcurl users, with it'skonnect.curl.abc.GetInfoHandle.getinfo()andkonnect.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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| konnect_curl-0.3.0.tar.gz | 36.1 kB | Without provenance | Details for konnect_curl-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| konnect_curl-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for konnect_curl-0.3.0-py3-none-any.whl |
Total release size: 65.9 kB
Release files / konnect_curl-0.3.0.tar.gz
| Download URL | konnect_curl-0.3.0.tar.gz |
|---|---|
| Size | 36.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5aa3d855ee33518b6062ce3d795759e28fd6459c2fbf70b6620bca4ebb2059e2
|
|
BLAKE2b-256 checksum How to use checksums |
3ecf8b35712902cc19845b14410f5991eb42f590ab5fa85be2cda410d6cabb41
|
| 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.0-py3-none-any.whl
| Download URL | konnect_curl-0.3.0-py3-none-any.whl |
|---|---|
| Size | 29.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
18e0ef22f7455dc4724a8d39f1ac1db97df685508369d1b462183e6034483aa3
|
|
BLAKE2b-256 checksum How to use checksums |
0e04cd53a88ed1b21cc795fc22b5b816d195a45212fdfda78c72d70dee079f09
|
| 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.0
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.