Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting an awesome-trio list #1262

Merged
merged 8 commits into from
Jan 27, 2020
Merged

Conversation

jay-tuckey
Copy link
Contributor

Making a page right after the tutorial with some links to libraries that have trio support.

@codecov
Copy link

codecov bot commented Oct 19, 2019

Codecov Report

Merging #1262 into master will increase coverage by <.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1262      +/-   ##
==========================================
+ Coverage   99.57%   99.57%   +<.01%     
==========================================
  Files         106      106              
  Lines       12827    12836       +9     
  Branches      984      985       +1     
==========================================
+ Hits        12772    12781       +9     
  Misses         35       35              
  Partials       20       20
Impacted Files Coverage Δ
trio/_core/tests/test_run.py 100% <0%> (ø) ⬆️
trio/_core/_run.py 99.73% <0%> (ø) ⬆️

However, to get much useful work done you will want to use some of
the great libraries that support trio-flavoured concurrency. This list
is not complete, but gives a starting point. Another great way to find
trio-compatible libraries is to search on PyPI for the `Framework :: trio`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The single-backticks here are causing the CI build to fail: https://travis-ci.org/python-trio/trio/jobs/600224047

I think you want double-backticks, because ReST is annoying like that.

Also, let's capitalize Trio.

* `trio-click <https://github.com/python-trio/trio-click>`__ - Python composable command line utility, trio-compatible version
* `triopg <https://github.com/python-trio/triopg>`__ - PostgreSQL client for Trio based on asyncpg
* `trio-mysql <https://github.com/python-trio/trio-mysql>`__ - Pure Python MySQL Client
* `hypothesis-trio <https://github.com/python-trio/hypothesis-trio>`__ - Hypothesis plugin for trio
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually not sure what the status is of anything below trio-click here... maybe just file them under categories, instead of "core" libraries?

trio-click → "Building command line apps"
triopg, trio-mysql → already listed under databases
hypothesis-trio → "Testing"

----------------------

* `asks <https://github.com/theelous3/asks>`__ - asks is an async requests-like http library
* `trustme <https://github.com/python-trio/trustme>`__ - #1 quality TLS certs while you wait, for the discerning tester
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trustme should also go under "Testing"

---------------------------
* `anyio <https://github.com/agronholm/anyio>`__ - AnyIO is a asynchronous compatibility API that allows applications and libraries written against it to run unmodified on asyncio, curio and trio.
* `tractor <https://github.com/goodboy/tractor>`__ - tractor is an attempt to bring trionic structured concurrency to distributed multi-core Python.
* `sniffio <https://github.com/python-trio/sniffio>`__ - This is a tiny package whose only purpose is to let you detect which async library your code is running under.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should have a category for "Trio/Asyncio interoperability", listing trio-asyncio ("use asyncio libraries from a trio app"), anyio, sniffio?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And tractor could go under like... "Multi-core/multiprocessing"?

I feel like "Utility libraries" would be more like async-generator (Makes async generators work (better) on Python 3.5 and Python 3.6), tricycle, trio-util

* `asks <https://github.com/theelous3/asks>`__ - asks is an async requests-like http library
* `trustme <https://github.com/python-trio/trustme>`__ - #1 quality TLS certs while you wait, for the discerning tester
* `trio-websocket <https://github.com/HyperionGray/trio-websocket>`__ - This library implements the WebSocket protocol, striving for safety, correctness, and ergonomics.
* `quart-trio <https://gitlab.com/pgjones/quart-trio/>`__ - `Quart <https://gitlab.com/pgjones/quart>`__ is a Python ASGI web microframework with the same API as Flask and Quart-Trio is an extension for Quart to support the Trio event loop.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should list hypercorn too (ASGI server with first-class Trio support)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact how about:

  • quart-trio – Like Flask, but for Trio. A simple and powerful framework for building async web applications and REST APIs. Tip: this is an ASGI-based framework, so you'll also need an HTTP server with ASGI support.
  • hypercorn – An HTTP server for hosting your ASGI apps. Supports HTTP/1.1, HTTP/2, HTTP/3, and Websockets. Can be run as a standalone server, or embedded in a larger Trio app. Use it with quart-trio, or any other Trio-compatible ASGI framework.

@jay-tuckey
Copy link
Contributor Author

Thanks @njsmith , I'll update this afternoon when I'm done work.

@njsmith
Copy link
Member

njsmith commented Oct 25, 2019

Test failure is #1231. I'll close/re-open to retry.

@njsmith njsmith closed this Oct 25, 2019
@njsmith njsmith reopened this Oct 25, 2019
docs/source/awesome-trio-libraries.rst Outdated Show resolved Hide resolved
docs/source/awesome-trio-libraries.rst Outdated Show resolved Hide resolved
* `triopg <https://github.com/python-trio/triopg>`__ - PostgreSQL client for Trio based on asyncpg
* `trio-mysql <https://github.com/python-trio/trio-mysql>`__ - Pure Python MySQL Client
* `sqlalchemy_aio <https://github.com/RazerM/sqlalchemy_aio>`__ - Add asyncio and Trio support to SQLAlchemy core, derived from alchimia.
* `sphinxcontrib-trio <https://github.com/python-trio/sphinxcontrib-trio>`__ - Make Sphinx better at documenting Python functions and methods
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sphinxcontrib-trio doesn't have anything to do with databases :-).

Also probably worth mentioning that it makes it easy to document async functions.

-----------------------------
* `anyio <https://github.com/agronholm/anyio>`__ - AnyIO is a asynchronous compatibility API that allows applications and libraries written against it to run unmodified on asyncio, curio and trio
* `sniffio <https://github.com/python-trio/sniffio>`__ - This is a tiny package whose only purpose is to let you detect which async library your code is running under
* `trio-asyncio <https://github.com/python-trio/trio-asyncio>`__ - Trio-Asyncio is a re-implementation of the asyncio mainloop on top of Trio
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While that's true, I think people will get a better idea of why they should care about trio-asyncio if we describe it as "Trio-Asyncio lets you use asyncio libraries from your Trio app."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

many asyncio libraries. Not all of them, aiohttp being the most glaring counterexample.

is not complete, but gives a starting point. Another great way to find
Trio-compatible libraries is to search on PyPI for the ``Framework :: trio``
tag -> `PyPI Search <https://pypi.org/search/?q=Framework+%3A%3A+trio>`__

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a "Getting started" section at the top, that says something like:

cookiecutter-trio: A quickstart template for your Trio project, including pytest-trio for testing and sphinxcontrib-trio for documentation.

@njsmith
Copy link
Member

njsmith commented Nov 8, 2019

@jay-tuckey Hey, just wanted to check in and see if you're still interested in working on this – I think it's pretty close, but also I know sometimes stuff comes up :-)

Co-Authored-By: Nathaniel J. Smith <njs@pobox.com>
@codecov-io
Copy link

codecov-io commented Nov 15, 2019

Codecov Report

Merging #1262 into master will decrease coverage by 5.87%.
The diff coverage is n/a.

@@            Coverage Diff            @@
##           master   #1262      +/-   ##
=========================================
- Coverage   99.57%   93.7%   -5.88%     
=========================================
  Files         106     106              
  Lines       12827   13288     +461     
  Branches      984    1004      +20     
=========================================
- Hits        12772   12451     -321     
- Misses         35     790     +755     
- Partials       20      47      +27
Impacted Files Coverage Δ
trio/_core/_windows_cffi.py 0% <0%> (-100%) ⬇️
trio/_wait_for_object.py 0% <0%> (-100%) ⬇️
trio/_subprocess_platform/windows.py 0% <0%> (-100%) ⬇️
trio/_windows_pipes.py 0% <0%> (-100%) ⬇️
trio/_core/_io_windows.py 0% <0%> (-91.29%) ⬇️
trio/tests/test_wait_for_object.py 10.37% <0%> (-89.63%) ⬇️
trio/_core/tests/test_windows.py 17.3% <0%> (-82.7%) ⬇️
trio/tests/test_windows_pipes.py 21.62% <0%> (-78.38%) ⬇️
trio/_subprocess_platform/__init__.py 59.37% <0%> (-40.63%) ⬇️
trio/hazmat.py 77.77% <0%> (-22.23%) ⬇️
... and 58 more

@jay-tuckey
Copy link
Contributor Author

Hi @njsmith , sorry about the delay. I got caught up in work and a busy life, but I've gone through and updated the PR now with the changes as discussed. I also fixed a few small typos and some consistency.

Your suggestions and @smurfix are great, keep them coming. 🙂

@smurfix
Copy link
Contributor

smurfix commented Nov 24, 2019

Addition: distmqtt https://github.com/smurfix/distmqtt.git which is a mostly-reasonable MQTT client and broker (an anyio-ified fork of hbmqtt).

@energizah
Copy link

The Urwid TUI library has Trio support now https://github.com/urwid/urwid/pull/372/files

* `trio-click <https://github.com/python-trio/trio-click>`__ - Python composable command line utility, trio-compatible version.


Multi-Core/Multiprocessing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth tossing trio_run_in_process here as well.

@parity3
Copy link

parity3 commented Dec 30, 2019

This is a constantly moving target so we should just merge-then-iterate right? A few opinions:

  • would like to see triopg/trio-mysql only under Database Libraries and removed from Core Trio Libraries. If opinions differ, then where is sqlalchemy_aio in core?
  • there should probably be an awesome-anyio as well?
  • trio_asyncio should probably be on the list?
  • httpx is probably mature enough to put on the list?

@dhirschfeld
Copy link
Member

Such a list has been requested a number of times:

As @parity3 says, this list will never be complete - there will (hopefully) always be new, awesome trio projects being developed so I think it would be great to get an initial version in and then new libraries can be added as new PRs on an incremental, ongoing basis.

@dhirschfeld
Copy link
Member

@jay-tuckey, thanks for kicking this off! I think what we have here is a great start so if there are no more projects you'd like to add now it would be good to remove the [WIP] so we can get this merged and then continually iterate/update.

@jay-tuckey jay-tuckey changed the title [WIP] starting an awesome-trio list Starting an awesome-trio list Jan 27, 2020
@jay-tuckey
Copy link
Contributor Author

Ok, I have removed the [WIP] as suggested, and also added a few more of the libraries people have mentioned.

@pquentin pquentin merged commit c0ec767 into python-trio:master Jan 27, 2020
@trio-bot
Copy link

trio-bot bot commented Jan 27, 2020

Hey @jay-tuckey, it looks like that was the first time we merged one of your PRs! Thanks so much! 🎉 🎂

If you want to keep contributing, we'd love to have you. So, I just sent you an invitation to join the python-trio organization on Github! If you accept, then here's what will happen:

  • Github will automatically subscribe you to notifications on all our repositories. (But you can unsubscribe again if you don't want the spam.)

  • You'll be able to help us manage issues (add labels, close them, etc.)

  • You'll be able to review and merge other people's pull requests

  • You'll get a [member] badge next to your name when participating in the Trio repos, and you'll have the option of adding your name to our member's page and putting our icon on your Github profile (details)

If you want to read more, here's the relevant section in our contributing guide.

Alternatively, you're free to decline or ignore the invitation. You'll still be able to contribute as much or as little as you like, and I won't hassle you about joining again. But if you ever change your mind, just let us know and we'll send another invitation. We'd love to have you, but more importantly we want you to do whatever's best for you.

If you have any questions, well... I am just a humble Python script, so I probably can't help. But please do post a comment here, or in our chat, or on our forum, whatever's easiest, and someone will help you out!

@pquentin
Copy link
Member

Thanks! Merged. The PyPI search does not appears to include too many results but we can fix that in another pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants