Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ czml3 aims to make the process of writing CZML files in Python easy by:
- Cooercion of data to their required format
- Forbidding unrecognised properties
- Creating minimal CZML files
- Performant JSON serialisation

## Insallation
You can install czml3 using pip:
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ czml3 aims to make the process of writing CZML files in Python easy by:
* Cooercion of data to their required format
* Forbidding unrecognised properties
* Creating minimal CZML files
* Performant JSON serialisation

.. toctree::
:maxdepth: 2
Expand Down
17 changes: 12 additions & 5 deletions docs/user/features.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
Features
========

The goal of czml3 is to make the process of writing CZML files in Python easy. This page details the features that allow czml3 to achieve this goal.
czml3 is built upon `pydantic <https://docs.pydantic.dev/latest/>`_ and leverages a lot of it's capabilities to achieve this goal.

Type Checking
-------------

All classes enforces type checking on the inputs. This ensures that the data is in the correct format before it is written to the CZML file.
Inputs to classes are type checked, which ensures that the data is in the correct format before it is written to the CZML file.

Cooercion of Data
-----------------

czml3 `coerces data to their right type <https://docs.pydantic.dev/latest/why/#json-schema>`_. See Example 2 in :ref:`examples-label`.
Inputted data to classes that is not of the specified type is `coerced to their right type <https://docs.pydantic.dev/latest/why/#json-schema>`_. See Example 2 in :ref:`examples-label`.

Forbid Unrecognised Properties
------------------------------

czml3 raises an error if a model (class) receives an unrecognised input.
Unrecognised inputs to classes are forbidden, which ensures the CZML document contains only recognised and valid fields.

If a valid property of a czml3 class is missing then please `open an issue <https://github.com/Stoops-ML/czml3/issues>`_.

Minimal CZML File Creation
--------------------------

czml3 will remove all fields that are not set (i.e. ``None``). This ensures that the CZML file is as small as possible.
czml3 will remove all fields that are not set (i.e. ``None``), which ensures that the CZML file is as small as possible.

Performant JSON Serialisation
--------------------------

Pydantic is very fast at JSON serialisation. See `here <https://janhendrikewers.uk/pydantic-1-vs-2-a-benchmark-test>`_ for a breakdown.
Loading