Skip to main content

A secure python library for fetching data with async, JS, and Tor support

Project description

PyGrab

PyGrab is a Python library for making HTTP requests. It is designed to be fully interoperable with the popular requests package in Python. All functions in PyGrab that make HTTP requests return requests.Response objects, making it easy to integrate into existing projects that use requests.

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.
  • 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.

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 a 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:

import pygrab

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

for response in responses:
    print(response.text)

In this example, responses is a list of requests.Response objects. Each response corresponds to the URL at the same index in the urls list.

Contributing

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pygrab-2.0.6.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

pygrab-2.0.6-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file pygrab-2.0.6.tar.gz.

File metadata

  • Download URL: pygrab-2.0.6.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pygrab-2.0.6.tar.gz
Algorithm Hash digest
SHA256 d8226d7e17edafd36ca64688769b6275ccee5bd879ba8a123bd1d6a693f24aae
MD5 4bc2b47dd5b0ec2737c823fb4894b399
BLAKE2b-256 3648344fb4fd8d37853aa7cea6b55e610d4701b5fd1ac2f9b244b8eca257c2b0

See more details on using hashes here.

File details

Details for the file pygrab-2.0.6-py3-none-any.whl.

File metadata

  • Download URL: pygrab-2.0.6-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pygrab-2.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e5231a986d009c8200c04d31cd0532b2fe0386d8d0644d881b4892b441097d64
MD5 3db9c1a9e235f8a06bcf1390995c1acd
BLAKE2b-256 fa19a90d5d5e0b7705bd70a7e35ed35a93420948278cf99e1ee2e6147e83b134

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page