Skip to main content

stkml is a transpiler for stackml to generate output for different backend as diagram, drawio, map.

Project description

Stkml-cli

continuous_integration publish_to_Pypi PyPI package downloads

STKML is an open-source IoT stack coding language developed by Stackeo and INRIA for both industry and academic research. STKML allows you to describe an IoT system globally and then to detail its different entities and their relationships in a simple way. Thus IoT teams can quickly visualize and verify the principles of the end-to-end architecture, create simulation or reproducible test scenarios for the sizing and forecasting of the non-functional properties of a connected system or an IoT solution. end to end before its large-scale deployment. STKML also allows vendors to create libraries of IoT product models and architecture patterns for integration into an architectural design.

A set of tools associated with STKML (enriched online editor, transpilators, diagramming tools, topology checking tools, model libraries) are being developed to support developers in assisted coding and compilation of their models. components and architecture in order to automatically generate models, their documentation or the associated simulation or deployment scenarios. The user can thus contribute to the Stacker community, by creating, reusing and manipulating frameworks and architectural templates and models of IoT system components.

The implementation is compatible with python3.6

Usage

  1. Installation of application
pip install stkml
  1. Run the application

You can run the application with the following command

stkml

Usage: stkml [OPTIONS] COMMAND [ARGS]...

Options:
  --version  Show the version and exit.
  --help  Show this message and exit.

Commands:
  check    check stkml file architecture
  compile  compile stkml file using a specific backend
  init     initialize a stkml project

Usage: stkml compile [OPTIONS] COMMAND [ARGS]...

  compile stkml file using a specific backend

Options:
  -i, --input TEXT                the file to compile
  -d, --disable-syntax-verification
                                  ignore syntax verification
  -h, --help                      Show this message and exit.

Commands:
  diagram    compile stkml file for
  drawio     compile stkml file for drawio




Usage: stkml compile diagram [OPTIONS]

  compile stkml file for diagram

  Example:     stkml compile -i architecture.stkml diagram -t 1 -o img

Options:
  -t, --type [1|2|3]  the diagram type {Architecture ,Topology or Map}
                      [required]

  -i, --icons TEXT    the icon folder {it contains [Node_Id].png files}
  -o, --output TEXT   the output file  [required]
  -h, --help          Show this message and exit.



Usage: stkml compile drawio [OPTIONS]

  compile stkml file for Drawio

  Example:     stkml compile -i architecture.stkml Drawio -l 1 -o Drawio

Options:
  -l, --level [1|2]  the diagram view level {System View or Layer View}
                     [required]

  -i, --icons TEXT   the icon folder {it contains [Node_Id].png files}
  -o, --output TEXT  the output file  [required]
  -h, --help         Show this message and exit.




stkml check --input architecture

Usage: stkml check [OPTIONS]

  check stkml project

Options:
  -i, --input TEXT               the stkml project to check
  --disable-syntax-verification  ignore syntax verification
  --help                         Show this message and exit.


stkml init

Usage: stkml init [OPTIONS]

  initialize a stkml project

Options:
  -i, --input TEXT    the file to compile to stkml
  -b, --backend TEXT  the file backend [drawio]
  -p, --path TEXT     the stkml project directory
  -h, --help          Show this message and exit.
  1. Configure the Ide

See the stkml documentation

  1. Diagram Examples

    • System Diagram

      stkml compile -i Examples/example.stkml diagram -t 1 -o Examples/results/diagram/Type1/level1 --icons Examples/icons/
      

      Result :

    • Deployment Topology Diagram

      stkml compile -i Examples/example.stkml diagram -t 2 -o Examples/results/Type2/diagram/level1 --icons Examples/icons/
      

      Result :

    • Deployment Map

      stkml compile -i Examples/example.stkml diagram -t 3 -o Examples/results/Type2/diagram/level2.html --icons Examples/icons/
      

      Result :

  2. Drawio Examples

    • level 1 :

      stkml compile -i Examples/example.stkml drawio -l 1 -o Examples/results/Type1/level1
      

      Result :

    • level 2 :

      stkml compile -i Examples/example.stkml drawio -l 2 -o Examples/results/Type1/level2
      

      Result :

The latest version

You can find the latest version to ...

git clone https://github.com/Stackitect/stkml-cli.git

Developper guideline

Add a dependency

Write the dependency in setup.py. As it's the distribution standard for pypi, I prefer to keep setup.py as single source of truth.

I encourage avoiding using instruction as pipenv install requests to register a new library. You would have to write your dependency in both setup.py and Pipfile.

Install development environment

Use make to instanciate a python virtual environment in ./venv and install the python dependencies.

make install_requirements_dev

Update release dependencies

Use make to instanciate a python virtual environment in ./venv and freeze dependencies version on requirement.txt.

make update_requirements

Activate the python environment

When you setup the requirements, a venv directory on python 3 is created. To activate the venv, you have to execute :

make activate

Run the linter and the unit tests

Before commit or send a pull request, you have to execute pylint to check the syntax of your code and run the unit tests to validate the behavior.

make lint
make tests

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stkml-1.0.1.tar.gz (10.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stkml-1.0.1-py3-none-any.whl (168.3 kB view details)

Uploaded Python 3

File details

Details for the file stkml-1.0.1.tar.gz.

File metadata

  • Download URL: stkml-1.0.1.tar.gz
  • Upload date:
  • Size: 10.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9

File hashes

Hashes for stkml-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d47f01d861642ef743016231d874ff7e932b9a2ccc4fc354e0649c64044377f0
MD5 c3ff967c1e697fc44ec2c15a6a4d5cad
BLAKE2b-256 4be5c8c7a1f3dd477b481a5ea160b2340642b7596757b06ce921a9a5d845bd08

See more details on using hashes here.

File details

Details for the file stkml-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: stkml-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 168.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9

File hashes

Hashes for stkml-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6d8982936b8d8a9d8c1fce070fd1bd50896a79b5e4f8baa29f309dba1a9a11ab
MD5 0f2a877ee2113787daf342af4d25422b
BLAKE2b-256 d27b3624f8c4910d24c87de86e12d21d85972c5dc5b6f703eb87f81296367baf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page