| Name | czml3 JSON |
| Version |
3.0.0
JSON |
| download |
| home_page | None |
| Summary | Python 3 library to write CZML |
| upload_time | 2025-10-19 12:10:02 |
| maintainer | None |
| docs_url | None |
| author | None |
| requires_python | >=3.10 |
| license | BSD-3-Clause license
Copyright (c) 2015-2025, czml3 contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
|
| keywords |
czml
cesium
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# czml3
[](https://pypi.org/project/czml3/)
[](https://anaconda.org/conda-forge/czml3)

[](https://codecov.io/gh/Stoops-ML/czml3)



[](https://czml3.readthedocs.io/en)
From the official [CZML Guide](https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide):
> CZML is a JSON format for describing a time-dynamic graphical scene, primarily for display in a web browser running Cesium. It describes lines, points, billboards, models, and other graphical primitives, and specifies how they change with time.
czml3 aims to make the process of writing CZML files in Python easy by:
- Type checking properties
- Cooercion of data to their required format
- Forbidding unrecognised properties
- Creating minimal CZML files
- Performant JSON serialisation
## Insallation
You can install czml3 using pip:
```
pip install czml3
```
or conda:
```
conda install czml3 --channel conda-forge
```
## Examples
A CZML document is a list of *packets*, which have several properties. Recreating the blue box from Cesium sandcastle's [CZML Box](https://sandcastle.cesium.com/?src=CZML%20Box.html&label=CZML):
```
from czml3 import CZML_VERSION, Document, Packet
from czml3.properties import (
Box,
BoxDimensions,
Color,
Material,
Position,
SolidColorMaterial,
)
from czml3.types import Cartesian3Value
packet_box = Packet(
id="my_id",
position=Position(cartographicDegrees=[-114.0, 40.0, 300000.0]),
box=Box(
dimensions=BoxDimensions(
cartesian=Cartesian3Value(values=[400000.0, 300000.0, 500000.0])
),
material=Material(
solidColor=SolidColorMaterial(color=Color(rgba=[0, 0, 255, 255]))
),
),
)
doc = Document(
packets=[Packet(id="document", name="box", version=CZML_VERSION), packet_box]
)
print(doc)
```
```
[
{
"id": "document",
"name": "box",
"version": "1.0"
},
{
"id": "my_id",
"position": {
"cartographicDegrees": [
-114.0,
40.0,
300000.0
]
},
"box": {
"dimensions": {
"cartesian": [
400000.0,
300000.0,
500000.0
]
},
"material": {
"solidColor": {
"color": {
"rgba": [
0.0,
0.0,
255.0,
255.0
]
}
}
}
}
}
]
```
czml3 uses [pydantic](https://docs.pydantic.dev/latest/) for all classes. As such czml3 is able to [coerce data to their right type](https://docs.pydantic.dev/latest/why/#json-schema). For example, the following creates a Position property of doubles using a numpy array of interger type:
```
import numpy as np
from czml3.properties import Position
print(Position(cartographicDegrees=np.array([-114, 40, 300000], dtype=int)))
```
```
{
"cartographicDegrees": [
-114.0,
40.0,
300000.0
]
}
```
## Contributing
You want to contribute? Awesome! There are lots of [CZML properties](https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/Packet) and validations that we still did not implement, which can be found [here](https://czml3.readthedocs.io/en/latest/user/contributing.html).
All ideas welcome!
Raw data
{
"_id": null,
"home_page": null,
"name": "czml3",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "czml, cesium",
"author": null,
"author_email": "Daniel Stoops <danielstoops25@gmail.com>, Juan Luis Cano Rodr\u00edguez <hello@juanlu.space>",
"download_url": "https://files.pythonhosted.org/packages/30/4a/9c12e7e039e35be476faa5a350af3a631d32761921062e2256bd9d026a77/czml3-3.0.0.tar.gz",
"platform": null,
"description": "# czml3\n[](https://pypi.org/project/czml3/)\n[](https://anaconda.org/conda-forge/czml3)\n\n[](https://codecov.io/gh/Stoops-ML/czml3)\n\n\n\n[](https://czml3.readthedocs.io/en)\n\nFrom the official [CZML Guide](https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/CZML-Guide):\n> CZML is a JSON format for describing a time-dynamic graphical scene, primarily for display in a web browser running Cesium. It describes lines, points, billboards, models, and other graphical primitives, and specifies how they change with time.\n\nczml3 aims to make the process of writing CZML files in Python easy by:\n- Type checking properties\n- Cooercion of data to their required format\n- Forbidding unrecognised properties\n- Creating minimal CZML files\n- Performant JSON serialisation\n\n## Insallation\nYou can install czml3 using pip:\n```\npip install czml3\n```\n\nor conda:\n```\nconda install czml3 --channel conda-forge\n```\n\n## Examples\nA CZML document is a list of *packets*, which have several properties. Recreating the blue box from Cesium sandcastle's [CZML Box](https://sandcastle.cesium.com/?src=CZML%20Box.html&label=CZML):\n\n```\nfrom czml3 import CZML_VERSION, Document, Packet\nfrom czml3.properties import (\n Box,\n BoxDimensions,\n Color,\n Material,\n Position,\n SolidColorMaterial,\n)\nfrom czml3.types import Cartesian3Value\npacket_box = Packet(\n id=\"my_id\",\n position=Position(cartographicDegrees=[-114.0, 40.0, 300000.0]),\n box=Box(\n dimensions=BoxDimensions(\n cartesian=Cartesian3Value(values=[400000.0, 300000.0, 500000.0])\n ),\n material=Material(\n solidColor=SolidColorMaterial(color=Color(rgba=[0, 0, 255, 255]))\n ),\n ),\n)\ndoc = Document(\n packets=[Packet(id=\"document\", name=\"box\", version=CZML_VERSION), packet_box]\n)\nprint(doc)\n```\n```\n[\n {\n \"id\": \"document\",\n \"name\": \"box\",\n \"version\": \"1.0\"\n },\n {\n \"id\": \"my_id\",\n \"position\": {\n \"cartographicDegrees\": [\n -114.0,\n 40.0,\n 300000.0\n ]\n },\n \"box\": {\n \"dimensions\": {\n \"cartesian\": [\n 400000.0,\n 300000.0,\n 500000.0\n ]\n },\n \"material\": {\n \"solidColor\": {\n \"color\": {\n \"rgba\": [\n 0.0,\n 0.0,\n 255.0,\n 255.0\n ]\n }\n }\n }\n }\n }\n]\n```\n\nczml3 uses [pydantic](https://docs.pydantic.dev/latest/) for all classes. As such czml3 is able to [coerce data to their right type](https://docs.pydantic.dev/latest/why/#json-schema). For example, the following creates a Position property of doubles using a numpy array of interger type:\n```\nimport numpy as np\nfrom czml3.properties import Position\nprint(Position(cartographicDegrees=np.array([-114, 40, 300000], dtype=int)))\n```\n```\n{\n \"cartographicDegrees\": [\n -114.0,\n 40.0,\n 300000.0\n ]\n}\n```\n\n## Contributing\nYou want to contribute? Awesome! There are lots of [CZML properties](https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/Packet) and validations that we still did not implement, which can be found [here](https://czml3.readthedocs.io/en/latest/user/contributing.html).\n\nAll ideas welcome!\n",
"bugtrack_url": null,
"license": "BSD-3-Clause license\n Copyright (c) 2015-2025, czml3 contributors\n All rights reserved.\n \n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n \n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n 3. Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n \n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR\n ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n DAMAGE.\n ",
"summary": "Python 3 library to write CZML",
"version": "3.0.0",
"project_urls": {
"Documentation": "https://czml3.readthedocs.io/en",
"Repository": "https://github.com/Stoops-ML/czml3"
},
"split_keywords": [
"czml",
" cesium"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "63e03a1d573b5e2dee41e167f10d604c602135870f7609aac045330ecf43b886",
"md5": "d57787c0fbed7931a1ec3f371b8e2d90",
"sha256": "c5518496fe4cb314492e5bff41ddc35be0958f4d7d124d3df1c022d7d468d8b6"
},
"downloads": -1,
"filename": "czml3-3.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d57787c0fbed7931a1ec3f371b8e2d90",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 26763,
"upload_time": "2025-10-19T12:10:00",
"upload_time_iso_8601": "2025-10-19T12:10:00.588761Z",
"url": "https://files.pythonhosted.org/packages/63/e0/3a1d573b5e2dee41e167f10d604c602135870f7609aac045330ecf43b886/czml3-3.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "304a9c12e7e039e35be476faa5a350af3a631d32761921062e2256bd9d026a77",
"md5": "2c897017b577825133d5239be8700174",
"sha256": "0255f66db5ad0fe58635b1fd8c9cb285859ba8efed75fa3d0addef04c220a626"
},
"downloads": -1,
"filename": "czml3-3.0.0.tar.gz",
"has_sig": false,
"md5_digest": "2c897017b577825133d5239be8700174",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 116377,
"upload_time": "2025-10-19T12:10:02",
"upload_time_iso_8601": "2025-10-19T12:10:02.139953Z",
"url": "https://files.pythonhosted.org/packages/30/4a/9c12e7e039e35be476faa5a350af3a631d32761921062e2256bd9d026a77/czml3-3.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-19 12:10:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Stoops-ML",
"github_project": "czml3",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "czml3"
}