GithubHelp home page GithubHelp logo

clericpy / torequests Goto Github PK

View Code? Open in Web Editor NEW
24.0 5.0 3.0 1.5 MB

Async wrapper for requests / aiohttp, and some crawler toolkits. Let synchronization code enjoy the performance of asynchronous programming.

Home Page: https://torequests.readthedocs.io/en/latest/

License: MIT License

Python 99.53% Go 0.47%
async thread-pool requests tomorrow asynchronous aiohttp

torequests's People

Contributors

clericpy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

torequests's Issues

Compare performance, requests aiohttp httpx golang/net

Mock server

from starlette.applications import Starlette
from starlette.responses import PlainTextResponse

app = Starlette()


@app.route("/")
async def source_redirect(req):
    return PlainTextResponse('ok')


if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, port=9890)

Windows10, without uvloop.

Versioned test suite

The PyPI releases do not include tests, and there are no GitHub releases, so I can not get a stable URL for fetching tests of a release

timeago remove 0 tail if necessary

from torequests.utils import timeago
print(timeago(234, format=1))
# 3 minutes 54 seconds 0 ms  # remove 0 ms
print(timeago(360, format=1))
# 6 minutes 0 second 0 ms  # remove 0 second 0 ms

curlparse bug

shell backslash-escaped string parsed failed.

  1. \n \r
  2. '

can not cancel process by KeyboardInterupt while interval is not 0

from torequests.main import threads, time
from torequests.utils import Timer
from torequests.dummy import Requests as tPool
from torequests import tPool
Timer()

req= tPool(n=1, interval=2)

ss=[]
ss = [req.get('http://p.3.cn', callback=lambda r: print(ss)) for i in range(5)]
time.sleep(1)
print(ss)
req.x
`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.