Skip to main content

Python 3 library to write CZML

Project description

Name:

czml3

Authors:

Juan Luis Cano Rodríguez

Eleftheria Chatziargyriou

PyPI - Version Conda Version GitHub Actions Workflow Status codecov Pepy Total Downlods Conda Downloads license Join the chat at https://openastronomy.riot.im/#/room/#poliastro-czml:matrix.org

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.10.

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
        }
    },
...

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:

https://raw.githubusercontent.com/poliastro/czml3/master/widget-screenshot.png

Support

Join the chat at https://openastronomy.riot.im/#/room/#poliastro-czml:matrix.org

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

license

czml3 is released under the MIT license, hence allowing commercial use of the library. Please refer to the LICENSE file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

czml3-2.0.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

czml3-2.0.0-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

Details for the file czml3-2.0.0.tar.gz.

File metadata

  • Download URL: czml3-2.0.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for czml3-2.0.0.tar.gz
Algorithm Hash digest
SHA256 70a5413dce5f3d7aea532af57acffadadee0ceb5b915ec617879fab8a61a0dfa
MD5 a6b573482cae47d1b8fba3e5ca05f8d4
BLAKE2b-256 de56533e1a5106b51be4bad5059573271b120c4c2d8653b43f71b2c4edbb1855

See more details on using hashes here.

Provenance

The following attestation bundles were made for czml3-2.0.0.tar.gz:

Publisher: publish-to-pypi.yml on poliastro/czml3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file czml3-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: czml3-2.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.1 CPython/3.12.7

File hashes

Hashes for czml3-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 772c502ae0bbc8bc1ca56d8f9445430ba158219fe485583347b2756f68c234c9
MD5 3ef0ac0a5470f1f3fec782612216d945
BLAKE2b-256 9a05e059f57c4595c9f28b674ac35c43f9dd470214fda70bbbcec8b622d9a254

See more details on using hashes here.

Provenance

The following attestation bundles were made for czml3-2.0.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on poliastro/czml3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page