{"id":22903996,"url":"https://github.com/json2d/validium","last_synced_at":"2025-07-25T02:12:15.870Z","repository":{"id":57477391,"uuid":"243870073","full_name":"json2d/validium","owner":"json2d","description":"a functional library for creating validators in Python","archived":false,"fork":false,"pushed_at":"2020-03-21T00:02:05.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-08T11:11:25.754Z","etag":null,"topics":["functional-programming","validation"],"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/json2d.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-02-28T23:05:59.000Z","updated_at":"2021-06-10T04:21:31.000Z","dependencies_parsed_at":"2022-08-30T13:02:07.849Z","dependency_job_id":null,"html_url":"https://github.com/json2d/validium","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/json2d/validium","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fvalidium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fvalidium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fvalidium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fvalidium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/json2d","download_url":"https://codeload.github.com/json2d/validium/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/json2d%2Fvalidium/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266944044,"owners_count":24010481,"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","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["functional-programming","validation"],"created_at":"2024-12-14T02:39:42.891Z","updated_at":"2025-07-25T02:12:15.782Z","avatar_url":"https://github.com/json2d.png","language":"Python","readme":"# validium\na Python utility library for performing validations flexibly\n\n## Installation\n\n```bash\npip install validium\n```\n\n## Quick Start\n\nHere's an example of how to create and use some very simple validators for some numbers:\n\n```py\nimport validium as V\n\nPI = 3.14\nONE = 1\n\nis_number = V.Validator(lambda x: isinstance(x, Number), 'must be a number')\n\nis_number.validate(PI) # pass\nis_number.validate(ONE) # pass\n\nis_positive = V.Validator(lambda x: x \u003e 0, 'must be positive')\n\nis_positive.validate(PI) # pass\nis_positive.validate(ONE) # pass\n\nis_not_one = V.Validator(lambda x: not x == 1, 'must not equal 1')\n\nis_not_one.validate(PI) # pass\nis_not_one.validate(ONE) # AssertionError: must not equal 1\n\n```\n\n### Building Up\n\nHere's an example of how to parameterize and reuse a common validator pattern:\n\n```py\nis_not = lambda y: V.Validator(lambda x: not x == y, 'must not equal {}'.format(x)) # u\n\nis_not(-1).validate(ONE) # pass\nis_not(0).validate(ONE) # pass\nis_not(1).validate(ONE) # AssertionError: must not equal 1\n\n```\n\nThis approach will help keep your code nice and DRY in the event you need handful of validators that behave mostly the same but slightly different.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjson2d%2Fvalidium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjson2d%2Fvalidium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjson2d%2Fvalidium/lists"}