Metadata-Version: 2.1
Name: yaplon
Version: 1.5.3
Summary: Python 3-based commandline converter CSV → YAML ↔ JSON ↔ PLIST ↔ XML
Home-page: https://twardoch.github.io/yaplon/
Author: Adam Twardoch
Author-email: adam+github@twardoch.com
License: MIT
Project-URL: Source, https://github.com/twardoch/yaplon/
Keywords: yaml json plist csv xml convert cli
Platform: UNKNOWN
Classifier: Environment :: Console
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.9
Description-Content-Type: text/x-rst
Requires-Dist: PyYAML (>=5.3.1)
Requires-Dist: click-stream (>=0.0.10)
Requires-Dist: click (>=7.1.2)
Requires-Dist: dict2xml (>=1.7.0)
Requires-Dist: orderedattrdict (>=1.6.0)
Requires-Dist: xmltodict (>=0.12.0)
Provides-Extra: dev
Requires-Dist: setuptools ; extra == 'dev'
Requires-Dist: wheel ; extra == 'dev'
Requires-Dist: pip ; extra == 'dev'
Requires-Dist: twine (>=3.2.0) ; extra == 'dev'
Requires-Dist: pyinstaller (>=4.0) ; extra == 'dev'
Requires-Dist: m2r (>=0.2.1) ; extra == 'dev'


yaplon
======

Convert between JSON, YAML and PLIST (binary and XML) in the commandline.
Can be used in piping. Written in Python 3.9 (not 2.7 compatible).


* Copyright (c) 2021 Adam Twardoch adam+github@twardoch.com
* Copyright (c) 2012-2015 Isaac Muse isaacmuse@gmail.com
* `MIT license <./LICENSE>`_
* Based on `Serialized Data Converter for Sublime Text <https://github.com/facelessuser/SerializedDataConverter>`_

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


* Install the `release version <https://pypi.org/project/yaplon/>`_\ :

.. code-block::

   pip3 install --user --upgrade yaplon


* Install the `development version <https://github.com/twardoch/yaplon>`_\ :

.. code-block::

   pip3 install --user --upgrade git+https://github.com/twardoch/yaplon

Usage
-----

.. code-block::

   yaplon [c|j|p|x|y]2[j|p|x|y] -i input -o output [options]

Commands:
^^^^^^^^^

.. code-block::

   c2j  -i CSV -o JSON [-d DIALECT] [-k KEY] [-m] (minify)
   c2p  -i CSV -o PLIST [-d DIALECT] [-k KEY] [-m] (minify)
   c2x  -i CSV -o XML [-d DIALECT] [-k KEY] [-m] (minify) [-S] (simple XML)
   c2y  -i CSV -o YAML [-d DIALECT] [-k KEY] [-m] (minify)
   j2p  -i JSON -o PLIST [-b] (make binary PLIST)
   j2x  -i JSON -o XML [-m] (minify) [-S] (simple XML)
   j2y  -i JSON -o YAML [-m] (minify YAML)
   p2j  -i PLIST -o JSON [-m] (minify) [-b] (keep binary)
   p2x  -i PLIST -o XML [-m] (minify) [-S] (simple XML)
   p2y  -i PLIST -o YAML [-m] (minify YAML)
   x2j  -i XML -o JSON [-m] (minify) [-b] (keep binary)
   x2p  -i XML -o PLIST [-b] (make binary PLIST)
   x2y  -i XML -o YAML [-m] (minify YAML)
   y2j  -i YAML -o JSON [-m] (minify) [-b] (keep binary)
   y2p  -i YAML -o PLIST [-b] (make binary PLIST)
   y2x  -i YAML -o XML [-m] (minify) [-S] (simple XML)

Also installs direct CLI tools that correspond to the commands:


* ``csv22json``\ , ``csv22plist``\ , ``csv22xml``\ , ``csv22yaml``\ ,
* ``json22plist``\ , ``json22xml``\ , ``json22yaml``\ ,
* ``plist22json``\ , ``plist22xml``\ , ``plist22yaml``\ ,
* ``xml22json``\ , ``xml22plist``\ , ``xml22yaml``\ ,
* ``yaml22json``\ , ``yaml22plist``\ , ``yaml22xml``

Note that they have ``22`` rather than ``2`` in the filenames, so they don’t conflict with other similar (often single-purpose) tools that you may have.

Examples
--------

JSON to YAML
^^^^^^^^^^^^

File to file via the dedicated CLI tool:

.. code-block::

   $ json22yaml -i input.json -o output.yaml

Using pipe redirects, via the yaplon tool with j2y command:

.. code-block::

   $ yaplon j2y < input.json > output.yaml

Read file, output minified to stdout, via the Python 3 module

.. code-block::

   $ python3 -m yaplon j2y -m -i input.json

PLIST to JSON
^^^^^^^^^^^^^

Read PLIST file, output minified JSON file, via the dedicated CLI tool.

.. code-block::

   $ plist22json -m -i input.plist > output.json

Read plist file, output minified JSON to stdout, via the yaplon tool with p2j command.

.. code-block::

   $ yaplon p2j -m -i input.plist

Changelog
---------


* 1.5.3: added CSV reading and limited XML read/write
* 1.2.7: removed obsolete plistlib.Data reference
* 1.2.3: bugfix
* 1.2.1: added support for orderedattrdict.AttrDict
* 1.1.0: added -s for sorting data
* 1.0.8: initial public release

Links
-----


* Project homepage: `https://twardoch.github.io/yaplon/ <https://twardoch.github.io/yaplon/>`_
* Python package on PyPi: `https://pypi.org/project/yaplon/ <https://pypi.org/project/yaplon/>`_
* Source on Github: `https://github.com/twardoch/yaplon <https://github.com/twardoch/yaplon>`_
* Donate via `https://www.paypal.me/adamtwar <https://www.paypal.me/adamtwar>`_


