Namespaces

Once you start to develop a number of Viash components, you may want to group them together for improved maintenance and a separation of concerns. In addition, multiple developers could work on different sets of components in parallel and later bring them together in a larger project.

We call a group of components a namespace.

Building a namespace

You can assign a component to a namespace by defining its namespace attribute in the viash config file:

functionality:
  name: some_component
  namespace: my_namespace

Alternatively, the namespace can be automatically inferred by structuring the components hierarchically. In the example below, there are two namespaces: file_processing and network_tools. Each of these namespaces has one or more components assigned to them:

src
├── file_processing
│   ├── parse_images
│   │   ├── config.vsh.yaml
│   │   └── script.sh
│   └── render_mp4
│       ├── config.vsh.yaml
│       └── script.sh
└── network_tools
    └── download_files
        ├── config.vsh.yaml
        ├── output
        │   └── download_files
        └── script.sh

To build a namespace to a set of executables, use the viash ns build command.