Metadata-Version: 2.4
Name: kinto-wizard
Version: 5.1.1
Summary: kinto-wizard is a tool to configure a kinto server from an YAML file.
Author-email: Mozilla Services <developers@kinto-storage.org>
License: Copyright 2012 - Mozilla Foundation
        
        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-URL: Repository, https://github.com/Kinto/kinto-wizard
Keywords: web services
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
Classifier: License :: OSI Approved :: Apache Software License
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: jsonschema
Requires-Dist: kinto-http>=11.9
Requires-Dist: ruamel.yaml>0.15
Provides-Extra: dev
Requires-Dist: kinto; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cache; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: pytest-xdist; extra == "dev"
Dynamic: license-file

kinto-wizard
============

|pypi| |ci|

.. |pypi| image:: https://img.shields.io/pypi/v/kinto-wizard.svg
    :target: https://pypi.python.org/pypi/kinto-wizard
.. |ci| image::  https://img.shields.io/github/actions/workflow/status/Kinto/kinto-wizard/test.yml?branch=main
    :target: https://github.com/Kinto/kinto-wizard/actions

kinto-wizard is a tool that lets you setup an entire Kinto server from
a Yaml file, or inspect an existing server and output a Yaml file.

You can define Kinto objects (bucket, collection, groups, records)
and configure their attributes and permissions.

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

Use pip:

.. code-block:: bash

    $ pip install kinto-wizard


How to use it?
--------------

Load
~~~~

.. code-block:: bash

    kinto-wizard load \
        --server https://kinto-writer.stage.mozaws.net/v1 \
        --auth admin:credentials \
        new-config.yml

The load command also accepts these options:

* ``--attachments`` - Load the attachments files from the specified folder

Dump
~~~~

.. code-block:: bash

    kinto-wizard dump \
        --server https://kinto-writer.stage.mozaws.net/v1 \
        --auth admin:credentials \
        > current-config.yml

The dump command also accepts these options:

* ``--data`` - Include buckets, collections and groups data (attachments, schemas, display fields, uischema etc.).
* ``--records`` - Include collections` records.
* ``--attachments`` - Save the attachments files into the specified folder
* ``--full`` - Combination of data and records.

Validate a dump
---------------

The way Kinto works is by letting you change a collection schema but
won't enforce the new schema for existing records.

When you dump a collection and its records, you can end-up having
records that Kinto won't let you upload back because the schema
changed and they are invalid with the current schema.

This can lead to unexpected behavior on loading time which is a bit
cumbersome because depending of the size of the file you are loading,
it can takes a long time before getting an actual error.

In order to fix the file before loading, you can use the validate
command that would give you the error Kinto would return if you were
to load the file on a Kinto server.


.. code-block:: bash

    kinto-wizard validate current-config.yml


Development
-----------

See `contributing docs <./.github/CONTRIBUTING.md>`_

Contributors
============

* Rémy Hubscher <rhubscher@mozilla.com>
* Mathieu Leplatre <mathieu@mozilla.com>
* Gabriela Surita <gabsurita@gmail.com>
