Skip to content

Commit

Permalink
📝 [docs] Update SDK documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
alicerunsonfedora committed Feb 13, 2021
1 parent 88f3be3 commit ee34dd5
Showing 1 changed file with 44 additions and 4 deletions.
48 changes: 44 additions & 4 deletions docs/99-candella-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pip install candella-sdk
```

!!! warning
The Candella is in a pre-release state and isn't available in PyPI yet. You will need to build the project from source to use the SDK.
The Candella SDK is in a pre-release state. Features, methods, and APIs may change over time.

## Build the SDK from source

Expand All @@ -31,11 +31,51 @@ Then, use `pip install` and point to the resulting wheel file in the `dist` dire

## Creating projects

Currently, the Candella SDK lets you create three different kinds of projects: applications, core services, and frameworks. To create any of these projects, run `candella-sdk --create` and specify the `--type` argument:
Currently, the Candella SDK lets you create three different kinds of projects: applications, core services, and frameworks. To create any of these projects, run `candella-sdk --action create` and specify the `--type` argument:

- `--type application` to create an application.
- `--type app` to create an application.
- `--type service` to create a core service.
- `--type framework` to create a framework.

!!! note
If you choose an open-source license, you will need to supply the LICENSE file with your app. This may be updated in a future release of the SDK.
If you choose an open-source license, you will need to supply the LICENSE file with your app. This may be updated in a future release of the SDK.

## Validating projects

The Candella SDK provides a rudimentary validation system for projects to ensure that apps, core services, and frameworks have proper manifests and the materials needed for the project to run in Candella.

To start validating a project, run `candella-sdk --action validate` and specify the `--project` argument with the path to your project.

Currently, the SDK will check for the following:

- That the project is a valid Candella project
- That the project contains a manifest file
- That the project's manifest file contains the required keys and doesn't include invalid keys
- That the project contains the proper iconset if the project is an app or core service

!!! warning "About project validation"
Remember that project validation is not a substitution for thorough testing, nor does it guarantee that your project will work correctly with Candella.

Always remember to thoroughly test your projects and how they work in the most recent versions of Candella alongside the most recent versions of the frameworks and core services included.

## Using Candella SDK programmatically

The Candella SDK can be imported as a Python module into a script to automate development or to write tests for validating apps.

Creating a project can be performed by calling `sdk.create` with a single argument that defines the project type:

```py
from candella_sdk import sdk, CandellaProjectType

sdk.create(CandellaProjectType.application)
```

Likewise, a project can be validated programmatically by calling `sdk.validate` and passing in the path to the project to validate. The validation function returns a tuple containing if the project was validated, and the error in question if the validation failed.

```py
from candella_sdk import sdk

validated, error = sdk.validate("path/to/Example.aosapp")
if not validated:
raise Exception(error)
```

0 comments on commit ee34dd5

Please sign in to comment.