Skip to main content

AI-native framework with composable primitives

Project description

WinterForge

Async-first framework for composable data primitives.


Quick Start

from winterforge.frags import Frag
from winterforge.frags.registries import UserRegistry
from winterforge.plugins import discover_plugins, StorageManager

# Initialize
discover_plugins()
StorageManager.load_bootstrap()

# Create user
users = UserRegistry()
user = await users.create(
    username='alice',
    email='alice@example.com',
    password='secure123'
)

# Query
user = await users.get('alice@example.com')  # Email resolution
active = await users.verified_only().all()   # Filter

# Create Frag
post = Frag(
    affinities=['post', 'published'],
    traits=['titled', 'timestamped', 'sluggable']
)

post.set_title("Hello World") \
    .generate_slug("Hello World")

await post.save()

Core Concepts

Frags

Composable data primitives built from:

  • Affinities - What it IS (tags: ['user', 'admin'])
  • Traits - What it CAN DO (behavior: ['titled', 'persistable'])
  • Aliases - Flexible metadata (relations: {'employee_id': '12345'})

Registries

Query collections of Frags by composition.

users = UserRegistry()
admins = await users.with_role('admin').all()

Storage

SQLite, PostgreSQL, YAML, Env backends.

storage = StorageManager.get('sqlite', db_path='app.db')
await storage.save(frag)

Installation

pip install -e .

Testing

# All tests
pytest

# Core tests (no PostgreSQL)
pytest --ignore=tests/frags/storage/test_postgresql_integration.py

Expected: 581 passing, 1 warning (JWT dev secret)


Documentation

  • Quick Start: QUICKSTART.md - 5-minute introduction
  • Glossary: GLOSSARY.md - Complete terminology reference
  • Handoff: HANDOFF.md - Recent changes and architecture
  • Examples: examples/pkm/ - Personal knowledge management app

Project Structure

winterforge/
├── frags/              # Frag core
│   ├── base.py        # Frag class
│   ├── registry.py    # FragRegistry
│   ├── traits/        # Built-in traits
│   └── registries/    # Specialized registries
├── plugins/           # Plugin system
│   ├── storage/       # Storage backends
│   ├── identity/      # Identity resolvers
│   └── managers/      # Plugin managers
└── cli/              # CLI commands

Built-in Traits

  • titled - title, subtitle
  • sluggable - URL slugs
  • timestamped - created_on, updated_on
  • persistable - save(), delete(), is_new()
  • userable - username, email, email_verified
  • authenticatable - password hashing
  • authorizable - roles, permissions
  • sessionable - session management

CLI

# User management
winterforge user create alice alice@example.com
winterforge user add-role alice admin

# Session management
winterforge session create alice
winterforge session verify <token>

# Role/permission management
winterforge role create admin "Admin role"
winterforge permission create posts.create

Async-First

All I/O operations are async:

# Storage
await storage.save(frag)
frag = await storage.load(id)

# Frags
await frag.save()
await frag.delete()

# Registry
frag = await registry.get(identity)
all_frags = await registry.all()

Sync wrapper (rare):

from winterforge.utils.sync import to_sync

@to_sync
async def create_user_sync(username, email):
    users = UserRegistry()
    return await users.create(username, email, 'password')

user = create_user_sync('alice', 'alice@example.com')

Architecture

  • Composition over inheritance - Frags compose capabilities
  • Plugin-based - Extensible via decorators
  • Async-first - Modern Python standards
  • Everything is a Frag - Even CLI output

Status

Version: Pre-release (Phase 4 complete) Tests: 581 passing Warnings: 1 (expected) Ready for: Feature development


WinterForge is async-first, composition-driven, and ready for production.

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

winterforge-0.2.0.tar.gz (429.5 kB view details)

Uploaded Source

Built Distribution

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

winterforge-0.2.0-py3-none-any.whl (621.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: winterforge-0.2.0.tar.gz
  • Upload date:
  • Size: 429.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for winterforge-0.2.0.tar.gz
Algorithm Hash digest
SHA256 33282c1ce8d7cdcacc83e0a6753afcbc0313f8fef7b812d4577368d96f57e244
MD5 d259637b056055aaa549e6cf3e5d489b
BLAKE2b-256 3455241addcb86fea6fd6d266732f00fc4b7a69f589fbfd6fb9072f63c0706c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: winterforge-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 621.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for winterforge-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db3471ca5d509d68f8ba007e623e8676a6497f737e165d2fcf799d70d92dd5ed
MD5 ca188032f8d686c9481de00ea5108add
BLAKE2b-256 6627300cd4b6e6943ee0594eab76d03fb9020eec8d40246abf4e61403fe3765f

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