Skip to main content

this is a requester for requests.

Project description

DataClient

Introduction

this is a request tool which packaging method server

Usage

from stormer import Requester

# init Requester instance
requester = Requester(
    "https://www.baidu.com", 
    redis_url="redis://127.0.0.1:6379/0", 
    # redis_nodes="127.0.0.1:7000,127.0.0.1:7001,127.0.0.1:7002", 
    # redis_password="",
    timeout=30, # in seconds,global cache timeout
    # headers={"Content-Type": "text/html;charset=utf8"},
    encoding='utf8'
)

# open debug
requester.set_debugging()

# register request function
requester.register(
    action="get", 
    func="bd_index", 
    uri="/", 
    timeout=5  # in second, this requester cache timeout
)

# execute function
rlt = requester.bd_index()
r_byte = rlt.bytes
print(rlt.data)
print(rlt.resp)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for stormer, version 0.1.2
Filename, size File type Python version Upload date Hashes
Filename, size stormer-0.1.2-py3-none-any.whl (9.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size stormer-0.1.2.tar.gz (6.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page