Metadata-Version: 2.4
Name: can_py_state_machine
Version: 0.1.0
Summary: A lightweight Python implementation of a generic, event-driven state machine inspired by can-state-machine.
Author-email: Eren Havuc <e.havuc@draykant.eu>
License: MIT License
        
        Copyright (c) 2025
        
        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.
Project-URL: Homepage, https://github.com/hayde/ocr-state-machine.git
Project-URL: Repository, https://github.com/hayde/ocr-state-machine.git
Keywords: state-machine,workflow,finite-state-machine
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Can State Machine (CSM)

**Can State Machinew** is an architectural and programming approach focused on replacing traditional sequential logic with explicit state machine modeling — making complex behavior easier to understand, test, and evolve.

It's called *Can State Machine* not only as a nod to state-driven architecture, but also as a personal imprint: this philosophy originates from **Can** — and yes, *state can flow*.

---

## 🌱 Why Can State Machine?

In modern software systems, control flow is often hidden deep inside long function chains, async callbacks, and implicit branching logic. This makes code harder to maintain, test, and reason about over time.

**Can State Machine (CSM)** embraces a different idea:

> ✨ Treat all control logic as a **flow of explicit states** — where every transition is visible, named, and controlled.

This mindset is especially powerful in domains like:

- Complex UI/UX flows
- Business rule engines
- Long-running backend processes
- Reactive systems
- Async orchestration (e.g. workflows, jobs, handlers)

---

## 🧠 What is State Machine Modeling?

State machine modeling describes a system in terms of:

- A **set of states**
- A set of **events** or **conditions**
- A defined set of **transitions** between states
- (Optionally) side effects or actions triggered by transitions

This structure gives you **predictability** and **declarative control** — instead of spaghetti-like control flow logic.

---

## ✅ Benefits of CSF

| Benefit         | Why it matters                                                                 |
|------------------|---------------------------------------------------------------------------------|
| **Maintainability** | Every transition is named, controlled, and visual — no mystery logic buried in conditionals. |
| **Transparency**    | The logic is modeled *declaratively* — what happens is described, not encoded. |
| **Predictability**  | You always know what state you're in, and what can happen next. |
| **Testability**     | States and transitions can be tested in isolation, without simulating entire flows. |
