{"id":20049440,"url":"https://github.com/weaming/poseidon-rules","last_synced_at":"2025-07-08T23:04:44.784Z","repository":{"id":57454244,"uuid":"207738598","full_name":"weaming/poseidon-rules","owner":"weaming","description":"Validate complex json data against rules you defined","archived":false,"fork":false,"pushed_at":"2019-12-20T09:29:24.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-09T03:44:18.004Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/weaming.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-11T06:24:22.000Z","updated_at":"2020-02-03T08:31:35.000Z","dependencies_parsed_at":"2022-08-29T05:30:12.401Z","dependency_job_id":null,"html_url":"https://github.com/weaming/poseidon-rules","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/weaming/poseidon-rules","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaming%2Fposeidon-rules","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaming%2Fposeidon-rules/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaming%2Fposeidon-rules/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaming%2Fposeidon-rules/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weaming","download_url":"https://codeload.github.com/weaming/poseidon-rules/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weaming%2Fposeidon-rules/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264363749,"owners_count":23596502,"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-13T11:50:00.738Z","updated_at":"2025-07-08T23:04:44.769Z","avatar_url":"https://github.com/weaming.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Poseidon Rules\n\nValidate complex json data against rules you defined.\n\n## Philosophy of this library\n\nBusiness code has complex logic, and they can be wrapped deeply, so we need a DSL to define these rules in one place.\n\nEvery logic can have two basci relation, `and` or `or`, but the `not` logic is left to the rule evaluation written by developer.\n\nOnce one rule is not satisfied, the whole logic rule will be falsy, call the help function `get_reason_stack` will find the deepest name of rule, aka the exception message wrapped in the `RuleFail`.\n\nRules is defined in dict format, which is bad compared to the Haskell lazy evaluation. So you can pass a closure function to the \"must\" or \"else_must\", which will be called when \"if\" is evaluated to true (\"must\") or false (\"else_must\") at runtime, instead of define-time. This feature make you free from caring about the exception in some situations.\n\n## Usage\n\nSee [test](poseidon_rules/test_statement.py)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweaming%2Fposeidon-rules","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweaming%2Fposeidon-rules","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweaming%2Fposeidon-rules/lists"}