prawcore


Nameprawcore JSON
Version 3.0.2 PyPI version JSON
download
home_pageNone
SummaryLow-level communication layer for PRAW 4+.
upload_time2025-02-10 22:43:53
maintainerNone
docs_urlNone
authorNone
requires_python~=3.9
licenseNone
keywords praw reddit api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            .. _main_page:

prawcore
========

.. image:: https://img.shields.io/pypi/v/prawcore.svg
    :alt: Latest prawcore Version
    :target: https://pypi.python.org/pypi/prawcore

.. image:: https://img.shields.io/pypi/pyversions/prawcore
    :alt: Supported Python Versions
    :target: https://pypi.python.org/pypi/prawcore

.. image:: https://img.shields.io/pypi/dm/prawcore
    :alt: PyPI - Downloads - Monthly
    :target: https://pypi.python.org/pypi/prawcore

.. image:: https://github.com/praw-dev/prawcore/actions/workflows/ci.yml/badge.svg?event=push
    :alt: GitHub Actions Status
    :target: https://github.com/praw-dev/prawcore/actions/workflows/ci.yml

.. image:: https://api.securityscorecards.dev/projects/github.com/praw-dev/prawcore/badge
    :alt: OpenSSF Scorecard
    :target: https://api.securityscorecards.dev/projects/github.com/praw-dev/prawcore

.. image:: https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg
    :alt: Contributor Covenant
    :target: https://github.com/praw-dev/.github/blob/main/CODE_OF_CONDUCT.md

.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
    :alt: pre-commit
    :target: https://github.com/pre-commit/pre-commit

prawcore is a low-level communication layer used by PRAW 4+.

Installation
------------

Install prawcore using ``pip`` via:

.. code-block:: console

    pip install prawcore

Execution Example
-----------------

The following example demonstrates how to use prawcore to obtain the list of trophies
for a given user using the script-app type. This example assumes you have the
environment variables ``PRAWCORE_CLIENT_ID`` and ``PRAWCORE_CLIENT_SECRET`` set to the
appropriate values for your application.

.. code-block:: python

    #!/usr/bin/env python
    import os
    import pprint
    import prawcore

    authenticator = prawcore.TrustedAuthenticator(
        prawcore.Requestor("YOUR_VALID_USER_AGENT"),
        os.environ["PRAWCORE_CLIENT_ID"],
        os.environ["PRAWCORE_CLIENT_SECRET"],
    )
    authorizer = prawcore.ReadOnlyAuthorizer(authenticator)
    authorizer.refresh()

    with prawcore.session(authorizer) as session:
        pprint.pprint(session.request("GET", "/api/v1/user/bboe/trophies"))

Save the above as ``trophies.py`` and then execute via:

.. code-block:: console

    python trophies.py

Additional examples can be found at:
https://github.com/praw-dev/prawcore/tree/main/examples

Depending on prawcore
---------------------

prawcore follows `semantic versioning <https://semver.org/>`_ with the exception that
deprecations will not be preceded by a minor release. In essence, expect only major
versions to introduce breaking changes to prawcore's public interface. As a result, if
you depend on prawcore then it is a good idea to specify not only the minimum version of
prawcore your package requires, but to also limit the major version.

Below are two examples of how you may want to specify your prawcore dependency:

setup.py
~~~~~~~~

.. code-block:: python

    setup(..., install_requires=["prawcore >=0.1, <1"], ...)

requirements.txt
~~~~~~~~~~~~~~~~

.. code-block:: text

    prawcore >=1.5.1, <2


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "prawcore",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "~=3.9",
    "maintainer_email": "Bryce Boe <bbzbryce@gmail.com>",
    "keywords": "praw, reddit, api",
    "author": null,
    "author_email": "Bryce Boe <bbzbryce@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/2a/31/9ece8cce3689fe72a7f25565c2b60e1d88dee518b8936efdf00e3bd1eb94/prawcore-3.0.2.tar.gz",
    "platform": null,
    "description": ".. _main_page:\n\nprawcore\n========\n\n.. image:: https://img.shields.io/pypi/v/prawcore.svg\n    :alt: Latest prawcore Version\n    :target: https://pypi.python.org/pypi/prawcore\n\n.. image:: https://img.shields.io/pypi/pyversions/prawcore\n    :alt: Supported Python Versions\n    :target: https://pypi.python.org/pypi/prawcore\n\n.. image:: https://img.shields.io/pypi/dm/prawcore\n    :alt: PyPI - Downloads - Monthly\n    :target: https://pypi.python.org/pypi/prawcore\n\n.. image:: https://github.com/praw-dev/prawcore/actions/workflows/ci.yml/badge.svg?event=push\n    :alt: GitHub Actions Status\n    :target: https://github.com/praw-dev/prawcore/actions/workflows/ci.yml\n\n.. image:: https://api.securityscorecards.dev/projects/github.com/praw-dev/prawcore/badge\n    :alt: OpenSSF Scorecard\n    :target: https://api.securityscorecards.dev/projects/github.com/praw-dev/prawcore\n\n.. image:: https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg\n    :alt: Contributor Covenant\n    :target: https://github.com/praw-dev/.github/blob/main/CODE_OF_CONDUCT.md\n\n.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white\n    :alt: pre-commit\n    :target: https://github.com/pre-commit/pre-commit\n\nprawcore is a low-level communication layer used by PRAW 4+.\n\nInstallation\n------------\n\nInstall prawcore using ``pip`` via:\n\n.. code-block:: console\n\n    pip install prawcore\n\nExecution Example\n-----------------\n\nThe following example demonstrates how to use prawcore to obtain the list of trophies\nfor a given user using the script-app type. This example assumes you have the\nenvironment variables ``PRAWCORE_CLIENT_ID`` and ``PRAWCORE_CLIENT_SECRET`` set to the\nappropriate values for your application.\n\n.. code-block:: python\n\n    #!/usr/bin/env python\n    import os\n    import pprint\n    import prawcore\n\n    authenticator = prawcore.TrustedAuthenticator(\n        prawcore.Requestor(\"YOUR_VALID_USER_AGENT\"),\n        os.environ[\"PRAWCORE_CLIENT_ID\"],\n        os.environ[\"PRAWCORE_CLIENT_SECRET\"],\n    )\n    authorizer = prawcore.ReadOnlyAuthorizer(authenticator)\n    authorizer.refresh()\n\n    with prawcore.session(authorizer) as session:\n        pprint.pprint(session.request(\"GET\", \"/api/v1/user/bboe/trophies\"))\n\nSave the above as ``trophies.py`` and then execute via:\n\n.. code-block:: console\n\n    python trophies.py\n\nAdditional examples can be found at:\nhttps://github.com/praw-dev/prawcore/tree/main/examples\n\nDepending on prawcore\n---------------------\n\nprawcore follows `semantic versioning <https://semver.org/>`_ with the exception that\ndeprecations will not be preceded by a minor release. In essence, expect only major\nversions to introduce breaking changes to prawcore's public interface. As a result, if\nyou depend on prawcore then it is a good idea to specify not only the minimum version of\nprawcore your package requires, but to also limit the major version.\n\nBelow are two examples of how you may want to specify your prawcore dependency:\n\nsetup.py\n~~~~~~~~\n\n.. code-block:: python\n\n    setup(..., install_requires=[\"prawcore >=0.1, <1\"], ...)\n\nrequirements.txt\n~~~~~~~~~~~~~~~~\n\n.. code-block:: text\n\n    prawcore >=1.5.1, <2\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Low-level communication layer for PRAW 4+.",
    "version": "3.0.2",
    "project_urls": {
        "Issue Tracker": "https://github.com/praw-dev/prawcore/issues",
        "Source Code": "https://github.com/praw-dev/prawcore"
    },
    "split_keywords": [
        "praw",
        " reddit",
        " api"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "88eecbf4dab1547cf4b7eed331529230b393f18ae3d84d6f71c9c73f24f14418",
                "md5": "1d2742dfcf9c57908fbdf3321e07ddbc",
                "sha256": "f8a656de23dbc457b258739cafd626f8d0e60014b4ee17b10c5323d00ee1ebfc"
            },
            "downloads": -1,
            "filename": "prawcore-3.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1d2742dfcf9c57908fbdf3321e07ddbc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.9",
            "size": 17077,
            "upload_time": "2025-02-10T22:43:52",
            "upload_time_iso_8601": "2025-02-10T22:43:52.015446Z",
            "url": "https://files.pythonhosted.org/packages/88/ee/cbf4dab1547cf4b7eed331529230b393f18ae3d84d6f71c9c73f24f14418/prawcore-3.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2a319ece8cce3689fe72a7f25565c2b60e1d88dee518b8936efdf00e3bd1eb94",
                "md5": "657cd9f464db63e1515541cab212630c",
                "sha256": "15b2a2bc0ee0269d472f56b98c77e1d41c68b80f6fe72d3cb7bf784ed6cf259c"
            },
            "downloads": -1,
            "filename": "prawcore-3.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "657cd9f464db63e1515541cab212630c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.9",
            "size": 15949,
            "upload_time": "2025-02-10T22:43:53",
            "upload_time_iso_8601": "2025-02-10T22:43:53.713695Z",
            "url": "https://files.pythonhosted.org/packages/2a/31/9ece8cce3689fe72a7f25565c2b60e1d88dee518b8936efdf00e3bd1eb94/prawcore-3.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-10 22:43:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "praw-dev",
    "github_project": "prawcore",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "prawcore"
}
        
Elapsed time: 1.81767s