Skip to main content

Shared models, JSON Schemas, and a CLI validator for Infosourceful.

Project description

Infosourceful Kernel

Shared models, JSON Schemas, and a CLI validator for the Infosourceful ecosystem.

Overview

Infosourceful Kernel serves as the single source of truth for domain models, JSON schemas, and validation utilities used across the Infosourceful platform. It provides:

  • Domain Models: Pydantic models for artifacts, decisions, relations, and actors
  • JSON Schemas: Versioned meta schemas for artifact validation
  • CLI Validator: Command-line tool for validating artifacts
  • Validation Utilities: Reusable validation functions for applications

Installation

From PyPI (Recommended)

pip install infosourceful-kernel

From GitHub Packages

If the package is published to GitHub Packages, you can install it using:

# Configure pip to use GitHub Packages
pip install --index-url https://pypi.org/simple/ --extra-index-url https://pypi.github.com/infosourceful/infosourceful-kernel/simple/ infosourceful-kernel

Install Specific Version

# Install latest stable version
pip install infosourceful-kernel==1.0.0

# Install from source (development)
pip install git+https://github.com/Infosourceful/infosourceful-kernel.git@v1.0.0

Development Installation

For development or to contribute:

git clone https://github.com/Infosourceful/infosourceful-kernel.git
cd infosourceful-kernel
pip install -e .

Usage

CLI Validation

The ik command provides artifact validation:

# Validate a JSON file
ik artifact.json

# Validate from stdin
echo '{"schema_version": "1.0.0", ...}' | ik

# Validate with specific schema version
ik artifact.json --schema-version 1.0

# Validate YAML files
ik artifact.yaml --format yaml

# Verbose output
ik artifact.json --verbose

Python API

from infosourceful_kernel.models import Artifact, ArtifactType
from infosourceful_kernel.validation import validate_artifact_json

# Create an artifact
artifact = Artifact(
    schema_version="1.0.0",
    artifact_id="my_artifact_123",
    artifact_type=ArtifactType.DECK,
    project_key="my_project",
    source_systems=["system1", "system2"],
    hash="abcdef1234567890abcdef1234567890"
)

# Validate JSON content
result = validate_artifact_json(json_content)
if result.is_valid:
    print("✅ Validation passed")
else:
    print("❌ Validation failed:", result.errors)

Schema Versioning

Infosourceful Kernel follows semantic versioning for schemas:

  • MAJOR: Breaking schema/API changes
  • MINOR: Additive (non-breaking) changes
  • PATCH: Bug fixes only

Schema files are stored as meta-v{N}.0.json in the schemas/ directory, with major versions kept side-by-side for backward compatibility.

Domain Models

Artifact

The core model representing any artifact in the Infosourceful system:

from infosourceful_kernel.models import Artifact, ArtifactType

artifact = Artifact(
    schema_version="1.0.0",
    artifact_id="unique_id_123",
    artifact_type=ArtifactType.DECK,
    project_key="project_name",
    source_systems=["system1"],
    hash="content_hash_here"
)

Actor

Represents people or systems involved in the process:

from infosourceful_kernel.models import Actor, ActorRole

actor = Actor(
    name="John Doe",
    role=ActorRole.OWNER,
    email="john@example.com"
)

Decision

Represents decisions made during the process:

from infosourceful_kernel.models import Decision, DecisionStatus
from datetime import date

decision = Decision(
    id="dec_001",
    title="Approval Decision",
    date=date(2024, 1, 15),
    rationale="Based on requirements analysis",
    status=DecisionStatus.APPROVED
)

Development

Setup

git clone https://github.com/Infosourceful/infosourceful-kernel.git
cd infosourceful-kernel
pip install -e .

Testing

pytest tests/ -v

Linting

flake8 infosourceful_kernel tests
black --check infosourceful_kernel tests
isort --check-only infosourceful_kernel tests

License

Proprietary - Infosourceful Works

Contributing

This repository is maintained by the Infosourceful team. For questions or issues, please contact support@infosourceful.com.

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

infosourceful_kernel-1.0.3.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

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

infosourceful_kernel-1.0.3-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file infosourceful_kernel-1.0.3.tar.gz.

File metadata

  • Download URL: infosourceful_kernel-1.0.3.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for infosourceful_kernel-1.0.3.tar.gz
Algorithm Hash digest
SHA256 74a9ef1de4f921c1ecf7372c7ee2cdc64673acc9e57121b7befb118d5b44f589
MD5 beaa47f5e154848fcb5689906473fcce
BLAKE2b-256 77534178f254551383a87539b7e51b058d7cc188532e1891a24537683f77e1d5

See more details on using hashes here.

File details

Details for the file infosourceful_kernel-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for infosourceful_kernel-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4f07f2eef0b011aa0169d5222f62b902fbb3d7623e4907d5d470c6002def8d10
MD5 4da2064afb3d4d691ea4acd51fcabad0
BLAKE2b-256 e278d84af7846a367b890525f34957092012941c93a979c2ee8493a81641d51e

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