kinto-http


Namekinto-http JSON
Version 11.0.1 PyPI version JSON
download
home_pagehttps://github.com/Kinto/kinto-http.py/
SummaryKinto client
upload_time2023-04-05 16:31:33
maintainer
docs_urlNone
authorMozilla Services
requires_python
licenseApache License (2.0)
keywords web services
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            Kinto python client
###################

.. image:: https://github.com/Kinto/kinto-http.py/actions/workflows/test.yml/badge.svg
        :target: https://github.com/Kinto/kinto-http.py/actions

.. image:: https://img.shields.io/pypi/v/kinto-http.svg
        :target: https://pypi.python.org/pypi/kinto-http

.. image:: https://coveralls.io/repos/Kinto/kinto-http.py/badge.svg?branch=master
        :target: https://coveralls.io/r/Kinto/kinto-http.py


*kinto-http* is the Python library to interact with a *Kinto* server.

There is also a similar `client in JavaScript <https://github.com/kinto/kinto-http.js>`_.


Installation
============

Use pip::

  $ pip install kinto-http


Usage
=====

Here is an overview of what the API provides:

.. code-block:: python

    import kinto_http

    client = kinto_http.Client(server_url="http://localhost:8888/v1",
                               auth=('alexis', 'p4ssw0rd'))

    records = client.get_records(bucket='default', collection='todos')
    for i, record in enumerate(records):
        record['title'] = 'Todo {}'.format(i)
        client.update_record(data=record)


Instantiating a client
----------------------

The passed ``auth`` parameter is a `requests <http://docs.python-requests.org>`_
authentication policy.

By default, a simple tuple will become a ``Basic Auth`` authorization request header, that can authenticate users with `Kinto Accounts <https://kinto.readthedocs.io/en/stable/api/1.x/accounts.html>`_.

.. code-block:: python

    import kinto_http

    auth = ('alexis', 'p4ssw0rd')

    client = kinto_http.Client(server_url='http://localhost:8888/v1',
                               auth=auth)

It is also possible to pass a ``bucket`` ID and/or ``collection`` ID to set them as default values for the parameters of the client operations.

.. code-block:: python

    client = Client(bucket="payments", collection="receipts", auth=auth)

After creating a client, you can also replicate an existing one and overwrite
some key arguments.

.. code-block:: python

    client2 = client.clone(collection="orders")

An asynchronous client is also available. It has all the same endpoints as the sync client except for the batch operations.

.. code-block:: python

    from kinto_http import AsyncClient

    auth = ('alexis', 'p4ssw0rd')

    client = AsyncClient(server_url='http://localhost:8888/v1', auth=auth)
    info = await client.server_info()
    assert 'schema' in info['capabilities'], "Server doesn't support schema validation."

Using a Bearer access token to authenticate (OpenID)
----------------------------------------------------

.. code-block:: python

    import kinto_http

    client = kinto_http.Client(auth=kinto_http.BearerTokenAuth("XYPJTNsFKV2"))


The authorization header is prefixed with ``Bearer`` by default. If the ``header_type``
is `customized on the server <https://kinto.readthedocs.io/en/stable/configuration/settings.html#openid-connect>`_,
the client must specify the expected type: ``kinto_http.BearerTokenAuth("XYPJTNsFKV2", type="Bearer+OIDC")``

.. note::

    Passing a string containing ``Bearer`` will be instantiate a ``kinto_http.BearerTokenAuth()`` object automatically.

    In other words, ``kinto_http.Client(auth="Bearer+OIDC XYPJTNsFKV2")`` is equivalent to ``kinto_http.Client(auth=kinto_http.BearerTokenAuth("XYPJTNsFKV2", type="Bearer+OIDC"))``


Custom headers
--------------

Custom headers can be specified in the Client constructor, and will be sent in every request:

.. code-block:: python

    import kinto_http

    client = kinto_http.Client(server_url="http://server/v1", headers={
        "Allow-Access": "CDN",
        "User-Agent": "blocklist-updater"
    })


Getting server information
--------------------------

You can use the ``server_info()`` method to fetch the server information:

.. code-block:: python

    from kinto_http import Client

    client = Client(server_url='http://localhost:8888/v1')
    info = client.server_info()
    assert 'schema' in info['capabilities'], "Server doesn't support schema validation."


Bucket operations
-----------------

* ``get_bucket(id=None, **kwargs)``: retrieve single bucket
* ``get_buckets(**kwargs)``: retrieve all readable buckets
* ``create_bucket(id=None, data=None, **kwargs)``: create a bucket
* ``update_bucket(id=None, data=None, **kwargs)``: create or replace an existing bucket
* ``patch_bucket(id=None, changes=None, **kwargs)``: modify some fields in an existing bucket
* ``delete_bucket(id=None, **kwargs)``: delete a bucket and everything under it
* ``delete_buckets(**kwargs)``: delete every writable buckets


Groups operations
-----------------

* ``get_group(id=None, bucket=None, **kwargs)``: retrieve single group
* ``get_groups(bucket=None, **kwargs)``: retrieve all readable groups
* ``create_group(id=None, data=None, bucket=None, **kwargs)``: create a group
* ``update_group(id=None, data=None, bucket=None, **kwargs)``: create or replace an existing group
* ``patch_group(id=None, changes=None, bucket=None, **kwargs)``: modify some fields in an existing group
* ``delete_group(id=None, bucket=None, **kwargs)``: delete a group and everything under it
* ``delete_groups(bucket=None, **kwargs)``: delete every writable groups


Collections
-----------

* ``get_collection(id=None, bucket=None, **kwargs)``: retrieve single collection
* ``get_collections(bucket=None, **kwargs)``: retrieve all readable collections
* ``create_collection(id=None, data=None, bucket=None, **kwargs)``: create a collection
* ``update_collection(id=None, data=None, bucket=None, **kwargs)``: create or replace an existing collection
* ``patch_collection(id=None, changes=None, bucket=None, **kwargs)``: modify some fields in an existing collection
* ``delete_collection(id=None, bucket=None, **kwargs)``: delete a collection and everything under it
* ``delete_collections(bucket=None, **kwargs)``: delete every writable collections


Records
-------

* ``get_record(id=None, bucket=None, collection=None, **kwargs)``: retrieve single record
* ``get_records(bucket=None, collection=None, **kwargs)``: retrieve all readable records
* ``get_paginated_records(bucket=None, collection=None, **kwargs)``: paginated list of records
* ``get_records_timestamp(bucket=None, collection=None, **kwargs)``: return the records timestamp of this collection
* ``create_record(id=None, data=None, bucket=None, collection=None, **kwargs)``: create a record
* ``update_record(id=None, data=None, bucket=None, collection=None, **kwargs)``: create or replace an existing record
* ``patch_record(id=None, changes=None, bucket=None, collection=None, **kwargs)``: modify some fields in an existing record
* ``delete_record(id=None, bucket=None, collection=None, **kwargs)``: delete a record and everything under it
* ``delete_records(bucket=None, collection=None, **kwargs)``: delete every writable records


Permissions
-----------

The objects permissions can be specified or modified by passing a ``permissions`` to ``create_*()``, ``patch_*()``, or ``update_*()`` methods:

.. code-block:: python

    client.create_record(data={'foo': 'bar'},
                         permissions={'read': ['group:groupid']})


    record = client.get_record('123', collection='todos', bucket='alexis')
    record['permissions']['write'].append('leplatrem')
    client.update_record(data=record)


Get or create
-------------

In some cases, you might want to create a bucket, collection, group or record only if
it doesn't exist already. To do so, you can pass the ``if_not_exists=True``
to the ``create_*()`` methods::

  client.create_bucket(id='blog', if_not_exists=True)
  client.create_collection(id='articles', bucket='blog', if_not_exists=True)


Delete if exists
----------------

In some cases, you might want to delete a bucket, collection, group or record only if
it exists already. To do so, you can pass the ``if_exists=True``
to the ``delete_*`` methods::

  client.delete_bucket(id='bucket', if_exists=True)


Patch operations
----------------

The ``.patch_*()`` operations receive a ``changes`` parameter.


.. code-block:: python

    from kinto_http.patch_type import BasicPatch, MergePatch, JSONPatch


    client.patch_record(id='abc', changes=BasicPatch({'over': 'write'}))

    client.patch_record(id='todo', changes=MergePatch({'assignee': 'bob'}))

    client.patch_record(id='receipts', changes=JSONPatch([
        {'op': 'add', 'path': '/data/members/0', 'value': 'ldap:user@corp.com'}
    ]))


Concurrency control
-------------------

The ``create_*()``, ``patch_*()``, and ``update_*()`` methods take a ``safe`` argument (default: ``True``).

If ``True``, the client will ensure that the object doesn't exist already for creations, or wasn't modified on the server side since we fetched it. The timestamp will be implicitly read from the ``last_modified`` field in the passed ``data`` object, or taken explicitly from the ``if_match`` parameter.


Batching operations
-------------------

Rather than issuing a request for each and every operation, it is possible to
batch several operations in one request (sync client only).

Using the ``batch()`` method as a Python context manager (``with``):

.. code-block:: python

  with client.batch() as batch:
      for idx in range(0, 100):
          batch.update_record(data={'id': idx})

.. note::

    Besides the ``results()`` method, a batch object shares all the same methods as
    another client.

Reading data from batch operations is achieved by using the ``results()`` method
available after a batch context is closed.

.. code-block:: python

  with client.batch() as batch:
      batch.get_record('r1')
      batch.get_record('r2')
      batch.get_record('r3')

  r1, r2, r3 = batch.results()


Errors
------

Failing operations will raise a ``KintoException``, which has ``request`` and ``response`` attributes.

.. code-block:: python

    try:
        client.create_group(id="friends")
    except kinto_http.KintoException as e:
        if e.response and e.response.status_code == 403:
            print("Not allowed!")


Requests Timeout
----------------

A ``timeout`` value in seconds can be specified in the client constructor:

.. code-block:: python

    client = KintoClient(server_url="...", timeout=5)

To distinguish the connect from the read timeout, use a tuple:

.. code-block:: python

    client = KintoClient(server_url="...", timeout=(3.05, 27))

For an infinit timeout, use ``None``:

.. code-block:: python

    client = KintoClient(server_url="...", timeout=None)

See the `timeout documentation <https://2.python-requests.org//en/master/user/advanced/#timeouts>`_ of the underlying ``requests`` library.


Retry on error
--------------

When the server is throttled (under heavy load or maintenance) it can
return error responses.

The client can hence retry to send the same request until it succeeds.
To enable this, specify the number of retries on the client:

.. code-block:: python

  client = Client(server_url='http://localhost:8888/v1',
                  auth=credentials,
                  retry=10)

The Kinto protocol lets the server `define the duration in seconds between retries
<https://kinto.readthedocs.io/en/latest/api/1.x/backoff.html>`_.
It is possible (but not recommended) to force this value in the clients:

.. code-block:: python

  client = Client(server_url='http://localhost:8888/v1',
                  auth=credentials,
                  retry=10,
                  retry_after=5)

Pagination
----------

When the server responses are paginated, the client will download every page and
merge them transparently.

The ``get_paginated_records()`` method returns a generator that will yield each page:


.. code-block:: python

  for page in client.get_paginated_records():
      records = page["data"]

It is possible to specify a limit for the number of items to be retrieved in one page:

.. code-block:: python

    records = client.get_records(_limit=10)

In order to retrieve every available pages with a limited number of items in each
of them, you can specify the number of pages:

.. code-block:: python

    records = client.get_records(_limit=10, pages=float('inf'))  # Infinity


History
-------

If the built-in `history plugin <https://kinto.readthedocs.io/en/latest/api/1.x/history.html>`_ is enabled, it is possible to retrieve the history of changes:

.. code-block:: python

    # Get the complete history of a bucket
    changes = client.get_history(bucket='default')

    # and optionally use filters
    hist = client.get_history(bucket='default', _limit=2, _sort='-last_modified', _since='1533762576015')
    hist = client.get_history(bucket='default', resource_name='collection')


The history of a bucket can also be purged with:

.. code-block:: python

    client.purge_history(bucket='default')


Endpoint URLs
-------------

The ``get_endpoint()`` method returns an endpoint URL on the server:

.. code-block:: python

    client = Client(server_url='http://localhost:8888/v1',
                    auth=('token', 'your-token'),
                    bucket="payments",
                    collection="receipts")

    print(client.get_endpoint("record",
                              id="c6894b2c-1856-11e6-9415-3c970ede22b0"))

    # '/buckets/payments/collections/receipts/records/c6894b2c-1856-11e6-9415-3c970ede22b0'


Handling datetime and date objects
----------------------------------

In addition to the data types supported by JSON, kinto-http.py also
supports native Python date and datetime objects.

In case a payload contain a date or a datetime object, kinto-http.py
will encode it as an ISO formatted string.

Please note that this transformation is only one-way. While reading a
record, if a string contains a ISO formated string, kinto-http.py will
not convert it to a native Python date or datetime object.

If you know that a field will be a datetime, you might consider
encoding it yourself to be more explicit about it being a string for
Kinto.



Command-line scripts
--------------------

In order to have common arguments and options for scripts, some utilities are provided
to ease configuration and initialization of client from command-line arguments.

.. code-block:: python

  import argparse
  import logging

  from kinto_http import cli_utils

  logger = logging.getLogger(__name__)

  if __name__ == "__main__":
      parser = argparse.ArgumentParser(description="Download records")
      cli_utils.set_parser_server_options(parser)

      args = parser.parse_args()

      cli_utils.setup_logger(logger, args)

      logger.debug("Instantiate Kinto client.")
      client = cli_utils.create_client_from_args(args)

      logger.info("Fetch records.")
      records = client.get_records()
      logger.warn("{} records.".format(len(records)))

The script now accepts basic options:

::

  $ python example.py --help

  usage: example.py [-h] [-s SERVER] [-a AUTH] [-b BUCKET] [-c COLLECTION] [-v]
                    [-q] [-D]

  Download records

  optional arguments:
    -h, --help            show this help message and exit
    -s SERVER, --server SERVER
                          The location of the remote server (with prefix)
    -a AUTH, --auth AUTH  BasicAuth credentials: `token:my-secret` or
                          Authorization header: `Bearer token`
    -b BUCKET, --bucket BUCKET
                          Bucket name.
    -c COLLECTION, --collection COLLECTION
                          Collection name.
    --retry RETRY         Number of retries when a request fails
    --retry-after RETRY_AFTER
                          Delay in seconds between retries when requests fail
                          (default: provided by server)
    -v, --verbose         Show all messages.
    -q, --quiet           Show only critical errors.
    -D, --debug           Show all messages, including debug messages.


Run tests
=========

In one terminal, run a Kinto server:

::

    $ make run-kinto

In another, run the tests against it:

::

    $ make tests


(Optional) Install a git hook:

::

    therapist install


CHANGELOG
#########

This document describes changes between each past release.


11.0.1 (2023-04-05)
===================

**Bug fixes**

- Fix ``clone()`` method with subclasses (#307)
- Do not send body in ``GET`` requests (#306)


11.0.0 (2022-08-22)
===================

- Remove pinned versions in dependencies


10.10.1 (2022-07-05)
====================

**Bug fixes**

- Fix breaking change introduced in previous version, accept empty string in ``auth`` parameter


10.10.0 (2022-06-27)
====================

**New features**

- Use Bearer token Auth object if specified string for ``auth`` contains ``Bearer``
- Use Basic Auth if specified string for ``auth`` contains ``:``


10.9.0 (2022-02-04)
===================

**New features**

- Access client configured bucket and collection names at ``client.bucket_name`` and ``client.collection_name`` respectively.

10.8.0 (2021-12-03)
===================

**New features**

- Asynchronous client is now available: ``from kinto_http import AsyncClient`` (`#268 <https://github.com/Kinto/kinto-http.py/pull/268>`_)

**Internal changes**

- Replaced ``unittest`` with ``pytest``


10.7.0 (2020-01-09)
===================

**New features**

- Add ability to specify headers from Client constructor


10.6.1 (2019-11-13)
===================

**Bug fixes**

- Do not try to parse content on ``204 No Content`` responses


10.6.0 (2019-09-20)
===================

**New features**

- Specify requests timeout in client constructor


10.5.0 (2019-09-10)
===================

**New features**

- Add history support (fixes #112), Thanks @FlorianKuckelkorn!


10.4.1 (2019-05-22)
===================

**Bug fixes**

- Handle bearer tokens without a colon.


10.4.0 (2019-05-09)
===================

- Add support for Bearer tokens in the CLI utilities.
- Use black for code formatting.


10.3.0 (2019-03-07)
===================

**New features**

- Add support for OAuth access tokens (OpenID) with the ``BearerTokenAuth()`` helper. See README. (#197)


10.2.0 (2018-12-17)
===================

**New features**

- Created new method on client to get paginated records ``get_paginated_records``. (#175)
- Allow additional querystring params in ``get_*()`` methods

10.1.1 (2018-11-13)
===================

**Bug fixes**

- Fix JSON support for ``in_`` and ``exclude_``. (#188)


10.1.0 (2018-11-05)
===================

 **New feature**

 - Convert params values as JSON values before passing them to requests. (#185)


10.0.0 (2018-10-15)
===================

**Breaking changes**

By default, the client now raises an exception when a 4XX error occurs in a batch request (#154)

In order to ignore those errors as before, instantiate the client with ``ignore_batch_4xx=True``.

**New feature**

- Raise a specific ``CollectionNotFound`` exception rather than a generic ``KintoException``.

**Bug fixes**

- Handle date and datetime object in a Kinto payload. They will be
  formated as ISO date JSON strings.

**Internal changes**

- Update tests to work with Kinto 11.0.0.
- Update tests to use stdlib mock module.

9.1.2 (2018-04-17)
==================

**Internal changes**

- Get rid of ``six``


9.1.1 (2018-02-07)
==================

**Bug fixes**

- Fix patch methods in batch requests (fixes #171)

9.1.0 (2018-02-05)
==================

**Significant changes**

- When the server returns a ``409 Conflict`` error response, the request will
  be retried if the ``retry`` parameter is superior to zero (fixes #167)

**New Features**

- Expose kinto-http and Python module version in the User-Agent (#157)
- Support different PATCH types. Now, instead of settling for the
  "default" patch method offered by the Kinto server, you can choose
  by importing a PatchType subclass from ``kinto_http.patch_type``. (Fixes #125.)

**Bug fixes**

- No longer support ``method`` arguments on the ``update_bucket``,
  ``update_group``, ``update_collection``, and ``update_record``
  methods. This argument only existed to support the ``patch_*``
  methods and was never intended to be part of the public API.

9.0.1 (2017-05-30)
==================

**Bug fixes**

- Fix exception rendering (fixes #153)

9.0.0 (2017-05-25)
==================

**Breaking changes**

- The client will fail a batch only when a 5XX error occurs (#148)

**New Features**

- Log all the batch responses (#148)
- Log the request and the batch responses in debug (#148)
- Allow reading responses from batch requests with the ``results()`` method. (#146)


8.0.1 (2017-05-16)
==================

**Bug fixes**

- Fix get_records_timestamp JSONDecode error while trying to decode
  the body of a HEAD response. (#144)


8.0.0 (2017-05-11)
==================

**Breaking changes**

- Fetch only one page when ``_limit`` is specified and allow to override this
  with a ``pages`` argument (fixes #136)
- Make client methods API consistent by forcing keyword parameters (#119)
- Deduce the ``id`` of a resource with the value of ``id`` in ``data`` if present (#143)
- Drop Python 2.7 support. Now supports Python 3.5+

**New Features**

- Keep tracks of Backoff headers and raise an ``BackoffException`` if
  we are not waiting enough between two calls. (#53)
- Add ``--retry`` and ``--retry-after`` to CLI utils helpers (fixes #126)

**Bug fixes**

- Fix retry behaviour when responses are successful (fixes #129)
- Fix Retry-After value to be read as integer rather than string. (#131)
- Fix No JSON could be decoded ValueError (fixes #116)

**Internal changes**

- ``make tests-once`` to run functional tests in order to calculate coverage correctly (#131)


7.2.0 (2017-03-17)
==================

- Only provide the ``data`` JSON field when data is provided. (#122)


7.1.0 (2017-03-16)
==================

**Bug fixes**

- Method for plural endpoints now return list of objects instead of ``odict_values``.

**New features**

- Add logging (fixes #36, #110, thanks @sahildua2305)

**Documentation**

- Fix explanation about safe/if_match/last_modified
- Fix missing methods in docs (#102, thanks @gabisurita)
- Improve contributing guide (#104, #111,  thanks @Sayli-Karnik)
- Show how to use the FxABearerTokenAuth auth (#117)


7.0.0 (2016-09-30)
==================

**Breaking changes**

- Removed ``if_exists`` argument from the ``delete_*s`` methods for plural endpoints
  (#98, thanks @mansimarkaur!)

**New features**

- Added CRUD methods for the group endpoints (#95, thanks @mansimarkaur!)

**Documentation**

- Add contributing guide (#90, thanks @sahildua2305!)


6.2.1 (2016-09-08)
==================

**New features**

- Add a ``if_exists`` flag to delete methods to avoid raising if the
  item was already deleted. (#82)
- Improving the ``clone`` method to keep all the previous parameters values
  if missing as parameters. (#91)


6.1.0 (2016-08-04)
==================

**New features**

- Add a ``get_records_timestamp`` method to get the collection ``ETag``. (#81)


6.0.0 (2016-06-10)
==================

**Breaking changes**

- Rename kinto_client to kinto_http (#74)


5.0.0 (2016-05-12)
==================

**Breaking changes**

- Rename the ``last_modified`` client parameter into ``if_match`` (#68)

**New features**

- Display a better message when having 403 on create_collection and
  create_record methods (#49)
- Expose ``get_endpoints`` as part of the client API (#60)
- Add a ``server_info`` method to retrieve the root url info (#70)

**Internal changes**

- Rename the Batch class into BatchSession (#52)
- Change readthedocs.org urls in readthedocs.io (#71)


4.1.0 (2016-04-26)
==================

**New features**

- Add new methods ``get_buckets()``, ``delete_buckets()``, ``delete_bucket()``,
  ``delete_collections()``, ``delete_records()``, ``patch_record()`` (#55)

**Internal changes**

- Functional tests are now tested on Kinto master version (#65)


4.0.0 (2016-03-08)
==================

**Breaking changes**

- The function ``cli_utils.set_parser_server_options()`` was renamed
  ``cli_utils.add_parser_options()`` (#63)


**New features**

- ``add_parser_options`` can now exclude bucket and collection
  parameters. (#63)
- ``create_client_from_args`` can now works even with no bucket or
  collection arguments (#63)


**Bug fixes**

- Do not sent body in GET requests. (#62)


3.1.0 (2016-02-16)
==================

**New features**

- Add CLI helpers to configure and instantiate a Client from command-line arguments
  (#59)


3.0.0 (2016-02-10)
==================

**Breaking changes**

- Updated the ``update_collection()`` signature: data is now the fisr argument
  (#47)

**New features**

- Added a retry option for batch requests (#51)
- Use the "default" bucket if nothing is specified (#50)
- Added a ``if_not_exists`` argument to the creation methods (#42)
- Added a replication mechanism in ``kinto_http.replication`` (#26)
- Handle the ``last_modified`` argument on update or create operations (#24)

**Bug fixes**

- Do not force the JSON content-type in requests if multipart-encoded files are
  sent (#27)
- Fail the batch operations early (#47)
- Remove un-needed requirements (FxA) (#43)
- Use ``max_batch_request`` from the server to issue more than one batch request
  (#30)
- Make sure batch raises an error when needed (#28)
- Fix an invalid platform error for some versions of python (#31)
- Do not lowercase valid IDs (#33)

**Documentation**

- Add documentation about client.batch (#44)


2.0.0 (2015-11-18)
==================

- Added support for pagination in records requests (#13)
- Added support for If-Match / If-None-Match headers for not overwriting
  existing records (#14)
- Changed the API of the batch support. There is now a ``client.batch()`` context
  manager (#17)
- Added support of the PATCH methods to update records / collections (#19)


1.0.0 (2015-11-09)
==================

**Breaking changes**

- Rewrote the API to be easier to use (#10)


0.2.0 (2015-10-28)
==================

**Breaking changes**

- Rename kintoclient to kinto_client (#8)

**Features**

- Add the endpoints class. (#9)
- Add batching utilities. (#9)

**Internal changes**

- Add universal wheel configuration.


0.1.1 (2015-09-03)
==================

**Initial version**

- A client to synchroneously call a Kinto server.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Kinto/kinto-http.py/",
    "name": "kinto-http",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "web services",
    "author": "Mozilla Services",
    "author_email": "storage@mozilla.com",
    "download_url": "https://files.pythonhosted.org/packages/2c/60/3e6c19c772996e008428aa9e6563bfa08484dd8816da65a0a26f40b3e37e/kinto-http-11.0.1.tar.gz",
    "platform": null,
    "description": "Kinto python client\n###################\n\n.. image:: https://github.com/Kinto/kinto-http.py/actions/workflows/test.yml/badge.svg\n        :target: https://github.com/Kinto/kinto-http.py/actions\n\n.. image:: https://img.shields.io/pypi/v/kinto-http.svg\n        :target: https://pypi.python.org/pypi/kinto-http\n\n.. image:: https://coveralls.io/repos/Kinto/kinto-http.py/badge.svg?branch=master\n        :target: https://coveralls.io/r/Kinto/kinto-http.py\n\n\n*kinto-http* is the Python library to interact with a *Kinto* server.\n\nThere is also a similar `client in JavaScript <https://github.com/kinto/kinto-http.js>`_.\n\n\nInstallation\n============\n\nUse pip::\n\n  $ pip install kinto-http\n\n\nUsage\n=====\n\nHere is an overview of what the API provides:\n\n.. code-block:: python\n\n    import kinto_http\n\n    client = kinto_http.Client(server_url=\"http://localhost:8888/v1\",\n                               auth=('alexis', 'p4ssw0rd'))\n\n    records = client.get_records(bucket='default', collection='todos')\n    for i, record in enumerate(records):\n        record['title'] = 'Todo {}'.format(i)\n        client.update_record(data=record)\n\n\nInstantiating a client\n----------------------\n\nThe passed ``auth`` parameter is a `requests <http://docs.python-requests.org>`_\nauthentication policy.\n\nBy default, a simple tuple will become a ``Basic Auth`` authorization request header, that can authenticate users with `Kinto Accounts <https://kinto.readthedocs.io/en/stable/api/1.x/accounts.html>`_.\n\n.. code-block:: python\n\n    import kinto_http\n\n    auth = ('alexis', 'p4ssw0rd')\n\n    client = kinto_http.Client(server_url='http://localhost:8888/v1',\n                               auth=auth)\n\nIt is also possible to pass a ``bucket`` ID and/or ``collection`` ID to set them as default values for the parameters of the client operations.\n\n.. code-block:: python\n\n    client = Client(bucket=\"payments\", collection=\"receipts\", auth=auth)\n\nAfter creating a client, you can also replicate an existing one and overwrite\nsome key arguments.\n\n.. code-block:: python\n\n    client2 = client.clone(collection=\"orders\")\n\nAn asynchronous client is also available. It has all the same endpoints as the sync client except for the batch operations.\n\n.. code-block:: python\n\n    from kinto_http import AsyncClient\n\n    auth = ('alexis', 'p4ssw0rd')\n\n    client = AsyncClient(server_url='http://localhost:8888/v1', auth=auth)\n    info = await client.server_info()\n    assert 'schema' in info['capabilities'], \"Server doesn't support schema validation.\"\n\nUsing a Bearer access token to authenticate (OpenID)\n----------------------------------------------------\n\n.. code-block:: python\n\n    import kinto_http\n\n    client = kinto_http.Client(auth=kinto_http.BearerTokenAuth(\"XYPJTNsFKV2\"))\n\n\nThe authorization header is prefixed with ``Bearer`` by default. If the ``header_type``\nis `customized on the server <https://kinto.readthedocs.io/en/stable/configuration/settings.html#openid-connect>`_,\nthe client must specify the expected type: ``kinto_http.BearerTokenAuth(\"XYPJTNsFKV2\", type=\"Bearer+OIDC\")``\n\n.. note::\n\n    Passing a string containing ``Bearer`` will be instantiate a ``kinto_http.BearerTokenAuth()`` object automatically.\n\n    In other words, ``kinto_http.Client(auth=\"Bearer+OIDC XYPJTNsFKV2\")`` is equivalent to ``kinto_http.Client(auth=kinto_http.BearerTokenAuth(\"XYPJTNsFKV2\", type=\"Bearer+OIDC\"))``\n\n\nCustom headers\n--------------\n\nCustom headers can be specified in the Client constructor, and will be sent in every request:\n\n.. code-block:: python\n\n    import kinto_http\n\n    client = kinto_http.Client(server_url=\"http://server/v1\", headers={\n        \"Allow-Access\": \"CDN\",\n        \"User-Agent\": \"blocklist-updater\"\n    })\n\n\nGetting server information\n--------------------------\n\nYou can use the ``server_info()`` method to fetch the server information:\n\n.. code-block:: python\n\n    from kinto_http import Client\n\n    client = Client(server_url='http://localhost:8888/v1')\n    info = client.server_info()\n    assert 'schema' in info['capabilities'], \"Server doesn't support schema validation.\"\n\n\nBucket operations\n-----------------\n\n* ``get_bucket(id=None, **kwargs)``: retrieve single bucket\n* ``get_buckets(**kwargs)``: retrieve all readable buckets\n* ``create_bucket(id=None, data=None, **kwargs)``: create a bucket\n* ``update_bucket(id=None, data=None, **kwargs)``: create or replace an existing bucket\n* ``patch_bucket(id=None, changes=None, **kwargs)``: modify some fields in an existing bucket\n* ``delete_bucket(id=None, **kwargs)``: delete a bucket and everything under it\n* ``delete_buckets(**kwargs)``: delete every writable buckets\n\n\nGroups operations\n-----------------\n\n* ``get_group(id=None, bucket=None, **kwargs)``: retrieve single group\n* ``get_groups(bucket=None, **kwargs)``: retrieve all readable groups\n* ``create_group(id=None, data=None, bucket=None, **kwargs)``: create a group\n* ``update_group(id=None, data=None, bucket=None, **kwargs)``: create or replace an existing group\n* ``patch_group(id=None, changes=None, bucket=None, **kwargs)``: modify some fields in an existing group\n* ``delete_group(id=None, bucket=None, **kwargs)``: delete a group and everything under it\n* ``delete_groups(bucket=None, **kwargs)``: delete every writable groups\n\n\nCollections\n-----------\n\n* ``get_collection(id=None, bucket=None, **kwargs)``: retrieve single collection\n* ``get_collections(bucket=None, **kwargs)``: retrieve all readable collections\n* ``create_collection(id=None, data=None, bucket=None, **kwargs)``: create a collection\n* ``update_collection(id=None, data=None, bucket=None, **kwargs)``: create or replace an existing collection\n* ``patch_collection(id=None, changes=None, bucket=None, **kwargs)``: modify some fields in an existing collection\n* ``delete_collection(id=None, bucket=None, **kwargs)``: delete a collection and everything under it\n* ``delete_collections(bucket=None, **kwargs)``: delete every writable collections\n\n\nRecords\n-------\n\n* ``get_record(id=None, bucket=None, collection=None, **kwargs)``: retrieve single record\n* ``get_records(bucket=None, collection=None, **kwargs)``: retrieve all readable records\n* ``get_paginated_records(bucket=None, collection=None, **kwargs)``: paginated list of records\n* ``get_records_timestamp(bucket=None, collection=None, **kwargs)``: return the records timestamp of this collection\n* ``create_record(id=None, data=None, bucket=None, collection=None, **kwargs)``: create a record\n* ``update_record(id=None, data=None, bucket=None, collection=None, **kwargs)``: create or replace an existing record\n* ``patch_record(id=None, changes=None, bucket=None, collection=None, **kwargs)``: modify some fields in an existing record\n* ``delete_record(id=None, bucket=None, collection=None, **kwargs)``: delete a record and everything under it\n* ``delete_records(bucket=None, collection=None, **kwargs)``: delete every writable records\n\n\nPermissions\n-----------\n\nThe objects permissions can be specified or modified by passing a ``permissions`` to ``create_*()``, ``patch_*()``, or ``update_*()`` methods:\n\n.. code-block:: python\n\n    client.create_record(data={'foo': 'bar'},\n                         permissions={'read': ['group:groupid']})\n\n\n    record = client.get_record('123', collection='todos', bucket='alexis')\n    record['permissions']['write'].append('leplatrem')\n    client.update_record(data=record)\n\n\nGet or create\n-------------\n\nIn some cases, you might want to create a bucket, collection, group or record only if\nit doesn't exist already. To do so, you can pass the ``if_not_exists=True``\nto the ``create_*()`` methods::\n\n  client.create_bucket(id='blog', if_not_exists=True)\n  client.create_collection(id='articles', bucket='blog', if_not_exists=True)\n\n\nDelete if exists\n----------------\n\nIn some cases, you might want to delete a bucket, collection, group or record only if\nit exists already. To do so, you can pass the ``if_exists=True``\nto the ``delete_*`` methods::\n\n  client.delete_bucket(id='bucket', if_exists=True)\n\n\nPatch operations\n----------------\n\nThe ``.patch_*()`` operations receive a ``changes`` parameter.\n\n\n.. code-block:: python\n\n    from kinto_http.patch_type import BasicPatch, MergePatch, JSONPatch\n\n\n    client.patch_record(id='abc', changes=BasicPatch({'over': 'write'}))\n\n    client.patch_record(id='todo', changes=MergePatch({'assignee': 'bob'}))\n\n    client.patch_record(id='receipts', changes=JSONPatch([\n        {'op': 'add', 'path': '/data/members/0', 'value': 'ldap:user@corp.com'}\n    ]))\n\n\nConcurrency control\n-------------------\n\nThe ``create_*()``, ``patch_*()``, and ``update_*()`` methods take a ``safe`` argument (default: ``True``).\n\nIf ``True``, the client will ensure that the object doesn't exist already for creations, or wasn't modified on the server side since we fetched it. The timestamp will be implicitly read from the ``last_modified`` field in the passed ``data`` object, or taken explicitly from the ``if_match`` parameter.\n\n\nBatching operations\n-------------------\n\nRather than issuing a request for each and every operation, it is possible to\nbatch several operations in one request (sync client only).\n\nUsing the ``batch()`` method as a Python context manager (``with``):\n\n.. code-block:: python\n\n  with client.batch() as batch:\n      for idx in range(0, 100):\n          batch.update_record(data={'id': idx})\n\n.. note::\n\n    Besides the ``results()`` method, a batch object shares all the same methods as\n    another client.\n\nReading data from batch operations is achieved by using the ``results()`` method\navailable after a batch context is closed.\n\n.. code-block:: python\n\n  with client.batch() as batch:\n      batch.get_record('r1')\n      batch.get_record('r2')\n      batch.get_record('r3')\n\n  r1, r2, r3 = batch.results()\n\n\nErrors\n------\n\nFailing operations will raise a ``KintoException``, which has ``request`` and ``response`` attributes.\n\n.. code-block:: python\n\n    try:\n        client.create_group(id=\"friends\")\n    except kinto_http.KintoException as e:\n        if e.response and e.response.status_code == 403:\n            print(\"Not allowed!\")\n\n\nRequests Timeout\n----------------\n\nA ``timeout`` value in seconds can be specified in the client constructor:\n\n.. code-block:: python\n\n    client = KintoClient(server_url=\"...\", timeout=5)\n\nTo distinguish the connect from the read timeout, use a tuple:\n\n.. code-block:: python\n\n    client = KintoClient(server_url=\"...\", timeout=(3.05, 27))\n\nFor an infinit timeout, use ``None``:\n\n.. code-block:: python\n\n    client = KintoClient(server_url=\"...\", timeout=None)\n\nSee the `timeout documentation <https://2.python-requests.org//en/master/user/advanced/#timeouts>`_ of the underlying ``requests`` library.\n\n\nRetry on error\n--------------\n\nWhen the server is throttled (under heavy load or maintenance) it can\nreturn error responses.\n\nThe client can hence retry to send the same request until it succeeds.\nTo enable this, specify the number of retries on the client:\n\n.. code-block:: python\n\n  client = Client(server_url='http://localhost:8888/v1',\n                  auth=credentials,\n                  retry=10)\n\nThe Kinto protocol lets the server `define the duration in seconds between retries\n<https://kinto.readthedocs.io/en/latest/api/1.x/backoff.html>`_.\nIt is possible (but not recommended) to force this value in the clients:\n\n.. code-block:: python\n\n  client = Client(server_url='http://localhost:8888/v1',\n                  auth=credentials,\n                  retry=10,\n                  retry_after=5)\n\nPagination\n----------\n\nWhen the server responses are paginated, the client will download every page and\nmerge them transparently.\n\nThe ``get_paginated_records()`` method returns a generator that will yield each page:\n\n\n.. code-block:: python\n\n  for page in client.get_paginated_records():\n      records = page[\"data\"]\n\nIt is possible to specify a limit for the number of items to be retrieved in one page:\n\n.. code-block:: python\n\n    records = client.get_records(_limit=10)\n\nIn order to retrieve every available pages with a limited number of items in each\nof them, you can specify the number of pages:\n\n.. code-block:: python\n\n    records = client.get_records(_limit=10, pages=float('inf'))  # Infinity\n\n\nHistory\n-------\n\nIf the built-in `history plugin <https://kinto.readthedocs.io/en/latest/api/1.x/history.html>`_ is enabled, it is possible to retrieve the history of changes:\n\n.. code-block:: python\n\n    # Get the complete history of a bucket\n    changes = client.get_history(bucket='default')\n\n    # and optionally use filters\n    hist = client.get_history(bucket='default', _limit=2, _sort='-last_modified', _since='1533762576015')\n    hist = client.get_history(bucket='default', resource_name='collection')\n\n\nThe history of a bucket can also be purged with:\n\n.. code-block:: python\n\n    client.purge_history(bucket='default')\n\n\nEndpoint URLs\n-------------\n\nThe ``get_endpoint()`` method returns an endpoint URL on the server:\n\n.. code-block:: python\n\n    client = Client(server_url='http://localhost:8888/v1',\n                    auth=('token', 'your-token'),\n                    bucket=\"payments\",\n                    collection=\"receipts\")\n\n    print(client.get_endpoint(\"record\",\n                              id=\"c6894b2c-1856-11e6-9415-3c970ede22b0\"))\n\n    # '/buckets/payments/collections/receipts/records/c6894b2c-1856-11e6-9415-3c970ede22b0'\n\n\nHandling datetime and date objects\n----------------------------------\n\nIn addition to the data types supported by JSON, kinto-http.py also\nsupports native Python date and datetime objects.\n\nIn case a payload contain a date or a datetime object, kinto-http.py\nwill encode it as an ISO formatted string.\n\nPlease note that this transformation is only one-way. While reading a\nrecord, if a string contains a ISO formated string, kinto-http.py will\nnot convert it to a native Python date or datetime object.\n\nIf you know that a field will be a datetime, you might consider\nencoding it yourself to be more explicit about it being a string for\nKinto.\n\n\n\nCommand-line scripts\n--------------------\n\nIn order to have common arguments and options for scripts, some utilities are provided\nto ease configuration and initialization of client from command-line arguments.\n\n.. code-block:: python\n\n  import argparse\n  import logging\n\n  from kinto_http import cli_utils\n\n  logger = logging.getLogger(__name__)\n\n  if __name__ == \"__main__\":\n      parser = argparse.ArgumentParser(description=\"Download records\")\n      cli_utils.set_parser_server_options(parser)\n\n      args = parser.parse_args()\n\n      cli_utils.setup_logger(logger, args)\n\n      logger.debug(\"Instantiate Kinto client.\")\n      client = cli_utils.create_client_from_args(args)\n\n      logger.info(\"Fetch records.\")\n      records = client.get_records()\n      logger.warn(\"{} records.\".format(len(records)))\n\nThe script now accepts basic options:\n\n::\n\n  $ python example.py --help\n\n  usage: example.py [-h] [-s SERVER] [-a AUTH] [-b BUCKET] [-c COLLECTION] [-v]\n                    [-q] [-D]\n\n  Download records\n\n  optional arguments:\n    -h, --help            show this help message and exit\n    -s SERVER, --server SERVER\n                          The location of the remote server (with prefix)\n    -a AUTH, --auth AUTH  BasicAuth credentials: `token:my-secret` or\n                          Authorization header: `Bearer token`\n    -b BUCKET, --bucket BUCKET\n                          Bucket name.\n    -c COLLECTION, --collection COLLECTION\n                          Collection name.\n    --retry RETRY         Number of retries when a request fails\n    --retry-after RETRY_AFTER\n                          Delay in seconds between retries when requests fail\n                          (default: provided by server)\n    -v, --verbose         Show all messages.\n    -q, --quiet           Show only critical errors.\n    -D, --debug           Show all messages, including debug messages.\n\n\nRun tests\n=========\n\nIn one terminal, run a Kinto server:\n\n::\n\n    $ make run-kinto\n\nIn another, run the tests against it:\n\n::\n\n    $ make tests\n\n\n(Optional) Install a git hook:\n\n::\n\n    therapist install\n\n\nCHANGELOG\n#########\n\nThis document describes changes between each past release.\n\n\n11.0.1 (2023-04-05)\n===================\n\n**Bug fixes**\n\n- Fix ``clone()`` method with subclasses (#307)\n- Do not send body in ``GET`` requests (#306)\n\n\n11.0.0 (2022-08-22)\n===================\n\n- Remove pinned versions in dependencies\n\n\n10.10.1 (2022-07-05)\n====================\n\n**Bug fixes**\n\n- Fix breaking change introduced in previous version, accept empty string in ``auth`` parameter\n\n\n10.10.0 (2022-06-27)\n====================\n\n**New features**\n\n- Use Bearer token Auth object if specified string for ``auth`` contains ``Bearer``\n- Use Basic Auth if specified string for ``auth`` contains ``:``\n\n\n10.9.0 (2022-02-04)\n===================\n\n**New features**\n\n- Access client configured bucket and collection names at ``client.bucket_name`` and ``client.collection_name`` respectively.\n\n10.8.0 (2021-12-03)\n===================\n\n**New features**\n\n- Asynchronous client is now available: ``from kinto_http import AsyncClient`` (`#268 <https://github.com/Kinto/kinto-http.py/pull/268>`_)\n\n**Internal changes**\n\n- Replaced ``unittest`` with ``pytest``\n\n\n10.7.0 (2020-01-09)\n===================\n\n**New features**\n\n- Add ability to specify headers from Client constructor\n\n\n10.6.1 (2019-11-13)\n===================\n\n**Bug fixes**\n\n- Do not try to parse content on ``204 No Content`` responses\n\n\n10.6.0 (2019-09-20)\n===================\n\n**New features**\n\n- Specify requests timeout in client constructor\n\n\n10.5.0 (2019-09-10)\n===================\n\n**New features**\n\n- Add history support (fixes #112), Thanks @FlorianKuckelkorn!\n\n\n10.4.1 (2019-05-22)\n===================\n\n**Bug fixes**\n\n- Handle bearer tokens without a colon.\n\n\n10.4.0 (2019-05-09)\n===================\n\n- Add support for Bearer tokens in the CLI utilities.\n- Use black for code formatting.\n\n\n10.3.0 (2019-03-07)\n===================\n\n**New features**\n\n- Add support for OAuth access tokens (OpenID) with the ``BearerTokenAuth()`` helper. See README. (#197)\n\n\n10.2.0 (2018-12-17)\n===================\n\n**New features**\n\n- Created new method on client to get paginated records ``get_paginated_records``. (#175)\n- Allow additional querystring params in ``get_*()`` methods\n\n10.1.1 (2018-11-13)\n===================\n\n**Bug fixes**\n\n- Fix JSON support for ``in_`` and ``exclude_``. (#188)\n\n\n10.1.0 (2018-11-05)\n===================\n\n **New feature**\n\n - Convert params values as JSON values before passing them to requests. (#185)\n\n\n10.0.0 (2018-10-15)\n===================\n\n**Breaking changes**\n\nBy default, the client now raises an exception when a 4XX error occurs in a batch request (#154)\n\nIn order to ignore those errors as before, instantiate the client with ``ignore_batch_4xx=True``.\n\n**New feature**\n\n- Raise a specific ``CollectionNotFound`` exception rather than a generic ``KintoException``.\n\n**Bug fixes**\n\n- Handle date and datetime object in a Kinto payload. They will be\n  formated as ISO date JSON strings.\n\n**Internal changes**\n\n- Update tests to work with Kinto 11.0.0.\n- Update tests to use stdlib mock module.\n\n9.1.2 (2018-04-17)\n==================\n\n**Internal changes**\n\n- Get rid of ``six``\n\n\n9.1.1 (2018-02-07)\n==================\n\n**Bug fixes**\n\n- Fix patch methods in batch requests (fixes #171)\n\n9.1.0 (2018-02-05)\n==================\n\n**Significant changes**\n\n- When the server returns a ``409 Conflict`` error response, the request will\n  be retried if the ``retry`` parameter is superior to zero (fixes #167)\n\n**New Features**\n\n- Expose kinto-http and Python module version in the User-Agent (#157)\n- Support different PATCH types. Now, instead of settling for the\n  \"default\" patch method offered by the Kinto server, you can choose\n  by importing a PatchType subclass from ``kinto_http.patch_type``. (Fixes #125.)\n\n**Bug fixes**\n\n- No longer support ``method`` arguments on the ``update_bucket``,\n  ``update_group``, ``update_collection``, and ``update_record``\n  methods. This argument only existed to support the ``patch_*``\n  methods and was never intended to be part of the public API.\n\n9.0.1 (2017-05-30)\n==================\n\n**Bug fixes**\n\n- Fix exception rendering (fixes #153)\n\n9.0.0 (2017-05-25)\n==================\n\n**Breaking changes**\n\n- The client will fail a batch only when a 5XX error occurs (#148)\n\n**New Features**\n\n- Log all the batch responses (#148)\n- Log the request and the batch responses in debug (#148)\n- Allow reading responses from batch requests with the ``results()`` method. (#146)\n\n\n8.0.1 (2017-05-16)\n==================\n\n**Bug fixes**\n\n- Fix get_records_timestamp JSONDecode error while trying to decode\n  the body of a HEAD response. (#144)\n\n\n8.0.0 (2017-05-11)\n==================\n\n**Breaking changes**\n\n- Fetch only one page when ``_limit`` is specified and allow to override this\n  with a ``pages`` argument (fixes #136)\n- Make client methods API consistent by forcing keyword parameters (#119)\n- Deduce the ``id`` of a resource with the value of ``id`` in ``data`` if present (#143)\n- Drop Python 2.7 support. Now supports Python 3.5+\n\n**New Features**\n\n- Keep tracks of Backoff headers and raise an ``BackoffException`` if\n  we are not waiting enough between two calls. (#53)\n- Add ``--retry`` and ``--retry-after`` to CLI utils helpers (fixes #126)\n\n**Bug fixes**\n\n- Fix retry behaviour when responses are successful (fixes #129)\n- Fix Retry-After value to be read as integer rather than string. (#131)\n- Fix No JSON could be decoded ValueError (fixes #116)\n\n**Internal changes**\n\n- ``make tests-once`` to run functional tests in order to calculate coverage correctly (#131)\n\n\n7.2.0 (2017-03-17)\n==================\n\n- Only provide the ``data`` JSON field when data is provided. (#122)\n\n\n7.1.0 (2017-03-16)\n==================\n\n**Bug fixes**\n\n- Method for plural endpoints now return list of objects instead of ``odict_values``.\n\n**New features**\n\n- Add logging (fixes #36, #110, thanks @sahildua2305)\n\n**Documentation**\n\n- Fix explanation about safe/if_match/last_modified\n- Fix missing methods in docs (#102, thanks @gabisurita)\n- Improve contributing guide (#104, #111,  thanks @Sayli-Karnik)\n- Show how to use the FxABearerTokenAuth auth (#117)\n\n\n7.0.0 (2016-09-30)\n==================\n\n**Breaking changes**\n\n- Removed ``if_exists`` argument from the ``delete_*s`` methods for plural endpoints\n  (#98, thanks @mansimarkaur!)\n\n**New features**\n\n- Added CRUD methods for the group endpoints (#95, thanks @mansimarkaur!)\n\n**Documentation**\n\n- Add contributing guide (#90, thanks @sahildua2305!)\n\n\n6.2.1 (2016-09-08)\n==================\n\n**New features**\n\n- Add a ``if_exists`` flag to delete methods to avoid raising if the\n  item was already deleted. (#82)\n- Improving the ``clone`` method to keep all the previous parameters values\n  if missing as parameters. (#91)\n\n\n6.1.0 (2016-08-04)\n==================\n\n**New features**\n\n- Add a ``get_records_timestamp`` method to get the collection ``ETag``. (#81)\n\n\n6.0.0 (2016-06-10)\n==================\n\n**Breaking changes**\n\n- Rename kinto_client to kinto_http (#74)\n\n\n5.0.0 (2016-05-12)\n==================\n\n**Breaking changes**\n\n- Rename the ``last_modified`` client parameter into ``if_match`` (#68)\n\n**New features**\n\n- Display a better message when having 403 on create_collection and\n  create_record methods (#49)\n- Expose ``get_endpoints`` as part of the client API (#60)\n- Add a ``server_info`` method to retrieve the root url info (#70)\n\n**Internal changes**\n\n- Rename the Batch class into BatchSession (#52)\n- Change readthedocs.org urls in readthedocs.io (#71)\n\n\n4.1.0 (2016-04-26)\n==================\n\n**New features**\n\n- Add new methods ``get_buckets()``, ``delete_buckets()``, ``delete_bucket()``,\n  ``delete_collections()``, ``delete_records()``, ``patch_record()`` (#55)\n\n**Internal changes**\n\n- Functional tests are now tested on Kinto master version (#65)\n\n\n4.0.0 (2016-03-08)\n==================\n\n**Breaking changes**\n\n- The function ``cli_utils.set_parser_server_options()`` was renamed\n  ``cli_utils.add_parser_options()`` (#63)\n\n\n**New features**\n\n- ``add_parser_options`` can now exclude bucket and collection\n  parameters. (#63)\n- ``create_client_from_args`` can now works even with no bucket or\n  collection arguments (#63)\n\n\n**Bug fixes**\n\n- Do not sent body in GET requests. (#62)\n\n\n3.1.0 (2016-02-16)\n==================\n\n**New features**\n\n- Add CLI helpers to configure and instantiate a Client from command-line arguments\n  (#59)\n\n\n3.0.0 (2016-02-10)\n==================\n\n**Breaking changes**\n\n- Updated the ``update_collection()`` signature: data is now the fisr argument\n  (#47)\n\n**New features**\n\n- Added a retry option for batch requests (#51)\n- Use the \"default\" bucket if nothing is specified (#50)\n- Added a ``if_not_exists`` argument to the creation methods (#42)\n- Added a replication mechanism in ``kinto_http.replication`` (#26)\n- Handle the ``last_modified`` argument on update or create operations (#24)\n\n**Bug fixes**\n\n- Do not force the JSON content-type in requests if multipart-encoded files are\n  sent (#27)\n- Fail the batch operations early (#47)\n- Remove un-needed requirements (FxA) (#43)\n- Use ``max_batch_request`` from the server to issue more than one batch request\n  (#30)\n- Make sure batch raises an error when needed (#28)\n- Fix an invalid platform error for some versions of python (#31)\n- Do not lowercase valid IDs (#33)\n\n**Documentation**\n\n- Add documentation about client.batch (#44)\n\n\n2.0.0 (2015-11-18)\n==================\n\n- Added support for pagination in records requests (#13)\n- Added support for If-Match / If-None-Match headers for not overwriting\n  existing records (#14)\n- Changed the API of the batch support. There is now a ``client.batch()`` context\n  manager (#17)\n- Added support of the PATCH methods to update records / collections (#19)\n\n\n1.0.0 (2015-11-09)\n==================\n\n**Breaking changes**\n\n- Rewrote the API to be easier to use (#10)\n\n\n0.2.0 (2015-10-28)\n==================\n\n**Breaking changes**\n\n- Rename kintoclient to kinto_client (#8)\n\n**Features**\n\n- Add the endpoints class. (#9)\n- Add batching utilities. (#9)\n\n**Internal changes**\n\n- Add universal wheel configuration.\n\n\n0.1.1 (2015-09-03)\n==================\n\n**Initial version**\n\n- A client to synchroneously call a Kinto server.\n",
    "bugtrack_url": null,
    "license": "Apache License (2.0)",
    "summary": "Kinto client",
    "version": "11.0.1",
    "split_keywords": [
        "web",
        "services"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "31daafc94590f80f6619d88f966c73be274a7acd733b94459b691184f9138307",
                "md5": "d0df8d11b0beb4aaf6fbc0b5853c05d3",
                "sha256": "294ef42073a4accd577468525f5d8ed30003c6eaaaa1f091e46cd0993d6fceb6"
            },
            "downloads": -1,
            "filename": "kinto_http-11.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d0df8d11b0beb4aaf6fbc0b5853c05d3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 57162,
            "upload_time": "2023-04-05T16:31:31",
            "upload_time_iso_8601": "2023-04-05T16:31:31.039013Z",
            "url": "https://files.pythonhosted.org/packages/31/da/afc94590f80f6619d88f966c73be274a7acd733b94459b691184f9138307/kinto_http-11.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2c603e6c19c772996e008428aa9e6563bfa08484dd8816da65a0a26f40b3e37e",
                "md5": "6be01b59e54e482d265b4caca256d0a3",
                "sha256": "baf213bf137b3b9819cf14b51e0fb798adf1040ded5f065f99b386943762d4f9"
            },
            "downloads": -1,
            "filename": "kinto-http-11.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "6be01b59e54e482d265b4caca256d0a3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 65606,
            "upload_time": "2023-04-05T16:31:33",
            "upload_time_iso_8601": "2023-04-05T16:31:33.257003Z",
            "url": "https://files.pythonhosted.org/packages/2c/60/3e6c19c772996e008428aa9e6563bfa08484dd8816da65a0a26f40b3e37e/kinto-http-11.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-05 16:31:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "Kinto",
    "github_project": "kinto-http.py",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "kinto-http"
}
        
Elapsed time: 0.05635s