Skip to content

Commit

Permalink
Initial commit for python bindings doc
Browse files Browse the repository at this point in the history
Signed-off-by: Travis F. Collins <[email protected]>
  • Loading branch information
tfcollins authored and rgetz committed Apr 8, 2020
1 parent 4f0bcc7 commit 7420fb0
Show file tree
Hide file tree
Showing 8 changed files with 178 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bindings/python/doc/buffer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Buffer
==================

Members
--------------
.. autoclass:: iio.Buffer
:members:
7 changes: 7 additions & 0 deletions bindings/python/doc/channel.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Channels
==================

Members
--------------
.. autoclass:: iio.Channel
:members:
58 changes: 58 additions & 0 deletions bindings/python/doc/conf.py.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('../.'))

import sphinx_rtd_theme

# -- Project information -----------------------------------------------------

project = '@PROJECT_NAME@'
copyright = '2020, Analog Devices, Inc.'
author = 'Paul Cercueil <[email protected]>'

# The full version, including alpha/beta/rc tags
release = '@LIBIIO_VERSION@'


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ["sphinx.ext.githubpages", "sphinx_rtd_theme", 'sphinx.ext.viewcode', 'sphinx.ext.autodoc']
#]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']

master_doc = 'index'
20 changes: 20 additions & 0 deletions bindings/python/doc/context.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Contexts
==================

Members
--------------
.. autoclass:: iio.Context
:members:

.. autoclass:: iio.LocalContext
:members:
:inherited-members:

.. autoclass:: iio.XMLContext
:members:
:inherited-members:

.. autoclass:: iio.NetworkContext
:members:
:inherited-members:

8 changes: 8 additions & 0 deletions bindings/python/doc/device.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Device
==================

Members
--------------
.. autoclass:: iio.Device
:members:
:inherited-members:
18 changes: 18 additions & 0 deletions bindings/python/doc/examples.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Examples
==================

Scan contexts and list channels of each device

.. code-block:: python
import iio
for ctxname in iio.scan_contexts():
ctx = iio.Context(ctxname)
for dev in ctx.devices:
if dev.channels:
for chan in dev.channels:
print("{} - {} - {}".format(ctxname, dev.name, chan._id))
else:
print("{} - {}".format(ctxname, dev.name))
52 changes: 52 additions & 0 deletions bindings/python/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
libiio Python Bindings
==================================

Python bindings for the Industrial I/O interface library.

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

The libiio python bindings can be installed from pip

.. code-block:: bash
(sudo) pip install libiio
or by grabbing the source directly

.. code-block:: bash
git clone https://github.com/analogdevicesinc/libiio.git
cd bindings/python
(sudo) python3 setup.py install
.. note::

On Linux the libiio python bindings are sometimes installed in locations not on path. On Ubuntu this is a common fix

.. code-block:: bash
export PYTHONPATH=$PYTHONPATH:/usr/lib/python{python-version}/site-packages
.. toctree::
:maxdepth: 1
:caption: Contents:

Components
==================
.. toctree::
:maxdepth: 1

context
buffer
device
channel
trigger
examples

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
8 changes: 8 additions & 0 deletions bindings/python/doc/trigger.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Trigger
==================

Members
--------------
.. autoclass:: iio.Trigger
:members:
:inherited-members:

0 comments on commit 7420fb0

Please sign in to comment.