Python 3 library to write CZML
Project description
- Name:
czml3
czml3 is a Python library to write CZML.
What is CZML?
From the official 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. While Cesium has a rich client-side API, CZML allows it to be data-driven so that a generic Cesium viewer can display a rich scene without the need for any custom code.
Installation
You can install czml3 using pip:
$ pip install czml3
or conda:
$ conda install czml3 --channel conda-forge
czml3 requires Python >= 3.7.
Examples
A CZML document is a list of packets, which have several properties. When using czml3 in an interactive interpreter, all objects show as nice CZML (JSON):
>>> from czml3 import Packet >>> print(Packet()) { "id": "adae4d3a-7087-4fda-a70b-d18a262a890e" } >>> packet0 = Packet(id="Facility/AGI", name="AGI") >>> print(packet0) { "id": "Facility/AGI", "name": "AGI" } >>> packet0.dumps() '{"id": "Facility/AGI", "name": "AGI"}'
And there are more complex examples available:
>>> from czml3.examples import simple >>> print(simple) [ { "id": "document", "version": "1.0", "name": "simple", "clock": { "interval": "2012-03-15T10:00:00Z/2012-03-16T10:00:00Z", "currentTime": "2012-03-15T10:00:00Z", "multiplier": 60, "range": "LOOP_STOP", "step": "SYSTEM_CLOCK_MULTIPLIER" } }, ...
Jupyter widget
You can easily display your CZML document using our interactive widget:
In [1]: from czml3.examples import simple In [2]: from czml3.widget import CZMLWidget In [3]: CZMLWidget(simple)
And this would be the result:
Support
If you find any issue on czml3 or have questions, please open an issue on our repository and join our chat!
Contributing
You want to contribute? Awesome! There are lots of CZML properties that we still did not implement. Also, it would be great to have better validation, a Cesium widget in Jupyter notebook and JupyterLab… Ideas welcome!
We recommend this GitHub workflow to fork the repository. To run the tests, use tox:
$ tox
Before you send us a pull request, remember to reformat all the code:
$ tox -e reformat
This will apply ruff and lots of love ❤️
License
czml3 is released under the MIT license, hence allowing commercial
use of the library. Please refer to the LICENSE
file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file czml3-1.0.0.tar.gz
.
File metadata
- Download URL: czml3-1.0.0.tar.gz
- Upload date:
- Size: 55.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6245bb82219c235adec10a21a8e3e1caf32f357f1aea676b36372cb5cf95bba |
|
MD5 | 14b61970bcfa0886d49b80dc89cc7ff0 |
|
BLAKE2b-256 | fd1294f9054515a12c7246d6aa71dfc60bb75f34a99cfa09e4b2a65cd3012740 |
File details
Details for the file czml3-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: czml3-1.0.0-py3-none-any.whl
- Upload date:
- Size: 30.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb470a7c6acbf8af2672f11f1941aff38db3c65100ff8ad6f1758f3e65e7cde4 |
|
MD5 | e3de2fb548b15275e6c15d9dff415689 |
|
BLAKE2b-256 | cb163b21517542db470aa90bcc6f088f13cdd633ce303c8c434f2370427002db |