Skip to main content

Reddit Gateway API Library

Project description

GateRed

A utils for interacting with Reddit Gateway API (Web API), w/ pushshift historical posts support.

Latest Version Supported Python Versions CI Code style: black GitHub license

Documentation

Why this library?

Although Reddit has developer APIs and there are existing libraries (e.g. praw) to interact with reddit, there are still several drawbacks in terms of collecting data:

  • An API key is needed to collect data.
  • Rate limit is based on API keys.
  • Some fields are missing using developer APIs.

Therefore, gatered exists just to counter this problem. It directly access Reddit's web API to get the whole information. No authentication is needed, and it supports proxy provided by 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
  • 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.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gatered-1.1.1.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

gatered-1.1.1-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file gatered-1.1.1.tar.gz.

File metadata

  • Download URL: gatered-1.1.1.tar.gz
  • Upload date:
  • Size: 12.5 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

Hashes for gatered-1.1.1.tar.gz
Algorithm Hash digest
SHA256 0b12e6996141cfb1bc394da509275e470645ee23b55e5613845e6ed517e6e050
MD5 58c4c11cba5b28034445914ad1ad5c96
BLAKE2b-256 fff4421280a2b8586d1b59a78cf85e5489ee15dcc12dba9e026fbc76504d0d45

See more details on using hashes here.

File details

Details for the file gatered-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: gatered-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 14.9 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

Hashes for gatered-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8b463793fa4797b398ccaca050419187f6e21c8b33db50d057616dc73f8dcc56
MD5 2bf0d74c8e98cc24d8965eedc6925aca
BLAKE2b-256 72a6e47395d8af3b46e1f556e5ab7ab8f01da8094cf8015274736780aa14c3b9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page