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.1.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.1-py3-none-any.whl (621.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: winterforge-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 ef5113a92deaccdc0ec288cc346418863cfcd51f4b7d3686881bc3b1986c3e08
MD5 87b84f240f8b1d542ce4f8bfda636862
BLAKE2b-256 b6d580130deabb7aa0449e2ed1a3fc5103c4fc0cb446f8799b7c1739d88214e2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: winterforge-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0603670eccfbd2f3da2a145f4eb9a8de903906bb3e20507098171266dff159cf
MD5 77c3fb62302154c133e7dd0267cf6c11
BLAKE2b-256 8abbc62b8db24678f779d0a002ccfa16b2ffd6f16c5e1127b1c16a6eff372757

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