Python wrapper for Chromium's http library
Project description
python-cronet
python-cronet
is a library to use Chromium's network stack from Python.
The library is currently in alpha stage.
What is Cronet
Cronet is the networking stack of Chromium put into a library for use on Android. It offers an easy-to-use, high performance, standards-compliant, and secure way to perform HTTP requests.
The Chromium team also provides a native version of the library(not officially supported) which allows you to use it in desktop/server operating systems like Linux, macOS and Windows.
The main benefits of using cronet as an HTTP client are:
- You get to use the same high quality code that runs on Chromium.
- Support for the latest protocols like QUIC and compression formats.
- Concurrency support by performing asynchronous requests.
- Has the same TLS fingerprint as Chrome, meaning that Cloudflare and other bot detection systems can't block your requests based on it.
- It's much more lightweight on system resources compared to headless Chrome(although it doesn't support executing javascript).
Example usage
The library provides a synchronous and an asynchronous API:
Installation
For the time being the only supported platform is linux-x86-64. The plan is to also support windows and macOS.
pip install python-cronet
Synchronous example
import cronet
with cronet.Cronet() as cr:
response = cr.request("GET", "https://example.com")
Async example
import cronet
async def main():
with cronet.AsyncCronet() as cr:
response = await cr.request("GET", "https://example.com")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for python_cronet-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dde47396a0fbd27ef06e0f1e9ec4dd6c03623769cff8e4e5a938134f9ea6f54f |
|
MD5 | 908a70fa4bdbbb0db2430af0f5988c81 |
|
BLAKE2b-256 | c5183995ef105a5b3fda11821dfd67f51b0529429aaf6e3d76fc2f7d3f511a92 |
Hashes for python_cronet-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f76d6b9b506e5ca41cf77dfc00f6516f4395aaa52053f19145e2bc3860358f5 |
|
MD5 | d1b7b2625f09e921f85ab23738810db0 |
|
BLAKE2b-256 | 310ac99fe37eef77ecaaa86ea6c55d2d2623c03ad6affb216236bb1663ec3eb7 |
Hashes for python_cronet-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aeb3334a3c02ff3b0507358c38918ac5869263237928e8799d17ca58b50a3560 |
|
MD5 | be2cee07b088576500c33a772dea6362 |
|
BLAKE2b-256 | e47347de91ef9d6e6b47246696de63d004afe5063346859966f4beaa0a70f561 |
Hashes for python_cronet-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c05d85d562dbd32e05bc9953cf52aac1637d5cd9346b00a66aafee29f761203 |
|
MD5 | dbc05c3ff2d16d798154279c849b1c1c |
|
BLAKE2b-256 | 7c38b79166b08c343a2fa69602906b720227edc3f6903f1d74dce113c57d0304 |
Hashes for python_cronet-0.1.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d1eafbf4b65981761bb90ebdebc7e87ca4c8f473cb2051b09a9f0ca3b6ed2a5 |
|
MD5 | 5a69a61cf13d8e793c2d7df0e9e10455 |
|
BLAKE2b-256 | 4b243a270a790d7423235bf063e850cda9abb49f54f78e67656b97b775a46faf |