# silentwolfproject/onewayswp-py architecture

> Architecture diagram of the GitHub repository silentwolfproject/onewayswp-py, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/silentwolfproject/onewayswp-py
- Repository: https://github.com/silentwolfproject/onewayswp-py

## Overview

OnewaySWP is a Python interface to a platform-specific native core for offline license issuance and verification. The main workflow is Admin loading or generating keys, creating a signed date/credit/duration license, and distributing its token; a Client loads the public key, validates the token into local state, then verifies or manages that state. The graph includes documented credit, session, and state-transfer capabilities. Native implementation internals are not shown, so edges stop at the native-core boundary; some documented capabilities are not directly excerpted in Python.

Main entry points: [`onewayswp/client.py`](https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/client.py) (Client API), [`onewayswp/admin.py`](https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/admin.py) (Admin API), [`onewayswp/_core.py`](https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/_core.py) (Native core bridge), [`onewayswp/info.py`](https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/info.py) (Library information)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_issuance["Admin issuance"]
  node_admin["Admin API<br/>[admin.py]"]
  node_keyfiles["Key files<br/>[admin.py]"]
  node_license_token["License token"]
end

subgraph group_client["Client verification"]
  node_client_api["Client API<br/>[client.py]"]
  node_public_key["Public key<br/>[client.py]"]
  node_local_state[("Local license state<br/>[client.py]")]
end

subgraph group_runtime["Native bridge"]
  node_native_bridge["Native core bridge<br/>[_core.py]"]
  node_native_lib["Platform native library"]
end

subgraph group_support["Package support"]
  node_error_mapping["Error mapping<br/>[exceptions.py]"]
  node_library_info["Library information<br/>[info.py]"]
  node_package_api["Package exports<br/>[__init__.py]"]
end

node_developer(("Application developer"))

node_developer -->|"uses"| node_admin
node_admin -->|"requests keys"| node_native_bridge
node_admin -->|"loads or saves"| node_keyfiles
node_native_bridge -->|"calls FFI"| node_native_lib
node_admin -->|"creates"| node_license_token
node_license_token -->|"distributes token"| node_client_api
node_developer -->|"uses"| node_client_api
node_client_api -->|"loads"| node_public_key
node_client_api -->|"validates token"| node_native_bridge
node_client_api -->|"writes or checks"| node_local_state
node_client_api -->|"manages state"| node_native_bridge
node_client_api -->|"raises mapped errors"| node_error_mapping
node_admin -->|"raises mapped errors"| node_error_mapping
node_library_info -->|"fetches info"| node_native_bridge
node_developer -->|"queries"| node_library_info
node_developer -->|"imports API"| node_package_api
node_client_api -->|"starts and stops sessions"| node_client_api
node_client_api -->|"exports or imports"| node_local_state

click node_admin "https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/admin.py"
click node_keyfiles "https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/admin.py"
click node_client_api "https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/client.py"
click node_public_key "https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/client.py"
click node_local_state "https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/client.py"
click node_native_bridge "https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/_core.py"
click node_native_lib "https://github.com/silentwolfproject/onewayswp-py/tree/main/onewayswp/lib"
click node_error_mapping "https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/exceptions.py"
click node_library_info "https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/info.py"
click node_package_api "https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/__init__.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_admin,node_keyfiles,node_license_token toneBlue
class node_client_api,node_public_key,node_local_state toneAmber
class node_native_bridge,node_native_lib toneMint
class node_error_mapping,node_library_info,node_package_api toneRose
class node_developer toneIndigo
```

## Components

### Admin issuance

- [Admin API](https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/admin.py): `onewayswp/admin.py`
- [Key files](https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/admin.py): `onewayswp/admin.py`
- **License token**

### Client verification

- [Client API](https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/client.py): `onewayswp/client.py`
- [Public key](https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/client.py): `onewayswp/client.py`
- [Local license state](https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/client.py): `onewayswp/client.py`

### Native bridge

- [Native core bridge](https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/_core.py): `onewayswp/_core.py`
- [Platform native library](https://github.com/silentwolfproject/onewayswp-py/tree/main/onewayswp/lib): `onewayswp/lib`

### Package support

- [Error mapping](https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/exceptions.py): `onewayswp/exceptions.py`
- [Library information](https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/info.py): `onewayswp/info.py`
- [Package exports](https://github.com/silentwolfproject/onewayswp-py/blob/main/onewayswp/__init__.py): `onewayswp/__init__.py`

### Other components

- **Application developer**

## Connections

- Application developer → Admin API: uses (evidence: `README.md`)
- Admin API → Native core bridge: requests keys (evidence: `onewayswp/admin.py`)
- Admin API → Key files: loads or saves (evidence: `onewayswp/admin.py`)
- Native core bridge → Platform native library: calls FFI (evidence: `onewayswp/_core.py`)
- Admin API → License token: creates (evidence: `README.md`)
- License token → Client API: distributes token (evidence: `README.md`)
- Application developer → Client API: uses (evidence: `README.md`)
- Client API → Public key: loads (evidence: `onewayswp/client.py`)
- Client API → Native core bridge: validates token (evidence: `onewayswp/client.py`)
- Client API → Local license state: writes or checks (evidence: `onewayswp/client.py`)
- Client API → Native core bridge: manages state (evidence: `onewayswp/client.py`)
- Client API → Error mapping: raises mapped errors (evidence: `onewayswp/client.py`)
- Admin API → Error mapping: raises mapped errors (evidence: `onewayswp/admin.py`)
- Library information → Native core bridge: fetches info (evidence: `onewayswp/info.py`)
- Application developer → Library information: queries
- Application developer → Package exports: imports API (evidence: `onewayswp/__init__.py`)
- Client API → Client API: starts and stops sessions (evidence: `onewayswp/client.py`)
- Client API → Local license state: exports or imports (evidence: `README.md`)
