Skip to main content

Provides access to Capella MBSE projects in Python

Project description

capellambse

A Python 3 headless implementation of the Capella modeling tool

CI build CI lint

Intro

Copyright 2021 DB Netz AG, licensed under Apache 2.0 (see full text in LICENSE)

capellambse allows you reading and writing Capella models from python without Java or Capella tool on any (reasonable) platform. We wanted to "talk" to Capella models from Python but without any Java on the way. We thought this project will help individuals and organisations getting through the MBSE adoption journey with Capella faster and so we made it public and open-source.

With capellambse you can access all (or almost all) Capella model elements, render diagrams (as SVG and PNG). We made it for automation of Systems Engineering work so it integrates nicely into most of CI/CD toolchains. We also found it at the core of our artifact generation pipelines (model to documents, model to SW interfaces).

The library works with PVMT and Requirements extensions without any additional efforts.

It started as a basic library somewhere mid 2019. Since then it was re-architected a few times and now has a full read/write capability for most of the present Capella ontology. We are continuously improving the API (introducing shortcuts), increasing the meta-model coverage and have more engineering automations and improvements in the pipeline to share.

Getting started

Click on this button to launch a Binder instance and start exploring our test models within seconds:

Binder

Warning: Do not enter confidential information, such as passwords for non-public models, into a notebook hosted on myBinder. If you want to try out capellambse with those models, please install and run it in a local, trusted environment (see below)!

Alternatively, to start using the project on your local machine, follow these steps:

  1. Clone the repository.

    git clone https://github.com/DSD-DBS/py-capellambse.git
    cd py-capellambse
    
  2. Create a virtual environment.

    python3 -m venv .venv
    
    # on Linux or Mac:
    source .venv/bin/activate
    
    # on Windows using cmd.exe:
    .venv\Scripts\activate.bat
    
    # on Windows using PowerShell:
    .venv/Scripts/activate.ps1
    
  3. Install capellambse and Jupyter.

    pip install -e .
    pip install jupyter
    
  4. Open the example notebooks.

    cd examples
    jupyter-notebook
    

The above code should clone the library and install it and all of its dependencies in a fresh virtual environment. Then, it should have started a jupyter-notebook server right in the examples folder. If your browser did not open automatically, follow the instructions in the terminal to start it manually.

Once in the browser, simply click on the 01_Introduction.ipynb notebook to start!

Documentation and examples

We designed the library API such that it is easy to use and discover, however there is also documentation available here. Additionally, the practical examples folder provides a collection of Jupyter notebooks with practical examples (like getting traceability matrices, change assessments, BoMs, etc).

Dependencies on 3rd party components and re-distributions

To provide same look and feel across platforms our diagraming engine uses OpenSans font. And to simplify the library installation and usage we redistribute it in accordance with SIL Open Font License 1.1 that it has at the moment: The bundled OpenSans font (capellambse/OpenSans-Regular.ttf) is Copyright 2020 The Open Sans Project Authors, the copy of License text can be seen in LICENSE-OpenSans.txt.

Current limitations

We are continuously improving coverage of Capella onthology with our high-level API (the current coverage map is available here), however it is still incomplete. It covers most of the commonly used paths but when you need to get to an ontology element that isnt covered yet you may do so by using the low-level API.

Also, as we started in mid 2019 and there was no such thing as Python4Capella yet, we are not API compatible with that project. However, we intend to add API compatibility with Python4Capella in later releases.

The generated diagrams are currently not persisted in .aird files and we are not sure yet if we need this feature. If there is a genuine usecase for that we may re-consider it - feel free to create an issue or add comments to an existing one.

Contributing

We'd love to see your bug reports and improvement suggestions! Please take a look at guidelines for contributors.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

capellambse-0.4.4.tar.gz (248.7 kB view details)

Uploaded Source

Built Distribution

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

capellambse-0.4.4-py3-none-any.whl (277.0 kB view details)

Uploaded Python 3

File details

Details for the file capellambse-0.4.4.tar.gz.

File metadata

  • Download URL: capellambse-0.4.4.tar.gz
  • Upload date:
  • Size: 248.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for capellambse-0.4.4.tar.gz
Algorithm Hash digest
SHA256 3c088638b456e14813e441b65a00d72f64edb3fd60252d83ac262e2562b25f69
MD5 600a13daae59fe80c23b7d64463640a2
BLAKE2b-256 de4233cc806612be8a35a293b61a6bb7508fb7f8053ff7c9c4bc346888eebaad

See more details on using hashes here.

File details

Details for the file capellambse-0.4.4-py3-none-any.whl.

File metadata

  • Download URL: capellambse-0.4.4-py3-none-any.whl
  • Upload date:
  • Size: 277.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for capellambse-0.4.4-py3-none-any.whl
Algorithm Hash digest
SHA256 514627002073be5ff05859775199db2ca16329e6bcac1a8ffbb5f8243a9908cd
MD5 032a36ae57124a5c484a17b2f82919fe
BLAKE2b-256 ce75414dab6a856ce2c292a31e6fc005ae51c3701318e18bf2f0799eb316f524

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