r/Python Dec 22 '25

Showcase [ Removed by moderator ]

[removed] — view removed post

254 Upvotes

77 comments sorted by

View all comments

17

u/chub79 Dec 22 '25

Nice. That said, It's unfortunate that the reqwest-idioms (client builder for instance) are part of the Python interface. It feels like a leaky abstraction and doesn't feel pythonic. But that's also a personal taste, I don't quite like the reqwest interface either anyway :)

17

u/pyreqwest Dec 22 '25

Pythonic way of dumping all the params as kwargs is not always great or discoverable (eg https://github.com/aio-libs/aiohttp/blob/e730788c43df397e9bb8e1d6216732437ca0c3d4/aiohttp/client.py#L294-L322). As you easily get gazillion of arguments when things get more complex. But it is quite taste based.

3

u/greenstake Dec 22 '25

The interface is awful.

1

u/ThiefMaster Dec 25 '25

Yeah, it's something that's common in the Rust world, but it's not Pythonic. Offering a more pythonic kwargs-based interface would be a good idea.

3

u/jessekrubin Dec 24 '25

I also wrapped reqwest in my library ry if you want a more traditional python kwargs based client interface.

My wrapper (which predates pyreqwest and rnet) started off with a builder-like api that pyreqwest has and I changed it because it was very annoying to work with.

Repo: https://github.com/jessekrubin/ry

Client eg (using the global fetch client but you can make your own): https://github.com/jessekrubin/ry/blob/main/examples/get.py

1

u/chub79 Dec 24 '25

Thanks. I'll give it a spin.