Python data classes and JSON schemata for maritime traffic scenarios.
Project description
maritime-schema
Python package containing data classes and corresponding JSON schemata for common types used in generating traffic scenarios and testing of autonomous navigation systems.
The data classes in the package are implemented as data models using the pydantic framework.
All data classes reside in subpackage maritime_schema.types
and can be imported from there.
Installation
pip install maritime-schema
Usage Example
API:
from maritime_schema.types import ...
CLI:
The JSON schemata are contained in the repository in folder ./schema
If you did not clone the repository but installed the maritime-schema package as a dependency in your project you can call publish-schema
on the command line to (re-)generate the schemata:
publish-schema
The publish-schema
command will generate the JSON schemata in (current working directory)/schema
and a corresponding html documentation of the schemata in (current working directory)/docs/schema
For more examples and usage, please refer to maritime-schema's documentation.
Development Setup
-
Install Python 3.9 or higher, i.e. Python 3.10 or Python 3.11
-
Update pip and setuptools:
python -m pip install --upgrade pip setuptools
-
git clone the maritime-schema repository into your local development directory:
git clone https://github.com/dnv-opensource/maritime-schema path/to/your/dev/maritime-schema
-
In the maritime-schema root folder:
Create a Python virtual environment:
python -m venv .venv
Activate the virtual environment:
..on Windows:
> .venv\Scripts\activate.bat
..on Linux:
source .venv/bin/activate
Update pip and setuptools:
(.venv) $ python -m pip install --upgrade pip setuptools
Install maritime-schema's dependencies:
(.venv) $ pip install -r requirements-dev.txt
This should return without errors.
Finally, install maritime-schema itself, yet not as a regular package but as an editable package instead, using the pip install option -e:
(.venv) $ pip install -e .
-
Test that the installation works (in the maritime-schema root folder):
(.venv) $ pytest .
Meta
Copyright (c) 2024 DNV AS. All rights reserved.
Minos Hemrich - minos.hemrich@dnv.com
Tom Arne Pedersen - tom.arne.pedersen@dnv.com
Claas Rostock - @LinkedIn - claas.rostock@dnv.com
Distributed under the MIT license. See LICENSE for more information.
https://github.com/dnv-opensource/maritime-schema
Contributing
- Fork it (https://github.com/dnv-opensource/maritime-schema/fork)
- Create your branch (
git checkout -b my-branch-name
) - Commit your changes (
git commit -am 'place a descriptive commit message here'
) - Push to the branch (
git push origin my-branch-name
) - Create a new Pull Request in GitHub
For your contribution, please make sure you follow the STYLEGUIDE before creating the Pull Request.
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
File details
Details for the file maritime-schema-0.0.3.tar.gz
.
File metadata
- Download URL: maritime-schema-0.0.3.tar.gz
- Upload date:
- Size: 18.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c9a072ba6eda386984b73b877996c444215cd469cb016e8fed9cfca6297a02db |
|
MD5 | bad7e03480f69975383c805919009727 |
|
BLAKE2b-256 | dabe33c85800a522e4a36c8d9bf6799f5741c3d8e0ecea9d47f621f0397e19c0 |