Metadata-Version: 2.4
Name: speedbeesynapse-sccde
Version: 0.2.0
Summary: This package provides some tools for developing custom components of SpeeDBee-Synapse.
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Requires-Dist: click>=8.1.8
Requires-Dist: watchfiles>=0.24.0
Description-Content-Type: text/markdown

# sccde

**speedbeesynapse-sccde** is a command line tool for developing custom components for [SpeeDBee Synapse](https://www.saltyster.com/speedbee-synapse/).

## Install

```sh
$ python3 -m venv .venv
$ . ./.venv/bin/activate
(.venv) $ pip3 install speedbeesynapse-sccde
```

## How to use

* Initialize environment:

    ```sh
    (.venv) $ sccde init
    (.venv) $ ls
    parameter_ui  scc-info.json  source
    ```

* Add python component sample into the environment:

    ```sh
    (.venv) $ sccde add
    ```

* Make sccde package containing all custom components in the environment:

    ```sh
    (.venv) $ sccde make-package
    (.venv) $ ls
    custom_component_package_example.sccpkg  parameter_ui  scc-info.json  source
    ```

    You can use `.sccpkg` file for uploading to [SpeeDBee Synapse](https://www.saltyster.com/speedbee-synapse/)


## Other sub-commands.

* `prepare-dynlib-dir`

    The sub-command prepares dynamic library directory on the environment and puts the library path into `scc-info.json`.

    ```sh
    (.venv) $ sccde prepare-dynlib-dir
    (.venv) $ find dynlibs/
    dynlibs/
    dynlibs/ubuntu24x64
    dynlibs/dfc
    dynlibs/ubuntu24arm64
    dynlibs/windowsx64
    dynlibs/raspibookwormarm64
    dynlibs/nx5
    dynlibs/ubuntu22arm64
    dynlibs/blackbearv3
    dynlibs/ubuntu22x64
    ```

* `add-dynlib-entry`

    The sub-command adds dynamic library component entry into the environment.

    ```sh
    (.venv) $ sccde add-dynlib-entry -n "Component Name" -d "This is dynamic library component"
    ```

    This sub-command only adds an entry to `scc-info.json`, so the actual dynamic libraries (so/dll) must be placed under `dynlis` by the user.

* `check`

    The sub-command checks syntax and loadability for custom components in the environment.

    ```sh
    (.venv) $ sccde check
    Custom component package example (695c272b-5534-4702-9e6b-c09f8cbf8b60)
    Version: 0.1.0
    Description: Your package description here
    2 components:
    Sample collector(a43adb25-738e-4028-9ef0-1d569be94d9d)
        Read: OK
        Syntax: OK
        Load: NOT CHECKED
    Sample collector(a8193495-6433-446f-b3e5-cc49baae204e)
        Read: OK
        Syntax: OK
        Load: NOT CHECKED
    (.venv) $ sccde check --load
    Custom component package example (695c272b-5534-4702-9e6b-c09f8cbf8b60)
    Version: 0.1.0
    Description: Your package description here
    2 components:
    Sample collector(a43adb25-738e-4028-9ef0-1d569be94d9d)
        Read: OK
        Syntax: OK
        Load: NG
        | Traceback (most recent call last):
        |    :
        |   File "./source/python/sample_collector_1.py", line 109, in <module>
        |     raise Exception
        | Exception
        | 
    Sample collector(a8193495-6433-446f-b3e5-cc49baae204e)
        Read: OK
        Syntax: OK
        Load: OK
    Error: "Sample collector"
    ```
