GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - calvertvl/asks: Async requests-like httplib for python.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

472 Commits
472 Commits

Folders and files

NameName
Last commit message
Last commit date
asks
asks
 
 
docs
docs
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
LICENCE.txt
LICENCE.txt
 
 
MANIFEST.in
MANIFEST.in
 
 
README.md
README.md
 
 
pylintrc
pylintrc
 
 
setup.cfg
setup.cfg
 
 
setup.py
setup.py
 
 

Repository files navigation

Build Status Docs Status

asks

asks is an async requests-like HTTP lib, for use in conjunction with the wonderful curio and trio async libs.

asks aims to have a mostly familiar API, using simple functions/methods like get() for getting and post() for posting. At the heart of asks is a session class which makes interacting with the web in a sustained and fluid way fast, efficient, and simple. Check out the examples!

Check the docs!

http://asks.readthedocs.io/

Above you'll find detailed docs with a large number of simple examples to help you get off the ground in no time.

Installation

Requires: Python 3.6.2 or newer.

pip install asks

Examples

# one request
# A little silly to async one request, but not without its use!
import asks
import anyio

async def example():
    r = await asks.get('https://example.org')
    print(r.content)

anyio.run(example)
# many requests
# make 1k api calls and store their response objects
# in a list.

import asks
import trio

path_list = ['http://fakeurl.org/get','http://example123.org']

results = []


async def grabber(s, path):
    r = await s.get(path)
    results.append(r)


async def main(path_list):
    from asks.sessions import Session
    s = Session('https://example.org', connections=2)
    async with trio.open_nursery() as n:
        for path in path_list:
            n.start_soon(grabber, s, path)

trio.run(main, path_list)

Changelog

2.0.0 - Setting stream=True means that the response returned will be a StreamResponse object rather than the default Response object.

Shoutout to ##lp, and the fine peeps of 8banana

About

Async requests-like httplib for python.

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.