beets/docs/plugins/export.rst
FichteFoll aa31fea037
Update a lot of URLs to use HTTPS
*All* URLs were checked manually, but only once per domain!

I mostly concerned myself with URLs in documentation rather than source
code because the latter may or may not have impactful changes, while the
former should be straight forward.

Changes in addition to simply adding an s:

- changed pip and pypi references as their location has changed
- MPoD (iOS app) url redirects to Regelian, so I replaced those
- updated homebrew references

Notable observations:

- beets.io does have HTTPS set up properly (via gh-pages)
- beatport.py uses the old HTTP url for beatport
- as does lyrics.py for lyrics.wikia.com
- https://tomahawk-player.org/ expired long ago, but the http page
  redirects to https regardless
- none of the sourceforge subdomains have https (in 2019!)
2019-06-05 03:11:49 +02:00

65 lines
1.9 KiB
ReStructuredText

Export Plugin
=============
The ``export`` plugin lets you get data from the items and export the content
as `JSON`_.
.. _JSON: https://www.json.org
Enable the ``export`` plugin (see :ref:`using-plugins` for help). Then, type ``beet export`` followed by a :doc:`query </reference/query>` to get the data from
your library. For example, run this::
$ beet export beatles
to print a JSON file containing information about your Beatles tracks.
Command-Line Options
--------------------
The ``export`` command has these command-line options:
* ``--include-keys`` or ``-i``: Choose the properties to include in the output
data. The argument is a comma-separated list of simple glob patterns where
``*`` matches any string. For example::
$ beet export -i 'title,mb*' beatles
will include the ``title`` property and all properties starting with
``mb``. You can add the ``-i`` option multiple times to the command
line.
* ``--library`` or ``-l``: Show data from the library database instead of the
files' tags.
* ``--output`` or ``-o``: Path for an output file. If not informed, will print
the data in the console.
* ``--append``: Appends the data to the file instead of writing.
Configuration
-------------
To configure the plugin, make a ``export:`` section in your configuration
file. Under the ``json`` key, these options are available:
- **ensure_ascii**: Escape non-ASCII characters with ``\uXXXX`` entities.
- **indent**: The number of spaces for indentation.
- **separators**: A ``[item_separator, dict_separator]`` tuple.
- **sort_keys**: Sorts the keys in JSON dictionaries.
These options match the options from the `Python json module`_.
.. _Python json module: https://docs.python.org/2/library/json.html#basic-usage
The default options look like this::
export:
json:
formatting:
ensure_ascii: False
indent: 4
separators: [',' , ': ']
sort_keys: true