]> kaliko git repositories - python-musicpd.git/blobdiff - doc/source/index.rst
Releasing 0.9.0
[python-musicpd.git] / doc / source / index.rst
index c55d08dfe8be591c89a42f09363bddac9f3e1e5a..d16644bf2488e33129453af7f60fe1c7f222996a 100644 (file)
@@ -1,3 +1,6 @@
+.. SPDX-FileCopyrightText: 2018-2023  kaliko <kaliko@azylum.org>
+.. SPDX-License-Identifier: LGPL-3.0-or-later
+
 .. include:: ../../README.rst
 
 Installation
@@ -13,12 +16,37 @@ Installation
 
 .. code:: bash
 
-    pip install git+https://gitlab.com/kaliko/python-musicpd.git
+    pip install git+https://gitlab.com/kaliko/python-musicpd.git@dev
+
+
+Library overview
+================
+Here is a snippet allowing to list the last modified artists in the media library:
+
+.. code:: python3
+
+        #!/usr/bin/env python3
+        # coding: utf-8
+        import musicpd
+
+        def main():
+            cli = musicpd.MPDClient()
+            cli.connect()
+            # Gets files count in the library
+            nb_files = int(cli.stats()['songs'])
+            # Gets the last 100 files modified
+            files = cli.search('file', '', 'sort', 'Last-Modified', 'window', (nb_files-100,))
+            # Print last modified artists in media library
+            print(' / '.join({f.get('albumartist') for f in files}))
+            cli.disconnect()
 
+        # Script starts here
+        if __name__ == '__main__':
+            main()
 
 
 Build documentation
---------------------
+===================
 
 .. code:: bash
 
@@ -27,9 +55,7 @@ Build documentation
     # Installs sphinx if needed
     python3 -m venv venv && . ./venv/bin/activate
     pip install sphinx
-    # And build
-    python3 setup.py build_sphinx
-    # Or call sphinx
+    # Call sphinx
     sphinx-build -d ./doc/build/doctrees doc/source -b html ./doc/build/html
 
 
@@ -39,8 +65,11 @@ Contents
 .. toctree::
    :maxdepth: 2
 
+   self
    use.rst
    doc.rst
+   commands.rst
+   examples.rst
    contribute.rst
 
 
@@ -48,7 +77,6 @@ Indices and tables
 ==================
 
 * :ref:`genindex`
-* :ref:`modindex`
 * :ref:`search`