SEA DSL
Python bindings for the SEA DSL (Semantic Enterprise Architecture) domain-specific language. Part of the DomainForge ecosystem.
Features
- 🏗️ Domain Primitives — Entities, Resources, Flows, Roles, Relations, Instances
- 📐 Unit System — First-class dimensional analysis with type-safe quantities
- ✅ Policy Engine — Constraint validation with three-valued logic
- 🔄 DSL Parsing — Parse SEA source code into queryable graph structures
- 🌐 CALM Integration — Export/import FINOS CALM architecture-as-code format
- ⚡ Native Performance — Rust-powered core via PyO3
Parsed graphs expose declaration-ordered read access to policies, metrics,
mappings, projections, patterns, concept changes, entity instances, and source
declared dimensions and units. SourceUnit.base_factor is an exact decimal
string; mapping and projection rule details are available through rules_json
and overrides_json.
Installation
pip install domainforge
Requires: Python 3.11+
Quick Start
Parse from DSL
import domainforge
source = '''
@namespace "supply_chain"
Entity "Warehouse" in logistics
Entity "Factory" in manufacturing
Resource "Cameras" units
Flow "Cameras" from "Warehouse" to "Factory" quantity 100
'''
graph = domainforge.Graph.parse(source)
print(f"Entities: {graph.entity_count()}")
print(f"Resources: {graph.resource_count()}")
print(f"Flows: {graph.flow_count()}")
Build Programmatically
import domainforge
graph = domainforge.Graph()
# Create primitives
warehouse = domainforge.Entity("Warehouse", "logistics")
factory = domainforge.Entity("Factory", "manufacturing")
cameras = domainforge.Resource("Cameras", "units")
graph.add_entity(warehouse)
graph.add_entity(factory)
graph.add_resource(cameras)
# Create flow
flow = domainforge.Flow(
cameras.id(),
warehouse.id(),
factory.id(),
100.0
)
graph.add_flow(flow)
# Query the graph
for entity in graph.all_entities():
print(f"{entity.name()} in {entity.namespace()}")
Work with Attributes
entity = domainforge.Entity("Warehouse")
entity.set_attribute("capacity", 10000)
entity.set_attribute("location", "New York")
print(entity.get_attribute("capacity")) # 10000
print(entity.get_attribute("location")) # "New York"
CALM Integration
# Export to CALM JSON
calm_json = graph.export_calm()
# Import from CALM
imported_graph = domainforge.Graph.import_calm(calm_json)
API Reference
Core Classes
| Class | Description |
|---|---|
Entity |
Business actors, locations, organizational units (WHO) |
Resource |
Quantifiable subjects of value (WHAT) |
Flow |
Transfers of resources between entities |
Instance |
Entity type instances with named fields |
ResourceInstance |
Physical instances at entity locations |
Role |
Roles that entities can play |
Relation |
Relationships between roles |
Graph |
Container with validation and query capabilities |
Graph Methods
# Add primitives
graph.add_entity(entity)
graph.add_resource(resource)
graph.add_flow(flow)
graph.add_instance(instance)
graph.add_role(role)
graph.add_relation(relation)
# Counts
graph.entity_count()
graph.resource_count()
graph.flow_count()
# Lookup
graph.find_entity_by_name("Warehouse")
graph.find_resource_by_name("Cameras")
# Flow queries
graph.flows_from(entity_id)
graph.flows_to(entity_id)
# Get all
graph.all_entities()
graph.all_resources()
graph.all_flows()
# Policy evaluation
graph.add_policy(policy)
graph.evaluate_policy(policy_json)
graph.set_evaluation_mode(use_three_valued=True)
# CALM integration
graph.export_calm()
Graph.import_calm(json_str)
NamespaceRegistry
# Load workspace registry
reg = domainforge.NamespaceRegistry.from_file('.sea-registry.toml')
# Resolve files
for binding in reg.resolve_files():
print(f"{binding.path} => {binding.namespace}")
# Query namespace for file
ns = reg.namespace_for('/path/to/file.sea')
Development
Building from Source
# Clone the repository
git clone https://github.com/GodSpeedAI/DomainForge.git
cd DomainForge
# Install maturin
pip install maturin
# Build and install in development mode
maturin develop
# Run tests
pytest tests/
Using Just (Recommended)
just python-setup # Create venv and install deps
just python-test # Run test suite
just python-clean # Remove venv
Platform Support
Pre-built wheels are available for:
| Platform | Architectures |
|---|---|
| Linux | x86_64, aarch64 |
| macOS | x86_64, arm64 (Apple Silicon) |
| Windows | x86_64 |
Build from source for other platforms.
Related Packages
| Package | Registry | Description |
|---|---|---|
domainforge-core |
crates.io | Rust core library |
domainforge |
PyPI | Python bindings (this package) |
domainforge |
npm | TypeScript/Node.js bindings |
Policy Authority
DomainForge includes a Policy Authority system for executable business authority:
from domainforge import AuthorityEnvironment, evaluate_authority
# Create and validate environment
env = AuthorityEnvironment(config_json)
env.validate()
# Evaluate a request
trace_json, decision_json = env.evaluate(request_json, facts_json)
# Or use the convenience function
trace, decision = evaluate_authority(config_json, request_json, facts_json)
Available types:
FinalDecision— Allow, Deny, Escalate, NotApplicable, RejectPolicyModality— Permission, Prohibition, Obligation, OverrideSourceClass— CallerSupplied, RuntimeObserved, SystemOfRecord, Attested, ManualApproval, Derived, UnknownSourceClaimLevel— AuditBacked, Validated, FormallyProvenAuthorityEnvironment— Full authority evaluation environmentevaluate_authority()— One-shot evaluation function
Documentation
- 📖 SEA DSL Guide — Language specification
- 🏗️ Architecture — Design overview
- 📚 API Reference — Full Python API
License
Part of the DomainForge project.
Metadata
Release files for domainforge 0.18.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| domainforge-0.18.1.tar.gz | 695.4 kB | Without provenance | Details |
Built distributions (wheels)
Total release size: 29.3 MB
Release files / domainforge-0.18.1.tar.gz
| Download URL | domainforge-0.18.1.tar.gz |
|---|---|
| Size | 695.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
132f98f4f0f8d33bac6013311f4256763fa8343385dda7f4a777d99744091270
|
|
BLAKE2b-256 checksum How to use checksums |
2765bb6cf228e3271409bbaa59682dbaa9117726eea9c1d9cbe40dca2a96beac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Release files / domainforge-0.18.1-cp313-cp313-win_amd64.whl
| Download URL | domainforge-0.18.1-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
11748439ccaa6d355c93af315ae12526f41f7fc327d61adad47d43d20a307f77
|
|
BLAKE2b-256 checksum How to use checksums |
663a857236cec4dde091bf565a7109d2695a1c8191d5080567bfb7b38932393a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Release files / domainforge-0.18.1-cp313-cp313-manylinux_2_34_x86_64.whl
| Download URL | domainforge-0.18.1-cp313-cp313-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.13 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
84091a8698ecd771b94991a409d237a8bd7daca320e86f8b5b6896f404a8f90f
|
|
BLAKE2b-256 checksum How to use checksums |
68e7537f43d5a9ab1cf1fc2bcf373caa62c4b592d996719ccdbf451a29e3d81f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Release files / domainforge-0.18.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | domainforge-0.18.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
3479cf59e8125f6bc881268739171227d0f9d76426c18eb73c62c8e1b38161ae
|
|
BLAKE2b-256 checksum How to use checksums |
b032812d4ae45de0fd839d4d870b25a7b04acf716b37fad4dc01fbb5937c63af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Release files / domainforge-0.18.1-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | domainforge-0.18.1-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ff351393773f4b3022cd55144eaf2ecef7107cbf65984d7338d43de0fb60174f
|
|
BLAKE2b-256 checksum How to use checksums |
53634008ab313c8d9edfb7848008d8a03df3a33ca188480529d141f32c2180db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Release files / domainforge-0.18.1-cp313-cp313-macosx_10_12_x86_64.whl
| Download URL | domainforge-0.18.1-cp313-cp313-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.13 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
252cff6993829568d4ca8bf05b390f035cfdd4227f03188ade06b99117056668
|
|
BLAKE2b-256 checksum How to use checksums |
5aa6c69a6a2236a94be07eaf0fbe6868900dcf459386fc8d1bbe09a016f6a82d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Release files / domainforge-0.18.1-cp312-cp312-win_amd64.whl
| Download URL | domainforge-0.18.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9c3d7a3104b061082363c5f795e26fe952aad920eef783941617b43d8c00994f
|
|
BLAKE2b-256 checksum How to use checksums |
975185854e60f26fcdecd352c4fad8a3661e332a6abf0b18493568f2df4f3b6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Release files / domainforge-0.18.1-cp312-cp312-manylinux_2_34_x86_64.whl
| Download URL | domainforge-0.18.1-cp312-cp312-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.12 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
366261c80937719920da5164c0123e0ac2f48f6bb35ba8c14a0fb8cce87f75bf
|
|
BLAKE2b-256 checksum How to use checksums |
bccf6d71bf7de209ed6b8557834e9aa9171d87276d9ddcfaf2cd05e90b5de114
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Release files / domainforge-0.18.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | domainforge-0.18.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
43da1adac4abc3669744774d3b5fc000b11daadfa1a7a9b2053772bc9eaadc5b
|
|
BLAKE2b-256 checksum How to use checksums |
870c6779130b4dec7b10a03a930653b42697d953da9bd8d74d80d86add294671
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Release files / domainforge-0.18.1-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | domainforge-0.18.1-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6371a324731f67090a2a4703602737b576bd3da171add494f622a3268a46978d
|
|
BLAKE2b-256 checksum How to use checksums |
bcd3b505cec0ec01b74a2d9dd378737f2249f3b45a8fa3262884bbf997c88da8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Release files / domainforge-0.18.1-cp312-cp312-macosx_10_12_x86_64.whl
| Download URL | domainforge-0.18.1-cp312-cp312-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.12 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
005b13cb71bbad95bc04804c877607ffd60bdf67f9f02e88fd4d076e6224a49f
|
|
BLAKE2b-256 checksum How to use checksums |
990bad7b32dce5a44fe6d15e832402bb4fe70d566d5a0956cb175e80907328ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Release files / domainforge-0.18.1-cp311-cp311-win_amd64.whl
| Download URL | domainforge-0.18.1-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
01ae0447832c20f1930c3b7dc3a8656c73c56a3c4658c323d3ee9783604af0b0
|
|
BLAKE2b-256 checksum How to use checksums |
19952ad606e48126653aac23ff85441ce95e6dae82645af621c403ffaa8953e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Release files / domainforge-0.18.1-cp311-cp311-manylinux_2_34_x86_64.whl
| Download URL | domainforge-0.18.1-cp311-cp311-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.11 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
a91a10968076a4c394e9e12f0eac303c244c3ee9bc5c221ec5aeb35851162919
|
|
BLAKE2b-256 checksum How to use checksums |
d0bf9674d94226e2f459f945669ee2dfb047eda945d2d4eba1dcc2b68aa2ad2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Release files / domainforge-0.18.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | domainforge-0.18.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.1 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
472ebfe49538d77c1d36cc5d2755784cfd99ff7a1d866981793b2600b46a3c37
|
|
BLAKE2b-256 checksum How to use checksums |
41c980953e8146b884569ced8ad5f314d3ecfd1f97dc30db92cbeff78e620ef3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Release files / domainforge-0.18.1-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | domainforge-0.18.1-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
611f13d9ef471d72fec8ad8f1dd6c3500849b6f45454f42c3f7ad0c52884ea3f
|
|
BLAKE2b-256 checksum How to use checksums |
52ad57c8117175aed1343e9825af11d1bb33c063a1d15b416207469d4612ef44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Release files / domainforge-0.18.1-cp311-cp311-macosx_10_12_x86_64.whl
| Download URL | domainforge-0.18.1-cp311-cp311-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | CPython 3.11 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
2cc3a99a3dc1329dfce123d68087baeced24d950c759216dcbc227201ab3352f
|
|
BLAKE2b-256 checksum How to use checksums |
8f41da3fce04d4fc1b3f17842d079469a8d7d1a7596102a49bd0fb90fe84212b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.10.1
|
Security for domainforge 0.18.1
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.