Requests package with QOL improvements and anti-bot detection measures
Project description
ak_requests
Requests package with QOL improvements and anti-bot detection measures
View Demo · Documentation · Report Bug · Request Feature
Table of Contents
- 1. About the Project
- 2. Getting Started
- 3. Usage
- 4. Roadmap
- 5. License
- 6. Contact
- 7. Acknowledgements
1. About the Project
ak_requests
is a Python package that provides an interface for automating requests tasks using requests
package. It comes with quality of life improvements like retires, custom redirects, spacing out requests and shuffling requests to not trigger anti-bot measures
1.1. Features
- Bulk requests handling
- Built-in retries and timeouts
- Can log processes to file
2. Getting Started
2.1. Installation
2.1.1. Production
Download the repo and install with flit
pip install flit
flit install --deps production
Alternatively, you can use pip
pip install ak_requests
2.1.2. Development
Install with flit
flit install --pth-file
3. Usage
from ak_requests import RequestsSession
# Initialize session
session = RequestsSession(log=False, retries=5, log_level='error')
# Update custom header
session.update_header({'Connection': 'keep-alive'})
# set cookies
session.update_cookies([{'name':'has_recent_activity', 'value':'1'}])
# Get requests
res = session.get('https://reqres.in/api/users?page=2', data={}, proxies = {} ) # Can accept any requests parameters
# Change min time bet. requests
session.MIN_REQUEST_GAP = 1.5 # seconds
# Make bulk requests
urls = ['https://reqres.in/api/users?page=2', 'https://reqres.in/api/unknown']
responses = session.bulk_get(urls)
# use beautifulsoup
from ak_requests import soupify
res = session.get('https://reqres.in/api/users?page=2')
soup = soupify(res)
## or
soup, res = session.soup('https://reqres.in/api/users?page=2')
## Also works for bulk requests
soups, ress = session.bulk_soup(urls)
4. Roadmap
- Add beautifulsoup integration
- Proxy
5. License
See LICENSE for more information.
6. Contact
Arun Kishore - @rpakishore
Project Link: https://github.com/rpakishore/ak_requests
7. Acknowledgements
Use this section to mention useful resources and libraries that you have used in your projects.
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
Built Distribution
File details
Details for the file ak_requests-0.0.2.tar.gz
.
File metadata
- Download URL: ak_requests-0.0.2.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 10af44d2e6afd30233e8be19ec800f0711745287816de7948d3c4aed9e53af7d |
|
MD5 | 0f44f5fc89a07f94903c8ce6faa20689 |
|
BLAKE2b-256 | 7b3b59ae31884bdeead00fc4a0fb8b226a26d62c16d6f251e63a025b990d1dbf |
File details
Details for the file ak_requests-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: ak_requests-0.0.2-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c78c89a10dcb10511cf476d4ee7c90ea624ee53ab09a9ab1d6f1986ddd9c31c |
|
MD5 | 196a160e04e944ee458ef57d59a90a24 |
|
BLAKE2b-256 | 9b845ad2b2aa64dc1e0ba59cc2a9cb4297349d050ba32ff7d1b619a9a600590a |