{"id":21844135,"url":"https://github.com/altescy/pysonnet","last_synced_at":"2025-04-14T12:10:59.540Z","repository":{"id":222123115,"uuid":"754050426","full_name":"altescy/pysonnet","owner":"altescy","description":"📜 A pure Python implementation of the Jsonnet language","archived":false,"fork":false,"pushed_at":"2024-03-20T17:44:48.000Z","size":263,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-14T04:19:26.602Z","etag":null,"topics":["jsonnet","python"],"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/altescy.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}},"created_at":"2024-02-07T09:56:21.000Z","updated_at":"2024-04-14T04:19:26.602Z","dependencies_parsed_at":null,"dependency_job_id":"181432d0-7b7f-4aa6-b2ba-4c56f05383ff","html_url":"https://github.com/altescy/pysonnet","commit_stats":null,"previous_names":["altescy/pysonnet"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altescy%2Fpysonnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altescy%2Fpysonnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altescy%2Fpysonnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/altescy%2Fpysonnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/altescy","download_url":"https://codeload.github.com/altescy/pysonnet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248877958,"owners_count":21176244,"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":["jsonnet","python"],"created_at":"2024-11-27T22:18:33.002Z","updated_at":"2025-04-14T12:10:59.535Z","avatar_url":"https://github.com/altescy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📜 Pysonnet\n\n[![CI](https://github.com/altescy/pysonnet/actions/workflows/ci.yml/badge.svg)](https://github.com/altescy/pysonnet/actions/workflows/ci.yml)\n[![Python version](https://img.shields.io/pypi/pyversions/pysonnet)](https://github.com/altescy/pysonnet)\n[![License](https://img.shields.io/github/license/altescy/pysonnet)](https://github.com/altescy/pysonnet/blob/main/LICENSE)\n[![pypi version](https://img.shields.io/pypi/v/pysonnet)](https://pypi.org/project/pysonnet/)\n\nA pure Python implementation of the Jsonnet language.\n\n**Features**:\n- **Pure Python Implementation**: Fully written in Python, ensuring compatibility and ease of integration with Python projects.\n- **No External Dependencies**: Operates independently without the need for any external libraries, simplifying installation and use.\n\n\u003e [!IMPORTANT]\n\u003e Pysonnet is in the early stages of development.\n\u003e While it supports all Jsonnet syntax, it lacks some standard library features, and users might encounter bugs.\n\n## Installation\n\n```shell\npip install pysonnet\n```\n\n## Usage\n\nEvaluate a jsonnet file and generate a JSON string:\n\n```python\nimport pysonnet\n\njson_string = pysonnet.evaluate_file(\"path/to/file.jsonnet\", ext_vars={...})\n```\n\nLoad a string and generate a Python object:\n\n```python\nimport pysonnet\n\noutput = pysonnet.loads(\n    \"\"\"\n    local Person(name='Alice') = {\n      name: name,\n      welcome: 'Hello ' + name + '!',\n    };\n    {\n      person1: Person(),\n      person2: Person('Bob'),\n    }\n    \"\"\"\n)\nassert output == {\n    \"person1\": {\n        \"name\": \"Alice\",\n        \"welcome\": \"Hello Alice!\"\n    },\n    \"person2\": {\n        \"name\": \"Bob\",\n        \"welcome\": \"Hello Bob!\"\n    }\n}\n```\n\nEvaluate file from command line:\n\n```shell\npysonnet path/to/file.jsonnet\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faltescy%2Fpysonnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faltescy%2Fpysonnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faltescy%2Fpysonnet/lists"}