Skip to main content

xstack

xstack is an execution framework which allows a developer to define components which can then be added to the stack - declaring options, requirements and outputs.

xstack Image

Installing

You can install xstack using pip install xstack

Getting Started

The stack can be executed to run sequentially from top to bottom, from a specific point, to a specific point or individiaully.

Below is an example of what it looks like to add components to the stack, manipulate the build order and execute a stack

import xstack

COMPONENT_PATH = "location/to/where/you/store/your/components"

# -- Create a new stack. When we create a stack we need to tell it where
# -- to look for components
stack = xstack.Stack(
    component_paths=[COMPONENT_PATH],
)

# -- Add a component of type "RunTestComponent" into the stack. Note that you
# -- can see this component within the /test directory of xstack
component_a = stack.add_component(
    label="test a",
    component_type="RunTestComponent",
)

# -- Add the same component type again. 
component_b = stack.add_component(
    label="test b",
    component_type="RunTestComponent",
)

# -- Our stack now has two components in it, by default these will be in 
# -- a flat list and ordered based on the order they were added. Here we will
# -- make component_a a child of component_b - meaning that component_a will
# -- always execute after component_b
stack.set_build_position(
    component_a,
    parent=component_b,
)

# -- Execute the whole stack
stack.build()

# -- Execute just a single component
stack.build(build_only=component_a)

Defining a component is relatively simple...

import xstack

class MyXStackComponent(xstack.Component):
    
    # -- Every component needs an identifier which can be used to differentiate
    # -- it from other components
    identifier = "MyExample"

    def __init__(self, *args, **kwargs):
        super(MyXStackComponent, self).__init__(*args, **kwargs)
        
        # -- Declare a requirement. A Requirement is an attribute of a component
        # -- that typically expects to be filled before execution. By default
        # -- all requirements will be validated for a value before executing. 
        self.declare_requirement(
            name="example_requirement",
            value="",
            group="Some Requirements",
        )
        
        # -- Options are considered to be attributes which are not essential to
        # -- be set but might tailor or alter what the result is
        self.declare_option(
            name="test_option",
            value="foo",
            pre_expose=True,
        )
        
        # -- An output is an attribute which this component promises to fullful
        # -- during the execution. This is useful because instead of specifying a 
        # -- value to a requirement, you can infact specify an output attribute 
        # -- address, and the value will be resolved at execution time. 
        self.declare_output(
            name="result"
        )
    
    # -- This function is where we write any code that should be run during the 
    # -- stack execution
    def run(self):
        return self.option("test_option").get() == "bar"

App

This is a Qt based application/widget which is designed to visualise an xstack stack.

The app is not a requirement for using xstack, but can be used as a front end to build and execute stacks.

xstack Image

Installing

You can install the xstack_app using pip install xstack_app

Note: This requires either PySide2 or PySide6 to also be available.

Running

import xstack

xstack.launch(blocking=True)

If you want to run it with some example components, you can run:

import xstack

xstack.launch_demo(blocking=True)

Metadata

Release files for xstack 2.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xstack 2.0.3
File Size Uploaded Provenance Actions
xstack-2.0.3.tar.gz 392.6 kB Without provenance Details for xstack-2.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xstack 2.0.3
File Interpreter ABI Platform Actions
xstack-2.0.3-py3-none-any.whl Python 3 none any Details for xstack-2.0.3-py3-none-any.whl

Total release size: 798.6 kB

Release files / xstack-2.0.3.tar.gz

Download URL xstack-2.0.3.tar.gz
Size 392.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3fa49929711bb8774f3175803989729fcb4fb52c8064e4d3e417ceeea67f6aa6
BLAKE2b-256 checksum
How to use checksums
caf04feb8c6f537d45935b978c92eccffd304e40a46fe29c6aca603ecdad9619
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release files / xstack-2.0.3-py3-none-any.whl

Download URL xstack-2.0.3-py3-none-any.whl
Size 406.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
58421146c50ce65c74d40ef72585fdac356e03046ed461a9510cec5f2224e2fb
BLAKE2b-256 checksum
How to use checksums
5f51208a75ae247e2220e32d8efcac1699b10ac15dc52c0cdda73e4e822695c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Security for xstack 2.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page