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
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
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)
3.1. Development
- Open the project directory in vscode
- Update the app name under
pyproject.toml
- Change the folder name from
src\template_python
tosrc\<app_name>
, and propate the changes to the subfolders. - Review the dependencies under
pyproject.toml
and remove as needed. - Remove unneeded dependencies from
src\<app_name>\
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
Hashes for ak_requests-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b8a7b0183c2665eb5b97779cd231501a4ca9827e4c7e0040cc33b15d553ce76 |
|
MD5 | 3c2bbd484e9b781e1dadbaf04e5d4feb |
|
BLAKE2b-256 | 746b8abd8d8ff842471e19eaac5965ebc39cb233cfa55d139dc89bc461009dfb |