Skip to main content

PyGrab

PyGrab is a simple and performant Python library for making HTTP requests written in rust. It is designed to be fully interoperable with the popular requests package in Python.

References

Features

  • Simple: PyGrab's API is designed to be straightforward and easy to use. If you're familiar with requests, you'll feel right at home.
  • Flexible: Whether you need to make a simple GET request, post data to a server, or download a file, PyGrab has you covered.
  • Performant: With its Rust-powered backend, PyGrab offers enhanced performance for CPU-bound tasks, providing faster data decompression, thread handling, and network handling.
  • Asynchronous Support: PyGrab includes functions for making asynchronous HTTP requests, allowing you to efficiently grab data from multiple URLs at once.
  • JavaScript Support: PyGrab can render JavaScript-enabled websites, allowing you to grab data from dynamic web pages.
  • Interface with Tor Network: PyGrab includes built-in support for routing requests through the tor network.
  • Automated IP Rotation: PyGrab includes built-in support for rotating connections to the Tor Network.

Limitations

  • PyGrab is only supported on windows an linux currently.

Installation

You can install PyGrab using pip:

pip install pygrab

Usage

Here's a simple example of how to use PyGrab to make a GET request:

import pygrab

response = pygrab.get('http://example.com')
print(response.text)

In this example, response is syntactically similar to the requests.Response object. You can use it just like you would in requests.

Here's an example of how to use PyGrab to make asynchronous GET requests through the Tor Network:

import pygrab

pygrab.Tor.start_tor()

urls = ['http://example.com', 'http://example.org', 'http://example.net']
responses = pygrab.get_batch(urls)

for response in responses.values():
    print(response.text)

In this example, responses is a dictionary of urls matched to their respective pygrab.HttpResponse objects. Each response corresponds to the URL at the same index in the urls list.

We can also use pygrab with python's async/await syntax.

async def grab_data():
    res = await pygrab.get_async('https://www.google.com')
    return res

Contributing

Contributions are welcome. Please submit a pull request with any improvements.

Release files for pygrab 3.1.6

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

Source distribution (sdist)

Source distribution for pygrab 3.1.6
File Size Uploaded
pygrab-3.1.6.tar.gz 12.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pygrab 3.1.6
File Interpreter ABI Platform
pygrab-3.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 26.5 kB

Release files / pygrab-3.1.6.tar.gz

Download URL pygrab-3.1.6.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ed1857f99e8b92a5fa7d00233bc46169f12db1d42601950045917dfa1bcf1dd7
BLAKE2b-256 checksum
How to use checksums
231101a2168570d62eaa0c303329935fe5f171d980cac397f7b3e4ac43518b77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release files / pygrab-3.1.6-py3-none-any.whl

Download URL pygrab-3.1.6-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50e042d70826afb2bc2895e5afe2e270ef9163ed3e783e55de03f2ec162d5aa3
BLAKE2b-256 checksum
How to use checksums
ff02b699d548cfd3c1ac5fbff9f8c524bedbed3f1f2308b7d8fbe8c78cfc1954
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.20

Release history Release notifications | RSS feed

This release

3.1.6 This release

2 release files

3.1.4

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.6

2 release files

3.0.5

2 release files

3.0.4

2 release files

2.2.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.0.13

2 release files

2.0.12

2 release files

2.0.11

2 release files

2.0.10

2 release files

2.0.9

2 release files

2.0.8

2 release files

2.0.7

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

1.2.0

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

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