{"id":19351683,"url":"https://github.com/operable/pycog3","last_synced_at":"2025-06-16T09:34:00.230Z","repository":{"id":57455796,"uuid":"60778714","full_name":"operable/pycog3","owner":"operable","description":"Python3 command SDK for the Cog ChatOps platform","archived":false,"fork":false,"pushed_at":"2017-11-13T00:11:16.000Z","size":12,"stargazers_count":3,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-20T01:09:24.749Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/operable.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.MD","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-09T13:54:36.000Z","updated_at":"2024-01-03T14:13:47.000Z","dependencies_parsed_at":"2022-09-05T20:00:26.968Z","dependency_job_id":null,"html_url":"https://github.com/operable/pycog3","commit_stats":null,"previous_names":["cog-bundles/pycog3"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/operable/pycog3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operable%2Fpycog3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operable%2Fpycog3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operable%2Fpycog3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operable%2Fpycog3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/operable","download_url":"https://codeload.github.com/operable/pycog3/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operable%2Fpycog3/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260133822,"owners_count":22963803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-11-10T04:36:56.970Z","updated_at":"2025-06-16T09:34:00.207Z","avatar_url":"https://github.com/operable.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/operable/pycog3.svg?branch=master)](https://travis-ci.org/operable/pycog3)\n\n# pycog3\n\nSimple, opinionated library for building Cog commands in Python3.\n\n## Usage\n\npycog3 combines information available in the Cog runtime environment\nwith assumptions about Python project structure to simplify command\ndevelopment.\n\npycog3 includes a driver executable, [bin/cog-command](https://github.com/cog-bundles/pycog3/blob/master/bin/cog-command), which dynamically\nimports, instantiates, and runs Python command code based on the\nvalues of `$COG_BUNDLE` and `$COG_COMMAND`.\n\n`cog-command`'s magic requires that Python projects follow a strict\ndirectory layout (basic):\n\n```\n\u003cbundle_name\u003e\n  |\n  |-- \u003cbundle_name\u003e\n       |-- __init__.py\n       |-- commands\n           |\n           |-- __init__.py\n           |-- \u003ccommand1\u003e.py\n           |-- \u003ccommand2\u003e.py\n\n```\n\npycog3 also supports more advanced, multi-level structure when using the `-` field separator in the command name. \nFor example, defining:\n * `commands\\commanda.py` - maps to `!commanda`\n * `commands\\level1\\commandb.py` - maps to `!level1-commandb`\n * `commands\\level1\\level2a\\commandc.py` - maps to `!level1-level2a-commandb`\n * `commands\\level1\\level2b\\leveln\\commandz.py` - maps to `!level1-level2b-leveln-commandz`\n \n\n```\n\u003cbundle_directory\u003e\n  |\n  |-- \u003cbundle_name\u003e\n       |-- __init__.py\n       |-- commands\n           |\n           |-- __init__.py\n           |-- \u003ccommanda\u003e.py\n           |-- \u003ccommandb\u003e.py\n           .\n           .\n           |-- \u003ccommandz\u003e.py\n           |\n           |-- \u003clevel1\u003e\n                |\n                |-- __init__.py\n                |-- \u003ccommanda\u003e.py\n                |-- \u003ccommandb\u003e.py\n                .\n                .\n                |-- \u003ccommandz\u003e.py\n                |\n                |-- \u003clevel2a\u003e\n                |    |\n                |    |-- \u003ccommanda\u003e.py\n                |    |-- \u003ccommandb\u003e.py\n                |    |-- \u003ccommandc\u003e.py\n                |    .\n                |    .\n                |    |-- \u003ccommandz\u003e.py\n                |\n                |-- \u003clevel2b\u003e\n                     |\n                     |-- __init__.py\n                     |-- \u003c...\u003e\n                         |\n                         |-- __init__.py\n                         | -- \u003cleveln\u003e\n                              |\n                              |-- __init__.py\n                              |-- \u003ccommanda\u003e.py\n                              |-- \u003ccommandb\u003e.py\n                              .\n                              .\n                              |-- \u003ccommandz\u003e.py\n\n```\n\nThe only requirement is a class with the same name of the filename should exist (first letter capital).\n\n## Examples\n\nSee the [cog-bundles/statuspage](https://github.com/cog-bundles/statuspage) repository for an example of this library in action.\n\nIf you're interested in the multi-level usage, check the cog-bundle [pi-bundle](https://github.com/pan-net-security/pi-bundle) or the test bundle in `test/`.\n\n## Installation\n\nAdd this line to your application's setup.py or requirements.txt:\n\n```\npycog3\u003e=0.1.28\n```\n\n## TODO\n\n- Add [Cog service](http://docs.operable.io/docs/services) support\n- Add transparent accumulation support a la [cog-bundles/cog-rb](https://github.com/cog-bundles/cog-rb)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foperable%2Fpycog3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foperable%2Fpycog3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foperable%2Fpycog3/lists"}