Skip to main content

requestr

Project description

requestr

A wrapper library for requests, optimised for JSON and HTML

Installation: pip install requestr

import requestr

url = 'https://jsonplaceholder.typicode.com/posts/1'

response = requests.get(url)
>>> response.data
{
  'userId': 1,
  'id': 1,
  'title': 'sunt aut facere repellat provident occaecati excepturi optio reprehenderit',
  'body': 'quia et suscipit...'
}
>>> response.data.title
'sunt aut facere repellat provident occaecati excepturi optio reprehenderit'
import requestr

url = 'https://example.com'

response = requests.get(url)

h1_tag = response.soup.select_one('h1')
>>> h1_tag.text
'Example domain'
from requestr import Session

session = Session()

url = 'https://jsonplaceholder.typicode.com/posts/1'

response = session.get(url)
>>> response.data
{
  'userId': 1,
  'id': 1,
  'title': 'sunt aut facere repellat provident occaecati excepturi optio reprehenderit',
  'body': 'quia et suscipit...'
}
>>> response.data.id
1

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

python-requestr-0.11.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file python-requestr-0.11.tar.gz.

File metadata

  • Download URL: python-requestr-0.11.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for python-requestr-0.11.tar.gz
Algorithm Hash digest
SHA256 e74aef14e4f33e0fc4999fe5139df7211e53a7af3014281ac8d274f0aefc6751
MD5 b3b245324262438e21db822f2bfc9bac
BLAKE2b-256 251338907729852d3a64cb9eeaabd776cc21d9e26bead34b3bcfda172609a126

See more details on using hashes here.

Supported by

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