{"id":19126308,"url":"https://github.com/santanusinha/hope","last_synced_at":"2025-08-16T07:25:03.030Z","repository":{"id":34240286,"uuid":"169697931","full_name":"santanusinha/hope","owner":"santanusinha","description":"Predicate expression language","archived":false,"fork":false,"pushed_at":"2025-07-22T12:38:50.000Z","size":355,"stargazers_count":18,"open_issues_count":6,"forks_count":16,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-22T14:39:02.177Z","etag":null,"topics":["filter","filtering","jackson","java","json","json-path","predicate-logic","predicates","rule-engine","rules"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/santanusinha.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,"zenodo":null}},"created_at":"2019-02-08T07:15:00.000Z","updated_at":"2025-07-22T12:38:54.000Z","dependencies_parsed_at":"2023-11-08T12:37:07.191Z","dependency_job_id":"de6fd04c-9317-4749-8588-9e8e08718ee6","html_url":"https://github.com/santanusinha/hope","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/santanusinha/hope","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santanusinha%2Fhope","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santanusinha%2Fhope/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santanusinha%2Fhope/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santanusinha%2Fhope/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/santanusinha","download_url":"https://codeload.github.com/santanusinha/hope/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/santanusinha%2Fhope/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270681882,"owners_count":24627461,"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-08-16T02:00:11.002Z","response_time":91,"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":["filter","filtering","jackson","java","json","json-path","predicate-logic","predicates","rule-engine","rules"],"created_at":"2024-11-09T05:39:04.330Z","updated_at":"2025-08-16T07:25:03.002Z","avatar_url":"https://github.com/santanusinha.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hope [![SonarCloud](https://github.com/santanusinha/hope/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/santanusinha/hope/actions/workflows/build.yml)\nHope is a high level language for predicate evaluation on JSON written in java. It uses jackson for json handling and json-path for value extraction.\n\n#### Sample Hope expressions/rules\n```\n '/val' + 2 \u003e 3\n '/a' + '/b' \u003c= math.abs('/c')\n ```\n \n#### Features\n- Simple syntax\n- Bunch of rich standard library functions built in\n- Performant\n- Easy to add custom functions\n# Getting started\n\n### Maven dependency\nUse the following dependency in your code.\n```\n    \u003cdependency\u003e\n        \u003cgroupId\u003eio.appform.hope\u003c/groupId\u003e\n        \u003cartifactId\u003ehope-lang\u003c/artifactId\u003e\n        \u003cversion\u003e2.0.6\u003c/version\u003e\n    \u003c/dependency\u003e\n```\n\n### Basic usage\nThe following steps can be used to parse and evaluate a predicate expression or rule.\n#### Create HopeLangEngine\nThe main class you need to know is `HopeLangEngine`. To use this class use the provided builder.\n```\n    final HopeLangEngine hope = HopeLangEngine.builder()\n                                .build();\n```\n\u003e **Note:** Creation of this class is a time-consuming affair. Create and re-use this. This class is thread-safe.\n#### Evaluate an expression\nThe following code snippet evaluates an expression against a parsed jackson Json node.\n```\n    final JsonNode root = new ObjectMapper().readTree(\"{\\\"val\\\" : 10 }\");\n    final String expr = \" '/val' + 2 \u003e 9\";\n    if(engine.evaluate(expr, root)) {\n        ...\n    }\n```\n\n\u003e For real life use cases, rule should be parsed only once and cached. Same cached rule can be evaluated multiple times by passing different payloads. See wiki for more details.\n\n# Documentation\nPlease go through the hope wiki for detailed documentation\n\n## License\nHope is licensed under Apache License Version 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsantanusinha%2Fhope","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsantanusinha%2Fhope","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsantanusinha%2Fhope/lists"}