Skip to main content

A specification and blueprint manager for declarative configuration-as-code tools.

Project description

spectrik

A generic specification and blueprint pattern for declarative configuration-as-code tools.

Overview

spectrik provides a reusable framework for building tools that apply declarative configurations to external systems. It includes:

  • Specification — an abstract base class for defining desired-state resources
  • SpecOp strategiesPresent, Ensure, and Absent wrappers that control when specs are applied or removed
  • Blueprint — a named, ordered collection of spec operations
  • Project — a top-level build target that orchestrates blueprints
  • HCL loading engine — parse .hcl files into blueprints and projects with decorator-based spec registration

Installation

pip install spectrik

Quick Start

import spectrik
from spectrik.hcl import load_blueprints, load_projects

# Register specs for HCL block decoding
@spectrik.spec("widget")
class Widget(spectrik.Specification["MyProject"]):
    def __init__(self, *, color: str):
        self.color = color

    def equals(self, ctx):
        ...

    def apply(self, ctx):
        ...

    def remove(self, ctx):
        ...

# Load from HCL files
blueprints = load_blueprints(Path("hcl"))
projects = load_projects(Path("hcl"), blueprints, project_type=MyProject)

# Build a project
projects["myapp"].build(dry_run=True)

License

MIT

Project details


Download files

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

Source Distribution

spectrik-0.2.0.tar.gz (61.6 kB view details)

Uploaded Source

Built Distribution

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

spectrik-0.2.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file spectrik-0.2.0.tar.gz.

File metadata

  • Download URL: spectrik-0.2.0.tar.gz
  • Upload date:
  • Size: 61.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for spectrik-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a30faa00986a49b502b4bae9bcd710a67f8aa822b939e762cf00ab5732347e89
MD5 a250c8288978a6f3ce36439cd3c4a9f9
BLAKE2b-256 a96ed2ee46441e8157c09129120c47246e3e7338a5ebbe00dfb393c60c0e7fb0

See more details on using hashes here.

File details

Details for the file spectrik-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: spectrik-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for spectrik-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a6cfaa049b16a0d0a0d5178f4e316fd020f48e71fddbfe680ae2c527a8124f65
MD5 05c4857c7f782b1a18e61375a9fc5e39
BLAKE2b-256 afbdaa358382ea135b5738cb16cabf9259da58217d7ea1ae57070da5540aabe9

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