Server API

Data Containers

Core

The following are the underlying, lowest-level classes for holding data which can be sent over an EPICS V3 channel in caproto.

Numeric Data

Inheritance diagram of caproto.ChannelData, caproto.ChannelDouble, caproto.ChannelFloat, caproto.ChannelInteger, caproto.ChannelShort

caproto.ChannelData(*[, alarm, value, ...])

Base class holding data and metadata which can be sent across a Channel.

caproto.ChannelDouble(*[, precision])

64-bit floating point data and metadata which can be sent over a channel.

caproto.ChannelFloat(*[, precision])

32-bit floating point data and metadata which can be sent over a channel.

caproto.ChannelInteger(*, value[, units, ...])

32-bit LONG integer data and metadata which can be sent over a channel.

caproto.ChannelShort(*, value[, units, ...])

16-bit SHORT integer data and metadata which can be sent over a channel.

String or Byte Data

Inheritance diagram of caproto.ChannelByte, caproto.ChannelChar, caproto.ChannelEnum, caproto.ChannelString

caproto.ChannelByte(*[, string_encoding, ...])

8-bit unencoded CHAR data plus metadata which can be sent over a channel.

caproto.ChannelChar(*[, alarm, value, ...])

8-bit encoded CHAR data plus metadata which can be sent over a channel.

caproto.ChannelEnum(*[, enum_strings])

ENUM data which can be sent over a channel.

caproto.ChannelString(*[, alarm, value, ...])

8-bit encoded string data plus metadata which can be sent over a channel.

Base Class

The above share methods from their common (internal) base class ChannelData.

ChannelData(*[, alarm, value, timestamp, ...])

Base class holding data and metadata which can be sent across a Channel.

PvpropertyData

pvproperty builds on top of ChannelData with the following classes, separated by whether or not they are read-only.

caproto.server.PvpropertyData(*, pvname, ...)

A top-level class for mixing in with ChannelData subclasses.

Read/write

Inheritance diagram of caproto.server.PvpropertyBoolEnum, caproto.server.PvpropertyByte, caproto.server.PvpropertyChar, caproto.server.PvpropertyData, caproto.server.PvpropertyDouble, caproto.server.PvpropertyEnum, caproto.server.PvpropertyString

caproto.server.PvpropertyBoolEnum(*[, ...])

Read-write ENUM data for pvproperty, with Off/On as default strings.

caproto.server.PvpropertyByte(*, pvname, ...)

Read-write 8-bit CHAR data for pvproperty for bytes.

caproto.server.PvpropertyChar(*, pvname, ...)

Read-write 8-bit CHAR data for pvproperty with string encoding.

caproto.server.PvpropertyDouble(*, pvname, ...)

Read-write DOUBLE data for pvproperty (64 bits).

caproto.server.PvpropertyEnum(*[, ...])

Read-write ENUM data for pvproperty.

caproto.server.PvpropertyFloat(*, pvname, ...)

Read-write FLOAT data for pvproperty (32 bits).

caproto.server.PvpropertyInteger(*, pvname, ...)

Read-write LONG data for pvproperty (32 bits).

caproto.server.PvpropertyReadOnlyData(*, ...)

A mixin class which marks this data as read-only from channel access.

caproto.server.PvpropertyShort(*, pvname, ...)

Read-write SHORT/INT data for pvproperty (16 bits).

caproto.server.PvpropertyString(*, pvname, ...)

Read-write STRING data for pvproperty (up to 40 chars).

Read-only

Read-only data classes mix in with PvpropertyReadOnlyData.

Inheritance diagram of caproto.server.PvpropertyBoolEnumRO, caproto.server.PvpropertyByteRO, caproto.server.PvpropertyCharRO, caproto.server.PvpropertyData, caproto.server.PvpropertyDoubleRO, caproto.server.PvpropertyEnumRO, caproto.server.PvpropertyStringRO

caproto.server.PvpropertyBoolEnumRO(*[, ...])

Read-only ENUM data for pvproperty, with Off/On as default strings.

caproto.server.PvpropertyByteRO(*, pvname, ...)

Read-only 8-bit CHAR data for pvproperty for bytes.

caproto.server.PvpropertyCharRO(*, pvname, ...)

Read-only 8-bit CHAR data for pvproperty with string encoding.

caproto.server.PvpropertyDoubleRO(*, pvname, ...)

Read-only DOUBLE data for pvproperty (64 bits).

caproto.server.PvpropertyEnumRO(*[, ...])

Read-only ENUM data for pvproperty.

caproto.server.PvpropertyFloatRO(*, pvname, ...)

Read-only FLOAT data for pvproperty (32 bits).

caproto.server.PvpropertyIntegerRO(*, ...[, ...])

Read-only LONG data for pvproperty (32 bits).

caproto.server.PvpropertyShortRO(*, pvname, ...)

Read-only SHORT/INT data for pvproperty (16 bits).

caproto.server.PvpropertyStringRO(*, pvname, ...)

Read-only STRING data for pvproperty (up to 40 chars).

High-level API / pvproperty magic

caproto.server.PVSpec([get, put, startup, ...])

Create new instance of PVSpec(get, put, startup, shutdown, attr, name, dtype, value, max_length, alarm_group, read_only, doc, fields, scan, record, cls_kwargs)

caproto.server.expand_macros(pv, macros)

Expand a PV name with Python {format-style} macros

caproto.server.PVGroup(prefix, *[, macros, ...])

Class which groups a set of PVs for a high-level caproto server

caproto.server.pvproperty([get, put, ...])

A property-like descriptor for specifying a PV in a PVGroup.

caproto.server.PvpropertyData(*, pvname, ...)

A top-level class for mixing in with ChannelData subclasses.

caproto.server.SubGroup([group, prefix, ...])

A property-like descriptor for specifying a subgroup in a PVGroup.

caproto.server.pvfunction([func, default, ...])

A descriptor for making an RPC-like function.

caproto.server.expand_macros(pv, macros)

Expand a PV name with Python {format-style} macros

caproto.server.get_pv_pair_wrapper([...])

Generates a Subgroup class for a pair of PVs (setpoint and readback).

caproto.server.scan_wrapper(scan_function, ...)

Wrap a function intended for pvproperty.scan with common logic to periodically call it.

Command-line Helpers

Tools for helping to generate command-line argument parsers for use with IOCs.

caproto.server.template_arg_parser(*, desc, ...)

Construct a template arg parser for starting up an IOC

caproto.server.ioc_arg_parser(*, desc, ...)

A reusable ArgumentParser for basic example IOCs.

caproto.server.run(pvdb, *[, module_name, ...])

Run an IOC, given its PV database dictionary and async-library module name.

Advanced / Internal

The following are related to the internal mechanisms that PVGroup and pvproperty rely on.

caproto.server.server.FieldProxy(field_spec, ...)

A proxy class which allows access to pvproperty.fields.Field.

caproto.server.server.FieldSpec(prop, *, ...)

A field specification for a pvproperty record.

caproto.server.server.NestedPvproperty([...])

Nested pvproperty which allows decorator usage in parent class

caproto.server.server.PVGroupMeta(name, ...)

Metaclass that finds all pvproperties

Library-agnostic server core

Core Classes

These are mostly as-is by all server implementations.

caproto.server.AsyncLibraryLayer()

Library compatibility layer.

caproto.server.common.Subscription(mask, ...)

Create new instance of Subscription(mask, channel_filter, circuit, channel, data_type, data_count, subscriptionid, db_entry)

caproto.server.common.SubscriptionSpec(...)

Create new instance of SubscriptionSpec(db_entry, data_type_name, mask, channel_filter)

Base Classes

These are intended to be subclassed to implement support for a new async library.

caproto.server.common.Context(pvdb[, interfaces])

caproto.server.common.VirtualCircuit(...)

Exceptions

caproto.server.common.DisconnectedCircuit

caproto.server.common.LoopExit

asyncio server

Implementation classes

Classes built on top of the library-agnostic core, used to implement asyncio functionality.

caproto.asyncio.server.AsyncioAsyncLayer()

caproto.asyncio.server.Context(pvdb[, ...])

caproto.asyncio.server.Event

alias of AsyncioEvent

caproto.asyncio.server.ServerExit

caproto.asyncio.server.VirtualCircuit(...[, ...])

Wraps a caproto.VirtualCircuit with an asyncio client.

Helper functions

caproto.asyncio.server.run(pvdb, *[, ...])

Run an IOC, given its PV database dictionary.

caproto.asyncio.server.start_server(pvdb, *)

Start an asyncio server with a given PV database

Curio server

Implementation classes

Classes built on top of the library-agnostic core, used to implement asyncio functionality.

Inheritance diagram of caproto.curio.server.Context, caproto.curio.server.VirtualCircuit

caproto.curio.server.CurioAsyncLayer()

caproto.curio.server.Context(pvdb[, interfaces])

caproto.curio.server.Event()

caproto.curio.server.ServerExit

caproto.curio.server.VirtualCircuit(circuit, ...)

Wraps a caproto.VirtualCircuit with a curio client.

Helper functions

caproto.curio.server.run(pvdb, *[, ...])

Run an IOC, given its PV database dictionary.

caproto.curio.server.start_server(pvdb, *[, ...])

Start a curio server with a given PV database

Miscellaneous

caproto.curio.server.QueueWithFullError([...])

caproto.curio.server.QueueFull

caproto.curio.server.UniversalQueue(*[, ...])

Trio server

Implementation classes

Classes built on top of the library-agnostic core, used to implement asyncio functionality.

Inheritance diagram of caproto.trio.server.Context, caproto.trio.server.VirtualCircuit

caproto.trio.server.TrioAsyncLayer()

caproto.trio.server.Context(pvdb[, interfaces])

caproto.trio.server.Event()

The class wraps trio.Event and implements Event.clear() method that is used in the code, but deprecated in trio.

caproto.trio.server.ServerExit

caproto.trio.server.VirtualCircuit(circuit, ...)

Wraps a caproto.VirtualCircuit with a trio client.

Helper functions

caproto.trio.server.run(pvdb, *[, ...])

Run an IOC, given its PV database dictionary.

caproto.trio.server.start_server(pvdb, *[, ...])

Start a trio server with a given PV database