edx-rest-api-client


Nameedx-rest-api-client JSON
Version 5.7.1 PyPI version JSON
download
home_pagehttps://github.com/openedx/edx-rest-api-client
SummaryClient utilities to access various Open edX Platform REST APIs.
upload_time2024-06-24 20:40:09
maintainerNone
docs_urlNone
authoredX
requires_pythonNone
licenseApache
keywords edx rest api client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            edX REST API Client
###################

| |status-badge| |license-badge| |CI| |Codecov| |pypi-badge|

The edX REST API Client simplifies communicating with other Open edX services by providing OAuth2 and JWT utilities.


Getting Started with Development
********************************

In a Python 3.8 virtual environment:

.. code-block:: shell

    $ make requirements
    $ make validate


Clients & REST API Clients code
*******************************

Open edX services, including LMS, should use the ``OAuthAPIClient`` class to make OAuth2 client requests and REST API calls.

Usage
=====

By default the ``OAuthAPIClient`` object can be used like any `requests.Session`_ object and you can follow the docs that the requests library provides.

The ``OAuthAPIClient`` sessions makes some extra requests to get access tokens from the auth endpoints.  These requests have a default timeout that can be overridden by passing in a ``timeout`` parameter when instantiating the ``OAuthAPIClient`` object.

.. code-block:: python

    # create client with default timeouts for token retrieval
    client = OAuthAPIClient('https://lms.root', 'client_id', 'client_secret')

    # create client, overriding default timeouts for token retrieval
    client = OAuthAPIClient('https://lms.root', 'client_id', 'client_secret', timeout=(6.1, 2))
    client = OAuthAPIClient('https://lms.root', 'client_id', 'client_secret',
         timeout=(REQUEST_CONNECT_TIMEOUT, 3)
    )

    # for a request to some.url, a separate timeout should always be set on your requests
    client.get('https://some.url', timeout=(3.1, 0.5))

The value of the ``timeout`` setting is the same as for any request made with the ``requests`` library.  See the `Requests timeouts documentation`_ for more details.

.. _requests.Session: https://requests.readthedocs.io/en/master/user/advanced/#session-objects
.. _Requests timeouts documentation: https://requests.readthedocs.io/en/master/user/advanced/#timeouts

Additional Requirements
***********************

The OAuthAPIClient uses the TieredCache internally for caching.  Read more about the `requirements of TieredCache`_, which include Django caching and some custom middleware.

.. _requirements of TieredCache: https://github.com/openedx/edx-django-utils/blob/master/edx_django_utils/cache/README.rst#tieredcache

Contributing
************

Contributions are very welcome.
Please read `How To Contribute <https://openedx.org/r/how-to-contribute>`_ for details.

This project is currently accepting all types of contributions, bug fixes,
security fixes, maintenance work, or new features.  However, please make sure
to have a discussion about your new feature idea with the maintainers prior to
beginning development to maximize the chances of your change being accepted.
You can start a conversation by creating a new issue on this repo summarizing
your idea.

More Help
*********

If you're having trouble, we have discussion forums at
`discuss.openedx.org <https://discuss.openedx.org>`_ where you can connect with others in the
community.

Our real-time conversations are on Slack. You can request a `Slack
invitation`_, then join our `community Slack workspace`_.

For anything non-trivial, the best path is to `open an issue`__ in this
repository with as many details about the issue you are facing as you
can provide.

__ https://github.com/openedx/edx-rest-api-client/issues

For more information about these options, see the `Getting Help`_ page.

.. _Slack invitation: https://openedx.org/slack
.. _community Slack workspace: https://openedx.slack.com/
.. _Getting Help: https://openedx.org/getting-help

The Open edX Code of Conduct
****************************

All community members are expected to follow the `Open edX Code of Conduct`_.

.. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/

Reporting Security Issues
*************************

Please do not report security issues in public. Please email security@openedx.org.


.. |CI| image:: https://github.com/openedx/edx-rest-api-client/workflows/Python%20CI/badge.svg?branch=master
    :target: https://github.com/openedx/edx-rest-api-client/actions?query=workflow%3A%22Python+CI%22
    :alt: Test suite status

.. |Codecov| image:: https://codecov.io/github/openedx/edx-rest-api-client/coverage.svg?branch=master
    :target: https://codecov.io/github/openedx/edx-rest-api-client?branch=master
    :alt: Code coverage

.. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen
    :alt: Maintained

.. |license-badge| image:: https://img.shields.io/github/license/openedx/edx-rest-api-client.svg
    :target: https://github.com/openedx/edx-rest-api-client/blob/master/LICENSE
    :alt: License

.. |pypi-badge| image:: https://img.shields.io/pypi/v/edx-rest-api-client.svg
    :target: https://pypi.python.org/pypi/edx-rest-api-client/
    :alt: PyPI

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/openedx/edx-rest-api-client",
    "name": "edx-rest-api-client",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "edx rest api client",
    "author": "edX",
    "author_email": "oscm@edx.org",
    "download_url": "https://files.pythonhosted.org/packages/ef/fa/3c81759af41eb49e3662f68c5d8e72ccd82b5cba6c8f14eb2c4d99b707ad/edx_rest_api_client-5.7.1.tar.gz",
    "platform": null,
    "description": "edX REST API Client\n###################\n\n| |status-badge| |license-badge| |CI| |Codecov| |pypi-badge|\n\nThe edX REST API Client simplifies communicating with other Open edX services by providing OAuth2 and JWT utilities.\n\n\nGetting Started with Development\n********************************\n\nIn a Python 3.8 virtual environment:\n\n.. code-block:: shell\n\n    $ make requirements\n    $ make validate\n\n\nClients & REST API Clients code\n*******************************\n\nOpen edX services, including LMS, should use the ``OAuthAPIClient`` class to make OAuth2 client requests and REST API calls.\n\nUsage\n=====\n\nBy default the ``OAuthAPIClient`` object can be used like any `requests.Session`_ object and you can follow the docs that the requests library provides.\n\nThe ``OAuthAPIClient`` sessions makes some extra requests to get access tokens from the auth endpoints.  These requests have a default timeout that can be overridden by passing in a ``timeout`` parameter when instantiating the ``OAuthAPIClient`` object.\n\n.. code-block:: python\n\n    # create client with default timeouts for token retrieval\n    client = OAuthAPIClient('https://lms.root', 'client_id', 'client_secret')\n\n    # create client, overriding default timeouts for token retrieval\n    client = OAuthAPIClient('https://lms.root', 'client_id', 'client_secret', timeout=(6.1, 2))\n    client = OAuthAPIClient('https://lms.root', 'client_id', 'client_secret',\n         timeout=(REQUEST_CONNECT_TIMEOUT, 3)\n    )\n\n    # for a request to some.url, a separate timeout should always be set on your requests\n    client.get('https://some.url', timeout=(3.1, 0.5))\n\nThe value of the ``timeout`` setting is the same as for any request made with the ``requests`` library.  See the `Requests timeouts documentation`_ for more details.\n\n.. _requests.Session: https://requests.readthedocs.io/en/master/user/advanced/#session-objects\n.. _Requests timeouts documentation: https://requests.readthedocs.io/en/master/user/advanced/#timeouts\n\nAdditional Requirements\n***********************\n\nThe OAuthAPIClient uses the TieredCache internally for caching.  Read more about the `requirements of TieredCache`_, which include Django caching and some custom middleware.\n\n.. _requirements of TieredCache: https://github.com/openedx/edx-django-utils/blob/master/edx_django_utils/cache/README.rst#tieredcache\n\nContributing\n************\n\nContributions are very welcome.\nPlease read `How To Contribute <https://openedx.org/r/how-to-contribute>`_ for details.\n\nThis project is currently accepting all types of contributions, bug fixes,\nsecurity fixes, maintenance work, or new features.  However, please make sure\nto have a discussion about your new feature idea with the maintainers prior to\nbeginning development to maximize the chances of your change being accepted.\nYou can start a conversation by creating a new issue on this repo summarizing\nyour idea.\n\nMore Help\n*********\n\nIf you're having trouble, we have discussion forums at\n`discuss.openedx.org <https://discuss.openedx.org>`_ where you can connect with others in the\ncommunity.\n\nOur real-time conversations are on Slack. You can request a `Slack\ninvitation`_, then join our `community Slack workspace`_.\n\nFor anything non-trivial, the best path is to `open an issue`__ in this\nrepository with as many details about the issue you are facing as you\ncan provide.\n\n__ https://github.com/openedx/edx-rest-api-client/issues\n\nFor more information about these options, see the `Getting Help`_ page.\n\n.. _Slack invitation: https://openedx.org/slack\n.. _community Slack workspace: https://openedx.slack.com/\n.. _Getting Help: https://openedx.org/getting-help\n\nThe Open edX Code of Conduct\n****************************\n\nAll community members are expected to follow the `Open edX Code of Conduct`_.\n\n.. _Open edX Code of Conduct: https://openedx.org/code-of-conduct/\n\nReporting Security Issues\n*************************\n\nPlease do not report security issues in public. Please email security@openedx.org.\n\n\n.. |CI| image:: https://github.com/openedx/edx-rest-api-client/workflows/Python%20CI/badge.svg?branch=master\n    :target: https://github.com/openedx/edx-rest-api-client/actions?query=workflow%3A%22Python+CI%22\n    :alt: Test suite status\n\n.. |Codecov| image:: https://codecov.io/github/openedx/edx-rest-api-client/coverage.svg?branch=master\n    :target: https://codecov.io/github/openedx/edx-rest-api-client?branch=master\n    :alt: Code coverage\n\n.. |status-badge| image:: https://img.shields.io/badge/Status-Maintained-brightgreen\n    :alt: Maintained\n\n.. |license-badge| image:: https://img.shields.io/github/license/openedx/edx-rest-api-client.svg\n    :target: https://github.com/openedx/edx-rest-api-client/blob/master/LICENSE\n    :alt: License\n\n.. |pypi-badge| image:: https://img.shields.io/pypi/v/edx-rest-api-client.svg\n    :target: https://pypi.python.org/pypi/edx-rest-api-client/\n    :alt: PyPI\n",
    "bugtrack_url": null,
    "license": "Apache",
    "summary": "Client utilities to access various Open edX Platform REST APIs.",
    "version": "5.7.1",
    "project_urls": {
        "Homepage": "https://github.com/openedx/edx-rest-api-client"
    },
    "split_keywords": [
        "edx",
        "rest",
        "api",
        "client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "448c84796304044a7f9f784ef4d3b2f1ba7f851323ec4c9f8bcb3ef290e26282",
                "md5": "ee13c8a3516addf0b650e5303560875b",
                "sha256": "82a0e6e56bdda923895a11d5b9cd7cfd446dc31588118f6183677c32179bf0bf"
            },
            "downloads": -1,
            "filename": "edx_rest_api_client-5.7.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ee13c8a3516addf0b650e5303560875b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 13591,
            "upload_time": "2024-06-24T20:39:59",
            "upload_time_iso_8601": "2024-06-24T20:39:59.978782Z",
            "url": "https://files.pythonhosted.org/packages/44/8c/84796304044a7f9f784ef4d3b2f1ba7f851323ec4c9f8bcb3ef290e26282/edx_rest_api_client-5.7.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "effa3c81759af41eb49e3662f68c5d8e72ccd82b5cba6c8f14eb2c4d99b707ad",
                "md5": "ca01c5f6cfa79e5df89c46b435914086",
                "sha256": "8b53cc57c2fb53ffbaf19cf88d3fee0c1de41358620d4d8cdc4aa482c47f9e32"
            },
            "downloads": -1,
            "filename": "edx_rest_api_client-5.7.1.tar.gz",
            "has_sig": false,
            "md5_digest": "ca01c5f6cfa79e5df89c46b435914086",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 15447,
            "upload_time": "2024-06-24T20:40:09",
            "upload_time_iso_8601": "2024-06-24T20:40:09.734857Z",
            "url": "https://files.pythonhosted.org/packages/ef/fa/3c81759af41eb49e3662f68c5d8e72ccd82b5cba6c8f14eb2c4d99b707ad/edx_rest_api_client-5.7.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-24 20:40:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "openedx",
    "github_project": "edx-rest-api-client",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "edx-rest-api-client"
}
        
edX
Elapsed time: 0.25306s