Skip to main content

Python 3 library to write CZML

Project description

Name:

czmlpy

Authors:

Juan Luis Cano Rodríguez

Eleftheria Chatziargyriou

czmlpy 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 czmlpy using pip:

$ pip install czmlpy

or conda:

$ conda install czmlpy --channel conda-forge

czmlpy requires Python >= 3.7.

Examples

A CZML document is a list of packets, which have several properties. When using czmlpy in an interactive interpreter, all objects show as nice CZML (JSON):

>>> from czmlpy 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 czmlpy.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 czmlpy.examples import simple

In [2]: from czmlpy.widget import CZMLWidget

In [3]: CZMLWidget(simple)

And this would be the result:

https://raw.githubusercontent.com/mixxen/czmlpy/master/widget-screenshot.png

Support

If you find any issue on czmlpy or have questions, please open an issue on our repository

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 ❤️

To build a wheel file, update version in setup.py and __init__.py, then:

$ python setup.py sdist bdist_wheel
$ twine upload --repository testpypi dist/*

License

czmlpy 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

czmlpy-0.9.0.tar.gz (38.0 kB view details)

Uploaded Source

Built Distribution

czmlpy-0.9.0-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

Details for the file czmlpy-0.9.0.tar.gz.

File metadata

  • Download URL: czmlpy-0.9.0.tar.gz
  • Upload date:
  • Size: 38.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for czmlpy-0.9.0.tar.gz
Algorithm Hash digest
SHA256 55a7b4880e846a0feeff08f500d6a49d0b34ad63f936a7d3748df0cbd1a13bbc
MD5 501acbac6c10a9801b8de3ecfc3e970b
BLAKE2b-256 147361d4069162252bb5ee5b72ea22129823431667b1e8f07cd6e421af83b184

See more details on using hashes here.

File details

Details for the file czmlpy-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: czmlpy-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 29.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for czmlpy-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6fb2a7a33f732e9a96e00cdfcaddc2d2d9a4bcd1eeb3dddc81e499d83d17241a
MD5 3f0cf6b971dbc91edaa390eecb96bfa5
BLAKE2b-256 7fa7ab7997b8cee53c9e38f07240607a12656107409bb9c09dadf92ba9bc5ed9

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