https://github.com/meyer1994/clienter
Build clients for REST APIs fast!
https://github.com/meyer1994/clienter
Last synced: 19 days ago
JSON representation
Build clients for REST APIs fast!
- Host: GitHub
- URL: https://github.com/meyer1994/clienter
- Owner: meyer1994
- License: unlicense
- Created: 2020-11-25T04:04:31.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-25T04:35:05.000Z (over 5 years ago)
- Last Synced: 2026-01-05T12:27:48.280Z (5 months ago)
- Language: Python
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Clienter
[](https://travis-ci.com/meyer1994/clienter)
[](https://codecov.io/gh/meyer1994/clienter)
[](https://www.codacy.com/gh/meyer1994/clienter/dashboard?utm_source=github.com&utm_medium=referral&utm_content=meyer1994/clienter&utm_campaign=Badge_Grade)
[](https://github.com/RichardLitt/standard-readme)
Build clients for REST APIs fast!
## Table of Contents
- [About](#about)
- [Install](#install)
- [Thanks](#thanks)
## About
I was tired of having to write boilerplate/custom clients for every REST endpoint available on the web. So, I decided to create something that do it for me. Here it is:
```py
import httpx
from clienter import Clienter
class GitHub(Clienter):
def repos(self, owner, repo):
""" GET /repos/{}/{} """
github = GitHub('https://api.github.com', httpx)
repo = github.repos('meyer1994', 'clienter').json()
print(repo)
# Output:
# {
# 'full_name': 'meyer1994/clienter',
# 'private': False,
# ...
# }
```
Note that we pass the client we want to use to the object constructor. In this example, we are using [httpx][1]. It works with [requests][2] as well.
## Install
This project has no requirements :)
## Thanks
This project was inspired by the [OpenFeign][3] project.
[1]: https://www.python-httpx.org/
[2]: https://requests.readthedocs.io/en/master/
[3]: https://github.com/OpenFeign/feign