Skip to main content

Make HTTP/HTTPS requests with cache, cookie, and redirect support

Project description

READ ME

Dogbutler is a client library base on requests but with a cache and persistent cookie support.

INSTALLATION

>>> pip install dogbutler

USAGE

DogButler supports GET, HEAD, POST, PATCH, PUT, DELETE, and OPTIONS requests.

>>> import dogbutler
>>> r = dogbutler.get('http://www.google.com', headers={'a': 'antelope'}, cookies={'a': 'apple'})
>>> r.status_code
200
>>> r.content

Sessions

A session has its own cache, cookie jar, and redirect history.

>>> from dogbutler import Session
>>> s = Session()
>>> r = s.get('http://www.google.com', headers={'a': 'antelope'}, cookies={'a': 'apple'})
>>> r.status_code
200
>>> r.content

Async

Note: Only GET requests can be called asynchronously at the moment.

Each request is a tuple of (url, kwargs), where kwargs can contain optional arguments such as headers and cookies.

>>> from dogbutler import async
>>> request1 = ('http://www.google.com', {'headers': {'a': 'antelope'}, 'cookies': {'a': 'apple'}})
>>> request2 = ('http://www.apple.com', {'headers': {'b': 'bear'}, 'cookies': {'b': 'banana'}})
>>> response1, response2 = async.get([request1, request2])
>>> response1.status_code
200
>>> response2.status_code
200

CHANGE LOG

Version 0.0.4

  • Ignore cache if no-cache is defined in request header.

  • Fix minor bugs.

Version 0.0.3

  • Support Sessions.

  • Not cache hop-by-hop headers.

Version 0.0.2

  • Set default cache, cookie cache, and redirect cache backends.

  • Disable cache, cookie cache, and redirect cache by setting each to None.

Version 0.0.1

  • Initial release.

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

dogbutler-0.0.4.tar.gz (19.3 kB view details)

Uploaded Source

File details

Details for the file dogbutler-0.0.4.tar.gz.

File metadata

  • Download URL: dogbutler-0.0.4.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dogbutler-0.0.4.tar.gz
Algorithm Hash digest
SHA256 0920f93cd592dd50a5153cc4d09f03794b4ff581ae0780fe6d82ec2fa7350d9c
MD5 2ed7e74e7be76ac3e5d0bfdfd8973daa
BLAKE2b-256 cab0632b77c04686771b8291935607aa8ca97435e082b54a364c30221e444cc3

See more details on using hashes here.

Supported by

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