Metadata-Version: 2.1
Name: softioc
Version: 3.0b1
Summary: Embed an EPICS IOC in a Python process
Home-page: https://github.com/dls-controls/pythonIoc
Author: Michael Abbott
Author-email: Michael.Abbott@diamond.ac.uk
License: Apache License 2.0
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7
Description-Content-Type: text/x-rst

pythonIoc
=========

|code_ci| |docs_ci| |coverage| |pypi_version| |license|


This module allows an EPICS IOC with Python Device Support to be run from within
the Python interpreter. Records can be programmatically created and arbitrary
Python code run to updated them and respond to caputs. It supports cothread and
asyncio for concurrency.

============== ==============================================================
PyPI           ``pip install softioc``
Source code    https://github.com/dls-controls/pythonIoc
Documentation  https://dls-controls.github.io/pythonIoc
============== ==============================================================

A simple example of the use of this library is the following:

.. code:: python

    # Import the basic framework components.
    from softioc import softioc, builder
    import cothread

    # Set the record prefix
    builder.SetDeviceName("MY-DEVICE-PREFIX")

    # Create some records
    ai = builder.aIn('AI', initial_value=5)
    ao = builder.aOut('AO', initial_value=12.45, on_update=lambda v: ai.set(v))

    # Boilerplate get the IOC started
    builder.LoadDatabase()
    softioc.iocInit()

    # Start processes required to be run after iocInit
    def update():
        while True:
            ai.set(ai.get() + 1)
            cothread.Sleep(1)

    cothread.Spawn(update)

    # Finally leave the IOC running with an interactive shell.
    softioc.interactive_ioc(globals())


.. |code_ci| image:: https://github.com/dls-controls/pythonIoc/workflows/Code%20CI/badge.svg?branch=master
    :target: https://github.com/dls-controls/pythonIoc/actions?query=workflow%3A%22Code+CI%22
    :alt: Code CI

.. |docs_ci| image:: https://github.com/dls-controls/pythonIoc/workflows/Docs%20CI/badge.svg?branch=master
    :target: https://github.com/dls-controls/pythonIoc/actions?query=workflow%3A%22Docs+CI%22
    :alt: Docs CI

.. |coverage| image:: https://codecov.io/gh/dls-controls/pythonIoc/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/dls-controls/pythonIoc
    :alt: Test Coverage

.. |pypi_version| image:: https://img.shields.io/pypi/v/pythonIoc.svg
    :target: https://pypi.org/project/pythonIoc
    :alt: Latest PyPI version

.. |license| image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg
    :target: https://opensource.org/licenses/Apache-2.0
    :alt: Apache License

..
    Anything below this line is used when viewing README.rst and will be replaced
    when included in index.rst

See https://dls-controls.github.io/pythonIoc for more detailed documentation.

