{"id":29927511,"url":"https://github.com/raymondpelletier/jertl","last_synced_at":"2026-05-18T00:06:44.686Z","repository":{"id":62046616,"uuid":"552997676","full_name":"RaymondPelletier/jertl","owner":"RaymondPelletier","description":"A minimum viable Python package for processing structured data","archived":false,"fork":false,"pushed_at":"2022-11-14T18:53:18.000Z","size":307,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-29T16:41:59.171Z","etag":null,"topics":["json","mini-language","python","structured-data","virtual-machine"],"latest_commit_sha":null,"homepage":"","language":"Python","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/RaymondPelletier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-17T14:52:39.000Z","updated_at":"2022-10-26T20:07:24.000Z","dependencies_parsed_at":"2023-01-21T19:01:00.337Z","dependency_job_id":null,"html_url":"https://github.com/RaymondPelletier/jertl","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/RaymondPelletier/jertl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaymondPelletier%2Fjertl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaymondPelletier%2Fjertl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaymondPelletier%2Fjertl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaymondPelletier%2Fjertl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RaymondPelletier","download_url":"https://codeload.github.com/RaymondPelletier/jertl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaymondPelletier%2Fjertl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268394071,"owners_count":24243350,"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-02T02:00:12.353Z","response_time":74,"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":["json","mini-language","python","structured-data","virtual-machine"],"created_at":"2025-08-02T13:10:55.978Z","updated_at":"2026-05-18T00:06:37.633Z","avatar_url":"https://github.com/RaymondPelletier.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- jertl documentation master file, created by\nsphinx-quickstart on Mon Oct 17 12:15:46 2022.\nYou can adapt this file completely to your liking, but it should at least\ncontain the root `toctree` directive. --\u003e\n# jertl - A minimum viable package for processing structured data\n\nWhere developers declaratively define and execute common operations on complex data structures.\n\nOperations are specified using a mini-language in which target structures are visually similar to their textual representation.\n\n## Examples\n\n### Matching\n\nJertl can be used to verify the structure of data, select nested values, or both.\n\n```python\n\u003e\u003e\u003e movie = {\"title\": \"Pinocchio\", \"MPAA rating\": \"PG\"}\n\u003e\u003e\u003e\n\u003e\u003e\u003e match = jertl.match('{\"title\": title, \"MPAA rating\": \"PG\"}', movie)\n\u003e\u003e\u003e\n\u003e\u003e\u003e if match is not None:\n...     print(match.bindings['title'])\n...\nPinocchio\n```\n\n### Filling\n\nJertl can also be used as a template library.\n\n```python\n\u003e\u003e\u003e jertl.fill('{\"name\": name, \"age\": age, \"status\": status}',\n...            name=\"Ray\",\n...            age=66,\n...            status='employed')\n{'name': 'Ray', 'age': 66, 'status': 'employed'}\n```\n\n### Transforming\n\nData transformations are defined using representations of the source and target data.\n\n```python\n\u003e\u003e\u003e retire = '{\"status\": \"employed\", **the_rest} --\u003e {\"status\": \"retired\", **the_rest}'\n\u003e\u003e\u003e\n\u003e\u003e\u003e ray = {'name': 'Ray', 'age': 66, 'status': 'employed'}\n\u003e\u003e\u003e\n\u003e\u003e\u003e transformation = jertl.transform(retire, ray)\n\u003e\u003e\u003e transformation.filled\n{'status': 'retired', 'name': 'Ray', 'age': 66}\n```\n\n### Collating\n\nYou can use Jertl to verify relationships between data structures.\n\n```python\n\u003e\u003e\u003e supervises = '''\n...     supervisor ~ {\"underlings\": [*_, name, *_]}\n...     employee   ~ {\"name\": name}\n...     '''\n\u003e\u003e\u003e\n\u003e\u003e\u003e jeremy = {'name': 'Jeremy'}\n\u003e\u003e\u003e jeff   = {'name': 'Jeff', 'underlings': ['Jimmy', 'Johnny', 'Jeremy', 'Joe']}\n\u003e\u003e\u003e\n\u003e\u003e\u003e collation = jertl.collate(supervises, supervisor=jeff, employee=jeremy)\n\u003e\u003e\u003e collation is not None\nTrue\n```\n\n### Inferring\n\nCombining all these operations gives you an inference engine.\n\n```python\n\u003e\u003e\u003e rule = '''\n...    //\n...    // Create a list of movies with their ratings explained\n...    //\n...    movies       ~ [*_, {\"title\": title, \"MPAA rating\": rating},        *_]\n...    MPAA_ratings ~ [*_, {\"rating\": rating, \"explanation\": explanation}, *_]\n... --\u003e\n...    movie       := {\"title\": title, \"contents\": explanation}\n...'''\n...\n\u003e\u003e\u003e movies = [{'title': 'Toy Story',                          'MPAA rating': 'G'},\n...           {'title': 'South Park: Bigger, Longer \u0026 Uncut', 'MPAA rating': 'NC-17'}]\n...\n\u003e\u003e\u003e MPAA_ratings = [{'rating':      'G',\n...                  'summary':     'GENERAL AUDIENCES',\n...                  'explanation': 'Nothing to offend parents for viewing by children.'},\n...                 {'rating':      'PG',\n...                  'summary':     'PARENTAL GUIDANCE SUGGESTED',\n...                  'explanation': 'May contain some material parents might not like for their young children'},\n...                 {'rating':      'PG-13',\n...                  'summary':     'PARENTS STRONGLY CAUTIONED',\n...                  'explanation': 'Some material may be inappropriate for pre-teens.'},\n...                 {'rating':      'R',\n...                  'summary':     'RESTRICTED',\n...                  'explanation': 'Contains some adult material.'},\n...                 {'rating':      'NC-17',\n...                  'summary':     'NO ONE 17 AND UNDER ADMITTED',\n...                  'explanation': 'Clearly for adults only.'}]\n...\n\u003e\u003e\u003e for inference in jertl.infer_all(rule, movies=movies, MPAA_ratings=MPAA_ratings):\n...     print(inference.fills['movie'])\n...\n{'title': 'Toy Story', 'contents': 'Nothing to offend parents for viewing by children.'}\n{'title': 'South Park: Bigger, Longer \u0026 Uncut', 'contents': 'Clearly for adults only.'}\n```\n\n## Installation\n\n```bash\npip install jertl\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraymondpelletier%2Fjertl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraymondpelletier%2Fjertl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraymondpelletier%2Fjertl/lists"}