Reddit Gateway API Library
Project description
GateRed
A library to fetch Reddit data using Reddit WebAPI (gateway), w/ pushshift historical submissions support.
Documentation · Replit Playground
Why this library?
Although there are existing libraries (e.g. praw) to interact with Reddit developer's API, there are still several drawbacks when we trying to collect vast amount of data. gatered tries to counter these problems to provide these features:
- No authentication (API key) is needed to access the data.
- Extra attributes is presented using the Reddit webAPI compared to the public devAPI.
- Fully Async based.
- Proxy support via httpx.
Install
You can install this library easily from pypi:
# with pip
pip install gatered
# with poetry
poetry add gatered
Using
The library provides easy functions to get start fast:
gatered.func.get_post_comments
gatered.func.get_posts_with_subreddit_info
gatered.func.get_posts
gatered.func.get_comments
gatered.func.get_pushshift_posts
Alternatively you can directly use gatered.client.Client
and gatered.pushshift.PushShiftAPI
classes as your base to implement your own logics.
Errors can be handled by importing either gatered.RequestError
or gatered.HTTPStatusError
,
see httpx exceptions to learn more.
See examples/
for more examples.
Alternately, you can fork the example repo on Replit and play around online.
License
Copyright 2022 CounterTek
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gatered-1.3.0.tar.gz
.
File metadata
- Download URL: gatered-1.3.0.tar.gz
- Upload date:
- Size: 12.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.2 Linux/5.11.0-1028-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 609035adfa0284f87bf32db4a44ae83e7d16ffb202395932e54a3c604dd708d5 |
|
MD5 | a3792d26a54666e310cc909095cdd955 |
|
BLAKE2b-256 | 8bdcf8fed60d5b0ed81b04ea8e2a408c2f35486f03ef823f0b5a68d206e1bed2 |
File details
Details for the file gatered-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: gatered-1.3.0-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.2 Linux/5.11.0-1028-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00980a9389a76996fe1f15957dd161f8b0b24a93b7e2cfd9f3479650553d9cd0 |
|
MD5 | a8073fc5afe7c8c6628c496e767ebfbf |
|
BLAKE2b-256 | 112dc749f31aa06db9c618442a98b04590f2a28b0c8a629324a4516ec6f40ebb |