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.8.tar.gz (250.2 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.8-py3-none-any.whl (278.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: capellambse-0.4.8.tar.gz
  • Upload date:
  • Size: 250.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for capellambse-0.4.8.tar.gz
Algorithm Hash digest
SHA256 9b5893a85b884258e5c532a28335bb7da104afa8c4b5be3811b9307c2f740ffc
MD5 4764f4e795878ef46248431e6e0638ec
BLAKE2b-256 5396e31aacd6910d7764755cdfb256604c091d8c04b953a6c91b5ec94b696b16

See more details on using hashes here.

File details

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

File metadata

  • Download URL: capellambse-0.4.8-py3-none-any.whl
  • Upload date:
  • Size: 278.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.12

File hashes

Hashes for capellambse-0.4.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7da7ff41595d80df677f8313ced5a61c0c88c358250dc0b7d483baf3375ff823
MD5 487e4aeeaeeb6bced7cfdc00ad6e70ea
BLAKE2b-256 77e48f42bcb0dfa615e4d82738186ef8d7c264ba97067d7033a3164412ca4e58

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