{"id":15102749,"url":"https://github.com/rancorm/castor","last_synced_at":"2026-01-18T00:22:24.996Z","repository":{"id":222527836,"uuid":"756657566","full_name":"rancorm/castor","owner":"rancorm","description":"mitmproxy add-on that captures JSON schemas","archived":false,"fork":false,"pushed_at":"2024-02-18T12:26:36.000Z","size":92,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T22:45:45.375Z","etag":null,"topics":["http","json","json-schema","mitmproxy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rancorm.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}},"created_at":"2024-02-13T03:32:36.000Z","updated_at":"2024-02-14T17:48:06.000Z","dependencies_parsed_at":"2024-02-18T13:30:56.998Z","dependency_job_id":null,"html_url":"https://github.com/rancorm/castor","commit_stats":null,"previous_names":["rancorm/castor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rancorm%2Fcastor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rancorm%2Fcastor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rancorm%2Fcastor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rancorm%2Fcastor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rancorm","download_url":"https://codeload.github.com/rancorm/castor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332525,"owners_count":20921852,"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":["http","json","json-schema","mitmproxy"],"created_at":"2024-09-25T19:06:01.447Z","updated_at":"2026-01-18T00:22:24.960Z","avatar_url":"https://github.com/rancorm.png","language":"Python","readme":"# Castor\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/rancorm/castor/main/beaver.png\" width=\"200\" height=\"200\" alt=\"Castor logo\" /\u003e\n\u003c/p\u003e\n\nImage is sourced from [pngimg](https://pngimg.com/image/31353).\n\nmitmproxy add-on that captures JSON schemas.\n\n## Start here\n\nClone this repository.\n\n```sh\ngit clone https://github.com/rancorm/castor.git\ncd castor\n```\n\nMake Python virtual environment, install dependencies, and run.\n\n```sh\npython -m venv .venv\npip install -r requirements.txt\n```\n\nRun `mitmproxy` terminal UI, `mitmdump` or `mitmweb` with the add-on script `castor.py`.\n\n```sh\nmitmproxy -s ./castor.py\n```\n\nRun with web server UI.\n\n```sh\nmitmweb -s ./castor.py\n```\n\nOn the Flow \u003e Response tab, change **View** to `json-schema`, or\nset the `CASTOR_AUTO_RENDER` to `1` to auto render JSON resquest and responses\nto JSON schemas.\n\nDump to the console with `mitmdump`.\n\n```sh\nmitmdump -s ./castor.py\n```\n\n## Output\n\nExample output from `mitmdump` generated JSON schema.\n\n```json\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"Code\": {\n      \"type\": \"int\"\n    },\n    \"CalendarModelEventID\": {\n      \"type\": \"str\",\n      \"pattern\": \"uri\"\n    },\n    \"Refresh\": {\n      \"type\": \"int\"\n    },\n    \"More\": {\n      \"type\": \"int\"\n    }\n  }\n}\n```\n\n## Options\n\nDisable checks of content type, set `CASTOR_CHECKS` to `0`. To disable the\nauto rendering of JSON to JSON schema, set `CASTOR_AUTO_RENDER` to `1`.\n\n## Saving to disk\n\nTo save generated schema to disk, set `CASTOR_OUTPUT` to the path for saving.\n\n```sh\nexport CASTOR_OUTPUT=/mnt/data\n```\n\nThis can perticularly be useful with persisent storage volumes inside containers.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Francorm%2Fcastor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Francorm%2Fcastor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Francorm%2Fcastor/lists"}