https://github.com/a-tal/gab
Gab.com API client
https://github.com/a-tal/gab
api-client client gab python36 python37 requests
Last synced: 10 days ago
JSON representation
Gab.com API client
- Host: GitHub
- URL: https://github.com/a-tal/gab
- Owner: a-tal
- License: mit
- Created: 2018-10-12T05:42:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-16T04:33:11.000Z (over 7 years ago)
- Last Synced: 2025-08-31T12:14:34.547Z (5 months ago)
- Topics: api-client, client, gab, python36, python37, requests
- Language: Python
- Size: 18.6 KB
- Stars: 20
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gab.com API Client
[](https://travis-ci.org/a-tal/gab)
[](https://coveralls.io/github/a-tal/gab?branch=master)
Based on the popular requests module, this is a minimal Gab.com API client.
There is a `help` method available on all created objects, which can
be used to discover API methods and their call arguments.
The client object is dynamically created during init time. To speed things
up, you can create a Client object with a cached copy of the collections.json
object. Please see the [example.py](example.py) for one such example. To prime
a new cache, save the response of `gab.Client()._get_api_collections()`.
Basic usage example:
```python
>>> import gab
>>> client = gab.Client()
>>> client.help()
Gab.com API Client 0.0.1.
The following collections are known:
creating_posts
engaging_with_other_users
feeds
groups
notifications
popular
reacting_to_posts
user_details
>>>
>>> client.groups.help()
Gab.com API collection Groups.
These are the endpoints to access groups.
The following operations are defined:
group_details
group_moderation_logs
group_users
popular_groups
>>>
>>> client.groups.group_users.help()
Gab.com API collection Groups method Group Users.
Returns a list of given group's members. Requires read scope.
Requires the following path parameters:
group-id
The following headers are defined:
Authorization
Additional optional parameters defined:
before: (example: 0)
>>>
>>> client.groups.group_users(1234)
Traceback (most recent call last):
File "", line 1, in
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url:
>>>
```
Wow! The example ran into an auth error? What the heck?
Yeah, this client library doesn't do auth, never write your own auth.
Instead, use someone else's auth, and pass in a session object.
Please see [example.py](example.py) for a full working CLI example with authentication.
## Installation
`pip install gab`
## Requirements
Python3.6+