Skip to main content

A secure python library for fetching data with async 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.
  • Proxy Support: PyGrab includes built-in support for using proxy servers, including a function for setting your own proxies.

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-1.2.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

pygrab-1.2.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pygrab-1.2.0.tar.gz
Algorithm Hash digest
SHA256 920e35a87d1db2e03cdaac5109e461f8c619e3d49a72362f0b02ae22d50700b5
MD5 7761010618370afe0935eae3c23c17a4
BLAKE2b-256 6db676f8e8ab53f81256b21187bc30a38da5da8fcf0f454b8d24545b1f54760f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pygrab-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f441bf39a803fcfc6b249bbc41f7b9c93d2c283f929ade6f78ccc048fb1bbaf1
MD5 8f7514ca3f012cf1ea9e852fee3413ec
BLAKE2b-256 62fff76ad8965831acc28fd3c0bbadb8ce5b71c257553c610f1b0a3d9e019a77

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