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.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4bac82c7d710ae2ee653fd929fb2cab6ed2713842502d8fadac0f94afde5b476 |
|
MD5 | 2b5dffa34767e149cebf33e3229cb020 |
|
BLAKE2b-256 | 30d6a461c6318e7aa9a9bd46a0435b41cab154d1c18b6e7284bdc0de7c3e9769 |
Hashes for python_cronet-0.1.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cac8e8f1e534a9f6c4e0733db5ab0f4daa3177acfcbd8f73a466e0dc02652b7 |
|
MD5 | bafa4d0c8f561cfcd2ccc8d545bc7724 |
|
BLAKE2b-256 | a2a7fc9c1b6044c573dbe2b3c24940edb240cd7454f17877136d998eaf759d30 |
Hashes for python_cronet-0.1.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd8bb650a9e15c01964b8af531c205587e9968880d7fcb35a844e54b4e542030 |
|
MD5 | 639e8ad68db05ca433ed903efd6f23e9 |
|
BLAKE2b-256 | 634d416a3bd5bcc0fd1524e961ccbf32229d779d03810c156441d4df1dbb7ebb |
Hashes for python_cronet-0.1.1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9bcd20a53c1d3bfcae558eaee6659e3e314f2e6aa139cabb271e9b13b6f2589 |
|
MD5 | 10f0bbd91624aea4b96e32ba38e980d4 |
|
BLAKE2b-256 | e19074e1da9fd0b62dba79bc4329b89059e56366ca468ed150b7b8c793ed0ba1 |
Hashes for python_cronet-0.1.1-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56ca83a776014fdbb54e35ac869dab460c58d155f7ba72179eef34024a07b447 |
|
MD5 | 5b7e56fde7e32c67c8c03375ec0bcce7 |
|
BLAKE2b-256 | d5e4043e5fb291ed8034ca1988ed28a0b70b18f100a9dfce1d73ca92ce67bfbb |