Metadata-Version: 2.4
Name: py10x-core
Version: 0.1.14
Summary: 10x Platform Core
Project-URL: Homepage, https://github.com/10x-software/py10x
Project-URL: Repository, https://github.com/10x-software/py10x
Project-URL: Issues, https://github.com/10x-software/py10x/issues
Project-URL: Documentation, https://github.com/10x-software/py10x#readme
Author-email: 10X CONCEPTS LLC <py10x@10x-software.org>
License: MIT
License-File: LICENSE
License-File: NOTICE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: User Interfaces
Requires-Python: <3.13,>=3.11
Requires-Dist: cryptography<45.1.0,>=45.0.7
Requires-Dist: hatch-build-scripts>=1.0.0
Requires-Dist: hatchling>=1.27.0
Requires-Dist: importlib-resources<6.6.0,>=6.5.2
Requires-Dist: keyring>=25.6.0
Requires-Dist: numpy<2.3.0,>=2.2.2
Requires-Dist: py10x-infra<0.2.0,>=0.1.9
Requires-Dist: py10x-kernel<0.2.0,>=0.1.9
Requires-Dist: pymongo>=4.7.3
Requires-Dist: python-dateutil<2.10.0,>=2.9.0
Requires-Dist: requests>=2.32.5
Requires-Dist: scipy>=1.15.3
Requires-Dist: typing-extensions>=4.15.0
Provides-Extra: dev
Requires-Dist: alt-pytest-asyncio==0.7.2; extra == 'dev'
Requires-Dist: asyncio-atexit<2.0,>=1.0.1; extra == 'dev'
Requires-Dist: hatch-build-scripts>=1.0.0; extra == 'dev'
Requires-Dist: hatchling>=1.27.0; extra == 'dev'
Requires-Dist: licensecheck>=2025.1.0; extra == 'dev'
Requires-Dist: playwright<1.56,>=1.44; extra == 'dev'
Requires-Dist: pytest-cov<8.0,>=6.0; extra == 'dev'
Requires-Dist: pytest-mock<4.0.0,>=3.5.11; extra == 'dev'
Requires-Dist: pytest<9.0,>=8.3.4; extra == 'dev'
Requires-Dist: ruff<0.14,>=0.13; extra == 'dev'
Requires-Dist: setuptools-scm>=9.2.2; extra == 'dev'
Requires-Dist: tomlkit>=0.13.0; extra == 'dev'
Requires-Dist: uv>=0.9; extra == 'dev'
Provides-Extra: qt
Requires-Dist: pyqt6-qt6==6.8.2; extra == 'qt'
Requires-Dist: pyqt6-sip==13.10.0; extra == 'qt'
Requires-Dist: pyqt6==6.8.1; extra == 'qt'
Provides-Extra: rio
Requires-Dist: aiofiles>=24.1; extra == 'rio'
Requires-Dist: matplotlib~=3.10.6; extra == 'rio'
Requires-Dist: rio-ui==0.12; extra == 'rio'
Requires-Dist: webview-proc>=0.1.0rc6; extra == 'rio'
Description-Content-Type: text/markdown

# py10x-core

**Unified, identity-driven, dependency-aware object model for Python**  
—with lazy dependency graph, persistence, automatic UI editors, and more

[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue)](https://www.python.org)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow)](https://opensource.org/licenses/MIT)

<img src="https://10x-software.org/10x-jerboa.jpeg" alt="Jerboa Logo" width="240">

## 🚀 Why py10x?

Standard Python objects have no shared identity layer and no automatic dependency tracking.  
**py10x-core** turns them into a coherent, **dependency-aware graph of connected identifiable objects** — a single shared layer that feels unified across modules, files and processes.

Key superpowers:

- **Global Identity & Sharing**  
  Objects with identical **ID Traits** are automatically the same logical entity.  
  Change a value in one place → every reference sees the update instantly (global cache).

- **Lazy Dependency Graph**  
  Computed traits (derived values) are calculated only when accessed.  
  Dependencies are tracked automatically — no manual invalidation, no recompute storms.

- **Deep Persistence**  
  Complex nested object graphs saved to **Traitable Store** (MongoDB or in-memory).  
  Built-in versioning, history tracking, transparent lazy loading.

- **Automatic UI Editors**  
  Define your data model once → get native two-way editors for **Rio** (web) or **Qt** (desktop).  
  No manual UI code for viewing/editing traitables.

This approach dramatically reduces boilerplate while giving you fine-grained control over computation timing and persistence behavior.

---

## 🏁 Hello World

By default, the `Traitable` constructor accepts **only ID traits**. For how the framework uses identity and storage to resolve or create instances, see [How Traitables Are Created](https://github.com/10x-software/py10x/blob/main/GETTING_STARTED.md#how-traitables-are-created) in the Getting Started guide.

```python
from core_10x.traitable import Traitable, T, RT
from core_10x.exec_control import GRAPH_ON, CACHE_ONLY

class Developer(Traitable):
    handle: str      = T(T.ID)           # ← identity trait → global sharing
    coffee_cups: int = T(default=0)      # persistent
    energy: int      = RT()              # lazy-computed

    def energy_get(self) -> int:
        return self.coffee_cups * 20

# In-memory mode (no storage), dependency graph on.
with CACHE_ONLY(), GRAPH_ON():
    dev = Developer(handle="ghost")
    dev.coffee_cups = 5
    print(dev.energy)           # 100 ← computed lazily on first access

    dev.coffee_cups = 6
    print(dev.energy)           # 120  ← recomputed due to dependency change

    # Same identity → same object
    dev2 = Developer(handle="ghost")
    print(dev2.energy)          # 120  ← shared via global cache
```


Want automatic persistence, per-class stores, store unions, querying, nested objects, UI generation, verifiers, and more?
→ Dive into [GETTING_STARTED.md](https://github.com/10x-software/py10x/blob/main/GETTING_STARTED.md) for the full technical manual.

---

## 🧠 When Should You Use py10x?

py10x-core is a good fit when:

- Your application has rich domain models with **derived fields**
- You need deterministic **object identity**
- You want automatic dependency tracking
- You want persistence and UI derived from the same model

It may be overkill for simple scripts, stateless APIs, or lightweight validation-only use cases.

If your system has evolving state and relationships, py10x-core removes a large amount of manual synchronization code.

---

## 🔍 How Is This Different?

Unlike `dataclasses` or `Pydantic`:

- Objects have deterministic identity based on **ID traits**
- Identical identity traits resolve to the same logical entity
- Derived fields are lazily computed and dependency-tracked

Unlike traditional ORMs:

- Identity is not tied to a database row
- Persistence is optional and pluggable

Unlike reactive frameworks:

- Dependencies are tracked automatically
- Computation is lazy by default

---

## 🤝 Contact & Support

- **Getting Started:** [GETTING_STARTED.md](https://github.com/10x-software/py10x/blob/main/GETTING_STARTED.md) — Full technical manual.
- **Installation:** [INSTALLATION.md](https://github.com/10x-software/py10x/blob/main/INSTALLATION.md) — Environment setup.
- **Contributing:** [CONTRIBUTING.md](https://github.com/10x-software/py10x/blob/main/CONTRIBUTING.md) — How to contribute.
- **Discord:** [Join the 10x Community](https://discord.gg/m7AQSXfFwf)
- **Security:** Report vulnerabilities to [security@10x-software.org](mailto:security@10x-software.org)
- **Project e-mail:** [py10x@10x-software.org](mailto:py10x@10x-software.org)

