{"id":37719251,"url":"https://github.com/moff4/schema_schecker","last_synced_at":"2026-01-16T13:31:00.743Z","repository":{"id":57464307,"uuid":"275565445","full_name":"moff4/schema_schecker","owner":"moff4","description":"Another schema validator :)","archived":false,"fork":false,"pushed_at":"2021-03-25T12:05:50.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-29T13:02:35.698Z","etag":null,"topics":["schema-validator"],"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/moff4.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}},"created_at":"2020-06-28T10:56:58.000Z","updated_at":"2022-05-11T12:11:36.000Z","dependencies_parsed_at":"2022-09-17T14:30:32.442Z","dependency_job_id":null,"html_url":"https://github.com/moff4/schema_schecker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/moff4/schema_schecker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moff4%2Fschema_schecker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moff4%2Fschema_schecker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moff4%2Fschema_schecker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moff4%2Fschema_schecker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moff4","download_url":"https://codeload.github.com/moff4/schema_schecker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moff4%2Fschema_schecker/sbom","scorecard":{"id":656352,"data":{"date":"2025-08-11","repo":{"name":"github.com/moff4/schema_schecker","commit":"7c143dd8a604f69c823df6dbc41d786b02c52d3c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/20 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-21T14:44:46.402Z","repository_id":57464307,"created_at":"2025-08-21T14:44:46.403Z","updated_at":"2025-08-21T14:44:46.403Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"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":["schema-validator"],"created_at":"2026-01-16T13:31:00.675Z","updated_at":"2026-01-16T13:31:00.734Z","avatar_url":"https://github.com/moff4.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Schema checker #\n\nAnother schema validator :)\n\n[![Build Status](https://travis-ci.org/moff4/schema_schecker.svg?branch=master)](https://travis-ci.org/moff4/schema_schecker)\n[![CodeFactor](https://www.codefactor.io/repository/github/moff4/schema_schecker/badge)](https://www.codefactor.io/repository/github/moff4/schema_schecker)\n[![codecov](https://codecov.io/gh/moff4/schema_schecker/branch/master/graph/badge.svg)](https://codecov.io/gh/moff4/schema_schecker)\n\nFeatures:\n* Can validate any dict object (not only json)\n* Very customizeble\n\n## Tutorial\n\nBase validation function:\n```python\ndef validate(obj: dict, schema: dict) -\u003e dict:\n    ... \n```\nwhere\n```\nobj - some object\nschema - schema_checker\nschema ::= type of this object : list/dict/str/int/float (can be tuple of types) or \"const\"/\"enum\"\n  OR\nschema ::= dict - {\n  type         : type of this object : \"list/tuple/dict/str/int/float or \"const\"\n  \"value\"      : need for obj type of\n                   - list/tuple - is schema for all elements in list\n                   - dict - dict[key -\u003e schema]\n                   - const - some value to be compared with using method\n                   - enum - list/set/dict/tuple to check if obj __contains__ in \"value\"\n  \"any_key\"     : need for obj type of dict - schema for all keys (ignores if value is set)\n  \"default\"    : default value if this object does not exists (if callable will be called)\n  \"filter\"     : any of\n                   - Callable[value -\u003e bool] - if false then raise error\n                   - Iterable[Callable[value -\u003e bool]] - if any of them return false then raise error\n  \"pre_call\"   : any of\n                   - Callable[value -\u003e value] - will be called before checking type and call filter's functions\n                   - Iterable[Callable[value -\u003e value]] - will call all of them\n  \"post_call\"  : any of\n                   - Callable[value -\u003e value] - will be called after checking type and call filter's functions\n                   - Iterable[Callable[value -\u003e value]] - will call all of them\n  \"blank\"      : raise error if value is blank\n  \"max_length\" : extra check of length (len)\n  \"min_length\" : extra check of length (len)\n  \"unexpected\" : allow unexpected keys (for dict)\n  \"errmsg\"     : will be in ValueError in case of error on this level\n}\n```\n\n#### Extras\n\n##### decorator_constructor\n\n`def decorator_constructor(getter, setter)`\n\n`getter` must:\n - take same args as the function that'll be decorated\n - return dict for the schema validator\n \n`setter` must:\n - take 3 args: validated dict, source positional args as tuple, sourse keyword args as dict\n - return tuple and dict for positional and keywords args for the function tha'll be decorated\n\nreturns parameterized decorator, that expects schema\n\n##### kw_validator\n\n`def kw_validator(schema)`\n\nValidate only keyword args and ignores all positional \nThis decorator is the result of decorator_constructor\n\n\n##### pos_validator\n\n`def pos_validator(schema)`\n\nValidate only positional args and ignores all keywords \nThis decorator is the result of decorator_constructor\n\n\n##### args_validator\n`def args_validator(pos_schema: Dict[str, Any], kw_schema: Dict[str, Any]):`\n\nValidate both positional and keywords args\n\n\n## Examples\n\n```python\nfrom datetime import datetime, timedelta\nfrom schema_checker import validate, kw_validator\n\n# validate that obj is str\nvalidate(\n    obj='12345',\n    schema={'type': str},\n)  # result: '12345'\n\nvalidate(\n    obj=12345,\n    schema={'type': str},\n)  # raise ValueError\n\n# check if value is int and less then 5\nvalidate(\n    obj={'some_key': 10},\n    schema={\n        'type': dict,\n        'value': {\n            'some_key': {\n                'type': int,\n                'filter': lambda x: x \u003c 5,\n            },\n        }\n    },\n)  # raise ValueError \n\n\n# convert obj to datetime and compare with today's date\nvalidate(\n    obj='10.12.19',\n    schema={\n        'type': datetime,\n        'pre_call': lambda x: datetime.strptime(x, '%d.%m.%y'),\n        'filter': lambda x: (datetime.today() - timedelta(year=1)) \u003c= x \u003c= datetime.today(),  \n    },\n)  # result: datetime.datetime(2019, 12, 10, 0, 0)\n\n\n@kw_validator({'type': dict, 'values': {'a': str}})\ndef func(a):\n    return a\n\nfunc(123)  # ok\nfunc('123')  # ok\nfunc(a='123')  # ok\nfunc(a=123)  # raise ValueError\n\n```\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoff4%2Fschema_schecker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoff4%2Fschema_schecker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoff4%2Fschema_schecker/lists"}