{"id":26601396,"url":"https://github.com/calebwin/margin","last_synced_at":"2025-04-09T16:34:12.247Z","repository":{"id":100568268,"uuid":"150883168","full_name":"calebwin/margin","owner":"calebwin","description":"a Markov chain compiler for the DOT language","archived":false,"fork":false,"pushed_at":"2019-02-18T02:58:50.000Z","size":16,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T18:50:54.361Z","etag":null,"topics":["compiler","dot","graph","markov-chain","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/calebwin.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}},"created_at":"2018-09-29T16:34:12.000Z","updated_at":"2024-09-25T11:44:02.000Z","dependencies_parsed_at":"2023-05-15T23:45:23.308Z","dependency_job_id":null,"html_url":"https://github.com/calebwin/margin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebwin%2Fmargin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebwin%2Fmargin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebwin%2Fmargin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/calebwin%2Fmargin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/calebwin","download_url":"https://codeload.github.com/calebwin/margin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248067780,"owners_count":21042356,"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":["compiler","dot","graph","markov-chain","python"],"created_at":"2025-03-23T18:39:50.263Z","updated_at":"2025-04-09T16:34:12.240Z","avatar_url":"https://github.com/calebwin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Margin\nMargin is an utterly useless compiler for Markov chains. You can specify your Markov chains as DOT graphs.\n```dot\n/* weather_markov_chain.dot */\ndigraph my_weather_markov_chain {\n\t\"rain\" -\u003e \"sunny\" [label = 0.5];\n\t\"hail\" -\u003e \"snow\" [label = 1.0];\n\t\"rain\" -\u003e \"hail\" [label = 0.7];\n}\n```\nMargin will then compile the graph to a Python implementation of the Markov chain in a class.\n```\npython margin.py weather_markov_chain.dot\n```\n```python\n# weather_markov_chain.py\nclass my_markov_chain:\n\t.\n\t.\n\t.\n```\n\nAnd you can use it as follows\n```python\nmy_weather_predictor = my_markov_chain(\"rain\")\nmy_weather_predictor.step()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalebwin%2Fmargin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcalebwin%2Fmargin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcalebwin%2Fmargin/lists"}