Skip to main content

Python 3 library to write CZML

Project description

Name:

czml3

Authors:

Juan Luis Cano Rodríguez

Eleftheria Chatziargyriou

circleci codecov 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.6. Would you like to help us supporting Python 3.5 as well?

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
>>> Packet()
{
    "id": "adae4d3a-7087-4fda-a70b-d18a262a890e"
}
>>> packet0 = Packet(id="Facility/AGI", name="AGI")
>>> 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
>>> 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:

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 black, isort, 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-0.5.4.tar.gz (46.2 kB view details)

Uploaded Source

Built Distribution

czml3-0.5.4-py3-none-any.whl (29.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: czml3-0.5.4.tar.gz
  • Upload date:
  • Size: 46.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.3

File hashes

Hashes for czml3-0.5.4.tar.gz
Algorithm Hash digest
SHA256 1cea9f733b055e0450f8e1e10c1ede4078366400242a3b21aca447a95d248bfe
MD5 77cbba5274ace1fcda37b6d5ded13b38
BLAKE2b-256 682a9a1f5d3c6af08de7e720f913595f8ac1e6d493b929477e03a4c712ebb1b0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: czml3-0.5.4-py3-none-any.whl
  • Upload date:
  • Size: 29.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.3

File hashes

Hashes for czml3-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7c88ce1bb61b60cfbae8de31c3eb3db6bc56c66d6e6d45287e7f517c0a9dee33
MD5 96240d8b5de55d94569c907cedf1b3ba
BLAKE2b-256 648632d327b428f92245c30784d8027d143db2884d415ec756bb9dbb4cf8152c

See more details on using hashes here.

Supported by

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