Skip to content

capturegraph.procedures.types #

Procedure Type System#

The type hierarchy for the CaptureGraph procedure system. All procedures declare a return type that extends PType, enabling strong typing and validation of data flows between procedures.

Type Hierarchy
PType
├── PVoid           # No return value
├── PDirectory      # File system directory
├── PFile           # File reference
├── PSaveable       # Can be saved to a single file
│   ├── PBool       # Boolean value
│   ├── PNumber     # Numeric value
│   ├── PString     # Text value
│   ├── PTime       # Timestamp
│   ├── PLocation   # GPS coordinates
│   ├── PWeather    # Weather conditions
│   ├── PImage      # Captured image
│   └── PUserID     # User identifier
└── PSaveableBundle # Saved as multiple files
    └── PImageSequence  # Multiple images

PType #

PType is the parent of all procedure types. Procedure types are used to denote what you can expect a procedure to return. They are all named with a P prefix to denote that they are procedure types, as otherwise they could be confused with standard types.

You might notice that these classes are all empty. This is because they are only used for type checking in python, as they mark the return type of procedures when they are executed. The actual data is handled by the app executing the procedure.

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PType:
    """
    PType is the parent of all procedure types. Procedure types are used
    to denote what you can expect a procedure to return. They are all named
    with a P prefix to denote that they are procedure types, as otherwise
    they could be confused with standard types.

    You might notice that these classes are all empty. This is because they
    are only used for type checking in python, as they mark the return type
    of procedures when they are executed. The actual data is handled by the
    app executing the procedure.
    """

PVoid #

Bases: PType

Represents procedures that perform actions but don't return data (like saving files).

They still need to return in order to indicate completion of the action.

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PVoid(PType):
    """
    Represents procedures that perform actions but don't return data (like saving files).

    They still need to return in order to indicate completion of the action.
    """

PDirectory #

Bases: PType

Represents a directory in the file system where data can be stored.

Directories can contain files and other directories. They can also be used to save and load bundles of data.

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PDirectory(PType):
    """
    Represents a directory in the file system where data can be stored.

    Directories can contain files and other directories. They can also be used to
    save and load bundles of data.
    """

PFile #

Bases: PType

Represents a file in the file system where individual data items can be saved.

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PFile(PType):
    """
    Represents a file in the file system where individual data items can be saved.
    """

PSaveable #

Bases: PType

Base class for data types that can be saved as individual files.

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PSaveable(PType):
    """Base class for data types that can be saved as individual files."""

PSaveableBundle #

Bases: PType

Base class for data types that are saved as bundles containing multiple items.

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PSaveableBundle(PType):
    """Base class for data types that are saved as bundles containing multiple items."""

PBool #

Bases: PSaveable

Represents boolean values (true/false) that can be stored and retrieved.

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PBool(PSaveable):
    """Represents boolean values (true/false) that can be stored and retrieved."""

PNumber #

Bases: PSaveable

Represents numeric values (integers or floats) for calculations and storage.

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PNumber(PSaveable):
    """Represents numeric values (integers or floats) for calculations and storage."""

PString #

Bases: PSaveable

Represents text data for labels, descriptions, and user input.

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PString(PSaveable):
    """Represents text data for labels, descriptions, and user input."""

PUserID #

Bases: PSaveable

Represents a unique identifier for a user.

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PUserID(PSaveable):
    """Represents a unique identifier for a user."""

PTime #

Bases: PSaveable

Represents timestamps for when data was captured or events occurred.

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PTime(PSaveable):
    """Represents timestamps for when data was captured or events occurred."""

PLocation #

Bases: PSaveable

Represents GPS coordinates and location metadata for geographic data capture.

Includes optional heading (compass direction in degrees 0-360) when captured with device orientation.

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PLocation(PSaveable):
    """Represents GPS coordinates and location metadata for geographic data capture.

    Includes optional heading (compass direction in degrees 0-360) when captured with device orientation.
    """

PWeather #

Bases: PSaveable

Represents weather conditions at the time and location of data capture.

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PWeather(PSaveable):
    """Represents weather conditions at the time and location of data capture."""

PImage #

Bases: PSaveable

Represents captured images from the device camera or processed image data.

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PImage(PSaveable):
    """Represents captured images from the device camera or processed image data."""

PVideo #

Bases: PSaveable

Represents captured video from the device camera.

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PVideo(PSaveable):
    """Represents captured video from the device camera."""

PImageThumbnail #

Bases: PSaveable

Represents smaller thumbnail versions of images for preview and organization.

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PImageThumbnail(PSaveable):
    """Represents smaller thumbnail versions of images for preview and organization."""

PImageSequence #

Bases: PSaveableBundle

Represents a sequence of related images captured together (e.g., for bursts).

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PImageSequence(PSaveableBundle):
    """Represents a sequence of related images captured together (e.g., for bursts)."""

PImageFlashPair #

Bases: PSaveableBundle

Represents a pair of images: one captured with flash, one without.

The bundle contains two named files: - flash: Image captured with flash enabled - no_flash: Image captured without flash

Source code in capturegraph-lib/capturegraph/procedures/types.py
class PImageFlashPair(PSaveableBundle):
    """Represents a pair of images: one captured with flash, one without.

    The bundle contains two named files:
    - flash: Image captured with flash enabled
    - no_flash: Image captured without flash
    """