{"id":33346011,"url":"https://github.com/openfactoryio/openfactory-asset-api","last_synced_at":"2026-03-01T23:31:29.392Z","repository":{"id":307610355,"uuid":"1029865949","full_name":"openfactoryio/openfactory-asset-api","owner":"openfactoryio","description":"OpenFactory Serving Layer for Assets","archived":false,"fork":false,"pushed_at":"2025-11-22T03:58:23.000Z","size":109,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-22T06:02:21.647Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openfactoryio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-07-31T17:42:47.000Z","updated_at":"2025-11-22T03:58:27.000Z","dependencies_parsed_at":"2025-08-01T07:45:13.343Z","dependency_job_id":"29c688b0-7f36-4572-91ad-9c6ad9266ad4","html_url":"https://github.com/openfactoryio/openfactory-asset-api","commit_stats":null,"previous_names":["openfactoryio/openfactory-asset-api"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/openfactoryio/openfactory-asset-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfactoryio%2Fopenfactory-asset-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfactoryio%2Fopenfactory-asset-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfactoryio%2Fopenfactory-asset-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfactoryio%2Fopenfactory-asset-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openfactoryio","download_url":"https://codeload.github.com/openfactoryio/openfactory-asset-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfactoryio%2Fopenfactory-asset-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29987698,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T22:42:38.399Z","status":"ssl_error","status_checked_at":"2026-03-01T22:41:51.863Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-22T06:00:25.507Z","updated_at":"2026-03-01T23:31:29.369Z","avatar_url":"https://github.com/openfactoryio.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenFactory-AssetAPI — Serving Layer for Asset Data\n\n[![Dev Container Ready](https://img.shields.io/badge/devcontainer-ready-green?logo=visualstudiocode\\\u0026labelColor=2c2c2c)](docs/devcontainer.md) \u003cimg src=\"https://img.shields.io/badge/python-3.12-blue?logo=python\u0026logoColor=white\" alt=\"Python Version\" /\u003e\n![License](https://img.shields.io/github/license/openfactoryio/openfactory-asset-api?style=flat-square) \u003cimg src=\"https://img.shields.io/badge/release-pre--release-yellow\" alt=\"Pre-Release\" /\u003e\n\n---\n\n**OpenFactory-AssetAPI** is the core serving layer within the [OpenFactory](https://github.com/Demo-Smart-Factory-Concordia-University/OpenFactory) platform. It provides efficient access to **real-time** and **computed asset data** through:\n\n* 🔎 **State query endpoints**\n* 📡 **Streaming interfaces**\n\nIts modular, plugin-based architecture supports flexible deployment and grouping strategies, tailored to various industrial environments.\n\n---\n\n## 🚀 Quick Start\n\n\u003e This guide assumes deployment on an OpenFactory **Swarm** cluster.\n\n### ✅ Prerequisites\n\n* Python 3.12+\n* Docker\n* A running OpenFactory Swarm cluster\n* (Optional) `jq` for pretty-printing JSON responses\n\n---\n\n### 🔧 1. Configure Environment\n\nCreate a `.env` file or export the following variables:\n\n```env\nGROUPING_STRATEGY=workcenter\nDEPLOYMENT_PLATFORM=swarm\nKSQLDB_URL=http://\u003cksqldb-ip\u003e:8088\nKAFKA_BROKER=\u003ckafka-broker-ip\u003e:9092\n```\n\n---\n\n### ▶️ 2. Run\n\nInstall the package on a Swarm **manager node** of your OpenFactory cluster:\n\n```bash\npip install -e .\n```\n\nDeploy the services:\n\n```bash\nmanage deploy\n```\n\n---\n\n### 🌐 3. Interact with the API\n\nQuery asset state:\n\n```bash\ncurl \"http://\u003cOpenFactory-Cluster-IP\u003e:5555/asset_state?asset_uuid=PROVER3018\" | jq\n```\n\nGet specific asset data:\n\n```bash\ncurl \"http://\u003cOpenFactory-Cluster-IP\u003e:5555/asset_state?asset_uuid=PROVER3018\u0026id=avail\" | jq\n```\n\nStream real-time telemetry:\n\n```bash\ncurl \"http://\u003cOpenFactory-Cluster-IP\u003e:5555/asset_stream?asset_uuid=PROVER3018\"\n```\n\n---\n\n## 🧩 Plugin System\n\nThe routing layer loads **grouping strategies** and **deployment platforms** dynamically using Python [entry points](https://packaging.python.org/en/latest/specifications/entry-points/) defined in `pyproject.toml`.\n\nThis enables:\n\n* 🕹️ Runtime plugin selection via environment variables:\n\n  * `GROUPING_STRATEGY`\n  * `DEPLOYMENT_PLATFORM`\n* ➕ Easy plugin extension without modifying core code\n\n**Default plugins:**\n\n* Grouping: `workcenter`\n* Deployment: `swarm`, `docker`\n\n\u003cdetails\u003e\n\u003csummary\u003eℹ️ \u003cstrong\u003eDocker Deployment Info\u003c/strong\u003e\u003c/summary\u003e\n\nWhen using the \u003ccode\u003edocker\u003c/code\u003e deployment platform, start the local server manually with:\n\n```bash\nmanage runserver\n```\n\n\u003c/details\u003e\n\n---\n\n## 🛠 Development\n\n### 🧪 Install for Dev\n\nInstall in editable mode with dev tools:\n\n```bash\npip install -e .[dev]\n./dev-setup.sh  # installs latest openfactory-core\n```\n\u003e 🔧 For a zero-config local dev environment using Docker and VS Code, see [Development Container Setup](./docs/devcontainer.md)\n---\n\n### 💻 CLI Commands\n\nUse the `manage` command for development tasks:\n\n```bash\nmanage deploy       # deploys services and streams\nmanage runserver    # starts local API server\nmanage teardown     # cleans up services\n```\n\n\u003e 💡 `manage` requires the package to be installed in editable mode.\n\n---\n\n### ✅ Code Quality\n\nRun linting checks with:\n\n```bash\nflake8 .\n```\n\n---\n\n## ⚙️ Configuration\n\nKey environment variables:\n\n| Variable              | Description                    | Default      |\n| --------------------- | ------------------------------ | ------------ |\n| `GROUPING_STRATEGY`   | Grouping plugin to load        | `workcenter` |\n| `DEPLOYMENT_PLATFORM` | Deployment plugin to load      | `swarm`      |\n| `KSQLDB_URL`          | ksqlDB endpoint URL            | *(None)*     |\n| `KAFKA_BROKER`        | Kafka bootstrap server address | *(None)*     |\n\n📚 For full configuration details, refer to:\n\n* [`routing_layer/app/config.py`](routing_layer/app/config.py)\n* [Routing Layer README](routing_layer/README.md#️-environment-configuration)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfactoryio%2Fopenfactory-asset-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenfactoryio%2Fopenfactory-asset-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfactoryio%2Fopenfactory-asset-api/lists"}