{"id":26690216,"url":"https://github.com/mrigankpawagi/pythonalloyclient","last_synced_at":"2026-02-15T23:01:22.033Z","repository":{"id":283932207,"uuid":"953328632","full_name":"mrigankpawagi/PythonAlloyClient","owner":"mrigankpawagi","description":"Python Client for the Alloy Language Server","archived":false,"fork":false,"pushed_at":"2025-09-15T23:14:57.000Z","size":20267,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-04T04:41:39.771Z","etag":null,"topics":["alloy","language-server-client"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/PythonAlloyClient/","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/mrigankpawagi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-23T05:07:53.000Z","updated_at":"2025-09-15T23:15:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"1b7cb551-7f43-4630-b6d7-83bbe14306fb","html_url":"https://github.com/mrigankpawagi/PythonAlloyClient","commit_stats":null,"previous_names":["mrigankpawagi/pythonalloyclient"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mrigankpawagi/PythonAlloyClient","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrigankpawagi%2FPythonAlloyClient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrigankpawagi%2FPythonAlloyClient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrigankpawagi%2FPythonAlloyClient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrigankpawagi%2FPythonAlloyClient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrigankpawagi","download_url":"https://codeload.github.com/mrigankpawagi/PythonAlloyClient/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrigankpawagi%2FPythonAlloyClient/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29491998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T19:29:10.908Z","status":"ssl_error","status_checked_at":"2026-02-15T19:29:10.419Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["alloy","language-server-client"],"created_at":"2025-03-26T15:26:50.889Z","updated_at":"2026-02-15T23:01:22.021Z","avatar_url":"https://github.com/mrigankpawagi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PythonAlloyClient\n\nThis is a Python client library for interacting with the [Alloy](https://github.com/AlloyTools/org.alloytools.alloy) Language Server. Currently, it supports checking the syntax of a given Alloy code snippet with the Alloy language server, but more features are planned for the future to make use of the full capabilities of the Alloy language server.\n\n## Installation\n\nYou can install the package from PyPI using pip.\n\n```bash\npip install PythonAlloyClient\n```\n\nOr install directly from the source.\n\n```bash\ngit clone https://github.com/mrigankpawagi/PythonAlloyClient.git\ncd PythonAlloyClient\npip install -e .\n```\n\n## Requirements\n\n- Python 3.6+\n- Java Virtual Machine (JVM) 17 or later for running the Alloy language server\n\n## Usage\n\n### Basic Usage\n\n```python\nfrom PythonAlloyClient import AlloyServer\n\nserver = AlloyServer() # Initialize the server\nserver.start() # Start the server\n\nsyntax_status = server.check_syntax(\"sig Person {}\")\nserver.stop() # Stop the server\n\nprint(syntax_status.success) # True\n```\n\nOnce the server is started, you can use the `check_syntax` method to check the syntax of an Alloy code snippet which is supplied as a string. The method returns a `SyntaxStatus` object with the following attributes.\n\n- `success` (`bool`): True if the syntax check passed, False otherwise\n- `error_type` (`str`): Type of error (always `Syntax error` for now), None if `success` is True\n- `line_number` (`int`): Line number where the error occurred, None if `success` is True\n- `column_number` (`int`): Column number where the error occurred, None if `success` is True\n- `error_message` (`str`): Error message, None if `success` is True\n- `full_error_message` (`str`): Full error message from Alloy, None if `success` is True\n\nIf a syntax check failed due to an unexpected error, the `full_error_message` attribute will contain the error message, `success` will be False, and all other attributes will be None.\n\n### Another Example\n\n```python\nalloy_code = \"\"\"\nsig X {}\nsig A extends X {}\nsig A extends X {}\n\"\"\"\nsyntax_check = server.check_syntax(alloy_code)\n\nprint(syntax_check.success) # False\nprint(syntax_check.error_type) # Syntax error\nprint(syntax_check.line_number) # 4\nprint(syntax_check.column_number) # 5\nprint(syntax_check.error_message) # \"A\" is already the name of a sig/parameter in this module.\n```\n\n### Custom Alloy Build\n\nBy default, PythonAlloyClient uses the JAR file at `PythonAlloyClient/resources/org.alloytools.alloy.dist.jar` to run the Alloy language server. If you want to use a custom build of the Alloy language server, you can specify the path to the JAR file when initializing the `AlloyServer` object.\n\n```python\nfrom PythonAlloyClient import AlloyServer\n\nserver = AlloyServer(alloy_jar_path=\"path/to/alloy.jar\")\n```\n\n### Other Options\n\nPythonAlloyClient can print logs about the server's status and the requests being made to the server by setting the `quiet` attribute to False. This is set to True by default.\n\n```python\nfrom PythonAlloyClient import AlloyServer\n\nserver = AlloyServer(quiet=False)\n```\n\nYou can also set the `try_get_diagnostics` parameter while checking syntax in order to catch any error-level diagnostics sent by the server. This can be useful for cases where the syntax is correct but there are compilation errors like type-errors. It is set to `False` by default, and has a minor time overhead. The error returned in this case will have `error_type` as `Diagnostics error`.\n\n```python\nfrom PythonAlloyClient import AlloyServer\n\nserver = AlloyServer()\nserver.start()\nsyntax_check = server.check_syntax(alloy_code, try_get_diagnostics=True)\n```\n\n## Development\n\n### Setting Up the Development Environment\n\nThis project uses `pytest` for testing. This is listed in `requirements.txt` and can be installed using pip.\n\n### Running Tests\n\n```bash\npython -m pytest tests/\n```\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit Pull Requests or issues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrigankpawagi%2Fpythonalloyclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrigankpawagi%2Fpythonalloyclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrigankpawagi%2Fpythonalloyclient/lists"}