# A New Python API

**URL:** <https://meta.discourse.org/t/a-new-python-api/191974>\
**Category:** Development\
**Created:** [May 28, 2021, 8:54pm UTC](https://meta.discourse.org/t/a-new-python-api/191974 "2021-05-28T20:54:42Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![JonathanShaw](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jonathanshaw/32/532672_2.png) [@JonathanShaw](https://meta.discourse.org/u/JonathanShaw)\
**Post date:** [September 28, 2021, 3:41pm UTC](https://meta.discourse.org/t/a-new-python-api/191974/3 "2021-09-28T15:41:57Z")

</div>

> [@Grayden\_Shand](#):
>
> I used a “fluent” interface, where you use method chaining to construct requests. Let’s take an example.  
> To get the latest topics in some category ‘foo’ with id=5, you use this endpoint:  
> `GET /c/foo/5.json` .  
> To make that request with this library simply call:  
> `client.c.foo[5].json.get()`

That’s an interesting aproach..

To do something similar in php we’d have to rely on magic methods and so lose the benefit of IDE autocompletion etc. But might be a wortwhile price to pay.

What’s the advantage of this approach over simply passing the url as an argument: `client.get(url)` ?

---

_[View the full topic](https://meta.discourse.org/t/a-new-python-api/191974)._
