MIT License

项目介绍

theelous3/asks 是一个托管在 GitHub 上的开源项目,主要使用 Python 编写,采用 MIT License 许可证,目前获得 511 个 Star、64 次 Fork。

仓库全名
theelous3/asks
开源许可证
MIT License
Star 数
511
Fork 数
64
未关闭 Issue
39

README 摘要

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…

完整内容见 GitHub 原始 README 或本页 。

常见问题

asks 用什么语言开发?

主要使用 Python 编写,采用 MIT License 许可证,目前有 511 个 Star。

asks 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 asks 的源码?

可以直接克隆仓库:git clone https://github.com/theelous3/asks.git,默认分支为 master;安装与运行步骤见仓库 README。

asks 最近还在维护吗?

仓库最近一次更新为 2022年5月17日,当前有 39 个未关闭 Issue;Star 数为 511,可作为社区活跃度的参考。

关于

Async requests-like httplib for python.

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
650
价值分
324
活跃状态
活跃

语言占比

Python

Release

README

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

评论

暂无评论