Metadata-Version: 2.4
Name: glyff
Version: 0.1.0
Summary: Guaranteed Lightweight Yieldable Function Foundation for checkpointed and resumable task execution.
License: MIT License
        
        Copyright (c) 2026 nueruyu
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: AsyncIO
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# glyff

**G**uaranteed **L**ightweight **Y**ieldable **F**unction **F**oundation.

A primitive for pausing async functions across process and request boundaries,
and resuming them later from the same point.

## Install

```bash
pip install glyff
```

`glyff` has no dependencies beyond the Python standard library.

## Behavior

- Marked function calls are recorded in a session-scoped store, keyed by
  function identity, arguments, and call position.
- Re-invoking the same call within the same session returns the recorded
  result instead of re-executing.
- A call's outcome — success or failure — is permanent once recorded.
- `YieldException` suspends execution at a function boundary; the session
  can be resumed later by entering it again with the same session id.

## Public API

| Name              | Description                                                     |
| ----------------- | --------------------------------------------------------------- |
| `engrave`         | Decorator that marks an async function for recording.           |
| `Session`         | Async context manager that scopes a sequence of engraved calls. |
| `ExecutionId`     | Identifier for a recorded function execution.                   |
| `ExecutionRecord` | Persisted execution state and result.                           |
| `ExecutionStatus` | Enum: `STARTED`, `COMPLETED`, `FAILED`.                         |
| `SessionStore`    | Protocol for storage backends.                                  |
| `Serializer`      | Protocol for value serialization.                               |
| `ArgsHasher`      | Protocol for argument hashing.                                  |
| `YieldException`  | Raised to suspend a session.                                    |

## Extending

- For persistent storage, see [`glyff-file-store`](https://pypi.org/project/glyff-file-store/).
- For Pydantic-typed serialization, see [`glyff-pydantic`](https://pypi.org/project/glyff-pydantic/).
- Custom backends can be written by implementing the `SessionStore`,
  `Serializer`, and `ArgsHasher` protocols.

## Status

Early development. APIs may change before v1.0.

## License

MIT
