Skip to main content

Overview

This module wraps around the get method for the python requests library.

I'm only using it to download files for now.

The reason for this package is for me to reuse it across all my projects.

I'll likely build upon it in the future.

Prerequisites:

  • Python 2.7+

Installation

  • From pypi: pip3 install btweb
  • From this git repo: pip3 install git+https://github.com/berttejeda/bert.webadapter.git
    Note: To install a specific version of the library from this git repo,
    suffix the git URL in the above command with @{ tag name }, e.g.:
    git+https://github.com/berttejeda/bert.webadapter.git@0.0.1

Usage Examples

Download a file from a URL using Basic HTTP Authentication

from btweb import WebAdapter

webadapter = WebAdapter()
res = webadapter.get(url, 
  username=username,
  password=password)

Download a file from a URL using Basic HTTP Authentication, caching the result for 30 minutes

from btweb import WebAdapter

webadapter = WebAdapter()
res = webadapter.get(url, 
  username=username,
  password=password,        
  cache=True,
  cache_path='.',
  cache_time=30)

Keyword Args

Keyword                                      | Type                    | Possible Values        | Effect                           | Example
-------------------------------------------- | ----------------------- | --------------------------------------------------------------
fail_on_errors                               | bool                    | [True, False]          | Raise an error instead           | webadapter = WebAdapter(fail_on_errors=True)
                                                                       |                        | of ignoring and                  |
                                                                       |                        | returning 'None' or empty string |

Release files for btweb 0.1.2

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

Source distribution (sdist)

Source distribution for btweb 0.1.2
File Size Uploaded
btweb-0.1.2.tar.gz 5.6 kB Details

Built distribution (wheel)

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

Total release size: 9.4 kB

Release files / btweb-0.1.2.tar.gz

Download URL btweb-0.1.2.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
008ff3ce308d835ccc5aed562c58e727b04a5c66f202dda8d7db6c61f144d029
BLAKE2b-256 checksum
How to use checksums
fc4c430ca6efd481e8329155f4ff4d4a36bd4929d79c92674a20a894caa0c492
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release files / btweb-0.1.2-py3-none-any.whl

Download URL btweb-0.1.2-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66469df04407de2be37539e3b76a8ef2253ab2b7e058fe02605455aae18be2c8
BLAKE2b-256 checksum
How to use checksums
ef644182e8ca4968a8a23c9403297b2f8e02192cf4da15256c7fd6971c508554
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.12

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.6

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