authrocket-0.1.1
توضیحات
Unofficial AuthRocket API client
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | authrocket-0.1.1 |
| نام | authrocket |
| نسخه کتابخانه | 0.1.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Nathan Reynolds |
| ایمیل نویسنده | email@nreynolds.co.uk |
| آدرس صفحه اصلی | https://github.com/nathforge/authrocket |
| آدرس اینترنتی | https://pypi.org/project/authrocket/ |
| مجوز | - |
AuthRocket
==========
Unofficial `AuthRocket`_ `API`_ client. Extends the Requests library,
provides a few helper functions.
See also
--------
The `Requests`_ documentation.
Making a request
----------------
.. code:: python
import authrocket
# Create an API object.
# Config values can be found on your realm's integration page.
api = authrocket.API(
url="https://api-e1.authrocket.com/v1/",
key="ko_XYZ", # Must start with `ko_`, rather than old-style `key_`
realm_id="rl_ABC"
)
# Fetch the first page of users.
response = api.get("users")
print response.json()
Pagination
----------
Use ``iter_from_pages`` to handle paginated responses:
.. code:: python
for user in api.iter_from_pages("GET", "users"):
print user
Path variables
--------------
Some APIs take variables via the path, e.g “users/123”. Rather than use
string interpolation, you should pass these via the ``variables``
argument - it’s more secure. For example:
.. code:: python
response = api.get("user/{id}", variables={"id": "123"})
print response.json()
.. _AuthRocket: https://authrocket.com/
.. _API: https://authrocket.com/docs/api
.. _Requests: http://docs.python-requests.org/en/master/
نحوه نصب
نصب پکیج whl authrocket-0.1.1:
pip install authrocket-0.1.1.whl
نصب پکیج tar.gz authrocket-0.1.1:
pip install authrocket-0.1.1.tar.gz