{"id":19964117,"url":"https://github.com/overfl0/armaclass","last_synced_at":"2025-05-03T23:30:27.837Z","repository":{"id":29419452,"uuid":"121428509","full_name":"overfl0/Armaclass","owner":"overfl0","description":"Python parser for Arma class definitions (e.g. sqm files)","archived":false,"fork":false,"pushed_at":"2025-01-31T01:48:01.000Z","size":4597,"stargazers_count":21,"open_issues_count":5,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-07T22:41:38.026Z","etag":null,"topics":["arma3","class","generator","parser","python","python3","sqm"],"latest_commit_sha":null,"homepage":null,"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/overfl0.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":"2018-02-13T19:47:44.000Z","updated_at":"2025-01-31T01:48:05.000Z","dependencies_parsed_at":"2022-08-07T14:16:23.745Z","dependency_job_id":"4ec10804-f391-4f95-b91a-aad2f9d4d338","html_url":"https://github.com/overfl0/Armaclass","commit_stats":{"total_commits":55,"total_committers":2,"mean_commits":27.5,"dds":0.09090909090909094,"last_synced_commit":"2252059bcc6839d0c406a4eb42999bb18fa2e870"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overfl0%2FArmaclass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overfl0%2FArmaclass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overfl0%2FArmaclass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overfl0%2FArmaclass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/overfl0","download_url":"https://codeload.github.com/overfl0/Armaclass/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252269026,"owners_count":21721239,"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":["arma3","class","generator","parser","python","python3","sqm"],"created_at":"2024-11-13T02:19:31.366Z","updated_at":"2025-05-03T23:30:26.520Z","avatar_url":"https://github.com/overfl0.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Status\n\n[![Build Status](https://github.com/overfl0/Armaclass/actions/workflows/build.yml/badge.svg)](https://github.com/overfl0/Armaclass/actions/workflows/build.yml)\n\n[Live demo in your browser](https://overfl0.github.io/Armaclass/)\n\n## About\nThis is a Python parser for Arma 3 class definitions such as those appearing inside unrapified mission files.\n\nIt's based on [Fusselwurm's arma-class-parser](https://github.com/Fusselwurm/arma-class-parser) that is written\nJavaScript.\n\nI grew tired of using it in conjunction with PyExecJS (complicated to set up and needing to patch things up on\nWindows) and py2js (too slow to parse even 300KB sqm files) and decided to port the original JavaScript code to\nPython.\n\n[See how it works, directly in your browser!](https://overfl0.github.io/Armaclass/)\n\n## Installation\n\n```\npip install armaclass\n```\n\n## Usage\n#### Parse the values from a string\n```python\nIn [1]: import armaclass\n\nIn [2]: armaclass.parse('version=12;\\n\\nclass Moo  {\\r\\n value = 1; };')\nOut[2]: {'version': 12, 'Moo': {'value': 1}}\n```\n\nNote that due to Python's implementation of dicts, the keys order is kept the same\nas in the class parsed.\n\n#### Generate the files based on a parsed (or manually created) structure\n```python\nIn [5]: structure = {'version': 12.0, 'Moo': {'value': 1.0}}\nIn [6]: print(armaclass.generate(structure))\nversion=12;\n\nclass Moo\n{\n    value=1;\n};\n```\n\n#### Indent with tabs instead of spaces\n```python\nIn [7]: print(armaclass.generate(structure, indent=1, use_tabs=True))\nversion=12;\n\nclass Moo\n{\n        value=1;\n};\n```\n\n## Extending the generator\nYou can use this library to write a program that will port your Arma class files to DayZ, for example.\nTo do so, you will need to create your own generator by subclassing `armaclass.generator.Generator` and implementing\nyour own methods (the ones raising `NotImplemented`).\n\n## Development\n### Notes\nThe naming conventions may not match Python's pep8 as I was trying to stay close to the original parsing names to\nfacilitate porting. Those (internal) names may be changed in the future.\n\n### Making code changes \n- Create a virtualenv using your preferred method (mkvirtualenv, venv, etc...)\n- `pip install -r requirements-dev.txt`\n- Write code AND tests\n- `pytest` to test run your tests\n- `ptw -n` if you want `pytest` to automatically be called whenever\n  you save any file from the project\n\n### Testing the cythonized wheels in cibuildwheel\n\n    cmd /C \"set CIBW_BEFORE_BUILD=pip install -r requirements-cython.txt \u0026\u0026 set CIBW_SKIP=pp* \u0026\u0026 set CIBW_TEST_REQUIRES=pytest \u0026\u0026 set CIBW_TEST_COMMAND=pytest {project} \u0026\u0026 cibuildwheel --platform windows\"\n\n    # On linux:\n    CIBW_BEFORE_BUILD='pip install -r requirements-cython.txt' CIBW_SKIP='pp*' CIBW_TEST_REQUIRES=pytest CIBW_TEST_COMMAND='pytest {project}' cibuildwheel --platform linux\n\n## Contributing\nIf you feel something is missing or plain wrong, feel free to submit a Pull Request. You are encouraged to submit the\nsame PR/suggestion to the original [arma-class-parser](https://github.com/Fusselwurm/arma-class-parser) as well.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foverfl0%2Farmaclass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foverfl0%2Farmaclass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foverfl0%2Farmaclass/lists"}