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.2

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.2
File Size Uploaded Provenance Actions
xstack-2.0.2.tar.gz 65.9 kB Without provenance Details for xstack-2.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 138.8 kB

Release files / xstack-2.0.2.tar.gz

Download URL xstack-2.0.2.tar.gz
Size 65.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2c7485bb160100bc4b05939c279ccb0da463d158c8b7c8824bcd1682e3d4112e
BLAKE2b-256 checksum
How to use checksums
521e159375352e3d632e216e473779dd19444a0271c207073d11302e1471cd19
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.2-py3-none-any.whl

Download URL xstack-2.0.2-py3-none-any.whl
Size 72.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d21420b160983132a93985cab3acdf88e63f50811a54b614533da30c093c978d
BLAKE2b-256 checksum
How to use checksums
0cacdc3b39aa34b35b4f1839d35cddec167beaab17357c17f3c011c315202142
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.2

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.2 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