# Crystal Projector

This is a library for manipulating data structures in the video game [Crystal Project](https://store.steampowered.com/app/1637730/Crystal_Project/). This currently can read:
- World files
- Database files
- Texture packs
- Save files
- Mod files
This will hopefully soon be able to modify and write out the above, as well as read additional things, like logfiles.
# Using Crystal Projector as a Set of Schemas
## JSON Files
The [JSON Schema](https://json-schema.org/) formats for each Crystal Project format can be found in [schema/json](schema/json).
## Binary files
The [Kaitai Struct](https://kaitai.io/) formats for Crystal Project's `.dat` and `.sav` files can be found in [schema/ksy](schema/ksy).
# Using Crystal Projector as a Python Library
You will need [Python](https://www.python.org/), version 3.8 or later.
To install Crystal Projector:
```bash
python3 -m pip install --upgrade --pre git+https://github.com/kaitai-io/kaitai_struct_python_runtime.git
python3 -m pip install crystal-projector
```
Then you can invoke it with:
```bash
crystal-projector --help
```
And use it in Python scripts like so:
```py
import crystal_projector
image = crystal_projector.world.visualize_world_map(input("enter your Crystal Project 'Content' folder:"), "field")
image.save("map.png")
```
# Developing Crystal Projector
## Dependencies
### Kaitai Struct
You need [Kaitai Struct](https://kaitai.io/) and its Python bindings, latest nightly.
KSC has some issues with Python:
* No type annotations.
* It imports sub-KSY file dependencies incorrectly; `import X` should be `from . import X`.
* It does not stop keywords from being used as names.
The latter two are fixed by us.
### Quicktype
We use [Quicktype](https://quicktype.io/); you'll need its NPM package. However, Quicktype *also* has issues:
* No support for integer enums; if you omit `type: integer` from such enums, Quicktype crashes.
* Does not support multi-file `$ref`s in a smart manner.
### Python packages
* `kaitaistruct`: Do ***NOT*** pull this from PyPI. Do this instead:
```bash
python3 -m pip install --upgrade --pre git+https://github.com/kaitai-io/kaitai_struct_python_runtime.git
```
* `Pillow`: For `PIL`.
For developing and testing:
* `pre-commit`.
* `pyyaml`: For `yaml`.
* `jsonschema`.
## Installing the Project
```bash
python3 -m pip install -e .[dev, test]
pre-commit install
```
## Building the Project
```bash
python3 build_schemas.py
```
## Distributing the Project
```bash
python3 -m build
```
Raw data
{
"_id": null,
"home_page": "https://github.com/iconmaster5326/CrystalProjector",
"name": "crystal-projector",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "iconmaster5326",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/e6/cb/5c7133b9df00f57ee2cb162e6319f3e1178e69db6eb2eb775d1c5f74d7b2/crystal_projector-0.1.0.tar.gz",
"platform": null,
"description": "# Crystal Projector\r\n\r\n\r\n\r\nThis is a library for manipulating data structures in the video game [Crystal Project](https://store.steampowered.com/app/1637730/Crystal_Project/). This currently can read:\r\n\r\n- World files\r\n- Database files\r\n- Texture packs\r\n- Save files\r\n- Mod files\r\n\r\nThis will hopefully soon be able to modify and write out the above, as well as read additional things, like logfiles.\r\n\r\n# Using Crystal Projector as a Set of Schemas\r\n\r\n## JSON Files\r\n\r\nThe [JSON Schema](https://json-schema.org/) formats for each Crystal Project format can be found in [schema/json](schema/json).\r\n\r\n## Binary files\r\n\r\nThe [Kaitai Struct](https://kaitai.io/) formats for Crystal Project's `.dat` and `.sav` files can be found in [schema/ksy](schema/ksy).\r\n\r\n# Using Crystal Projector as a Python Library\r\n\r\nYou will need [Python](https://www.python.org/), version 3.8 or later.\r\n\r\nTo install Crystal Projector:\r\n\r\n```bash\r\npython3 -m pip install --upgrade --pre git+https://github.com/kaitai-io/kaitai_struct_python_runtime.git\r\npython3 -m pip install crystal-projector\r\n```\r\n\r\nThen you can invoke it with:\r\n\r\n```bash\r\ncrystal-projector --help\r\n```\r\n\r\nAnd use it in Python scripts like so:\r\n\r\n```py\r\nimport crystal_projector\r\n\r\nimage = crystal_projector.world.visualize_world_map(input(\"enter your Crystal Project 'Content' folder:\"), \"field\")\r\nimage.save(\"map.png\")\r\n```\r\n\r\n# Developing Crystal Projector\r\n\r\n## Dependencies\r\n\r\n### Kaitai Struct\r\n\r\nYou need [Kaitai Struct](https://kaitai.io/) and its Python bindings, latest nightly.\r\n\r\nKSC has some issues with Python:\r\n\r\n* No type annotations.\r\n* It imports sub-KSY file dependencies incorrectly; `import X` should be `from . import X`.\r\n* It does not stop keywords from being used as names.\r\n\r\nThe latter two are fixed by us.\r\n\r\n### Quicktype\r\n\r\nWe use [Quicktype](https://quicktype.io/); you'll need its NPM package. However, Quicktype *also* has issues:\r\n\r\n* No support for integer enums; if you omit `type: integer` from such enums, Quicktype crashes.\r\n* Does not support multi-file `$ref`s in a smart manner.\r\n\r\n### Python packages\r\n\r\n* `kaitaistruct`: Do ***NOT*** pull this from PyPI. Do this instead:\r\n ```bash\r\n python3 -m pip install --upgrade --pre git+https://github.com/kaitai-io/kaitai_struct_python_runtime.git\r\n ```\r\n* `Pillow`: For `PIL`.\r\n\r\nFor developing and testing:\r\n\r\n* `pre-commit`.\r\n* `pyyaml`: For `yaml`.\r\n* `jsonschema`.\r\n\r\n## Installing the Project\r\n\r\n```bash\r\npython3 -m pip install -e .[dev, test]\r\npre-commit install\r\n```\r\n\r\n## Building the Project\r\n\r\n```bash\r\npython3 build_schemas.py\r\n```\r\n\r\n## Distributing the Project\r\n\r\n```bash\r\npython3 -m build\r\n```\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Manipulate Crystal Project game data.",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/iconmaster5326/CrystalProjector"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "2a4a03503829254a4ce9c2b123afcae73d0305932d86c6e7cfcc020147e2eaf9",
"md5": "40da196edbfa6844a0a168180ce22f68",
"sha256": "e4903c95cb9de0f06328f22d44910d42fc672701bc810d4303c8711d91d81430"
},
"downloads": -1,
"filename": "crystal_projector-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "40da196edbfa6844a0a168180ce22f68",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.8",
"size": 16794,
"upload_time": "2025-08-31T14:48:56",
"upload_time_iso_8601": "2025-08-31T14:48:56.182960Z",
"url": "https://files.pythonhosted.org/packages/2a/4a/03503829254a4ce9c2b123afcae73d0305932d86c6e7cfcc020147e2eaf9/crystal_projector-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e6cb5c7133b9df00f57ee2cb162e6319f3e1178e69db6eb2eb775d1c5f74d7b2",
"md5": "4618fb87dd2b7a2617f815b2a242d1fa",
"sha256": "4726fffaf791e0d800226cd145de3c8a07d8ea7b4d80fe72fc9af73a190c4c46"
},
"downloads": -1,
"filename": "crystal_projector-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "4618fb87dd2b7a2617f815b2a242d1fa",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.8",
"size": 15621,
"upload_time": "2025-08-31T14:48:57",
"upload_time_iso_8601": "2025-08-31T14:48:57.408315Z",
"url": "https://files.pythonhosted.org/packages/e6/cb/5c7133b9df00f57ee2cb162e6319f3e1178e69db6eb2eb775d1c5f74d7b2/crystal_projector-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-31 14:48:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "iconmaster5326",
"github_project": "CrystalProjector",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "crystal-projector"
}