Skip to main content

dtocean-core actions codecov PyPI - Python Version

dtocean-core

The dtocean-core module provides the data model and execution environment for the DTOcean suite of tools. It manages data transfer between the DTOcean components (modules, database, user), data storage and versioning, and module execution ordering.

Part of the DTOcean suite of tools.

Installation

pip install dtocean-core

Usage

Command Line Tool (dtocean)

A command line tool is provided for various functions. All commands are available from the dtocean root. For instance:

dtocean -h

dtocean init

The init utility is for calling initialization scripts required before the first run of any installed DTOcean modules. Note that an internet connection is required when running this command. To get help:

dtocean init -h

dtocean core run

The main dtocean core run command can run DTOcean projects saved as .dtop files, either for the next scheduled module or all modules. For help, type:

dtocean core run -h

dtocean core config

Another utility is provided to copy user modifiable configuration files to the users "AppData" directory (on Windows). For instance the logging and database configuration can be modified once these files have been copied. To get help:

dtocean core config -h

dtocean database

This utility is for converting the DTOcean SQL database into a structured directories of files, or for uploading the same structure into the database is provided. To get help:

dtocean database -h

Module subcommands

Utilities provided by installed modules are also available through the dtocean command. For instance, to get help for the commands provided by the dtocean-hydrodynamics package:

dtocean hydrodyamics -h

A list of all available subcommands will be shown when calling dtocean -h.

Jupyter Notebooks

Examples of using dtocean-core are given in Jupyter Notebooks which are found in the "notebooks" folder of the dtocean-core source code.

Development

Development of dtocean-core uses the Poetry dependency manager. Poetry must be installed and available on the command line.

To install:

poetry install

Download data files with the following command:

dtocean init

Tests

Basic Tests

A test suite is provided with the source code that uses pytest. To install the testing dependencies:

poetry install --with test

Additional tests are available for the plugins to dtocean-app. Enable these tests by installing the test-extras group:

poetry install --with test --with test-extras

To run the tests:

poetry run pytest

Database Tests

Database integration tests are available upon the installation of the DTOcean database. Once the database is installed and running, additional options must be provided to the pytest command, with meanings as follows:

Option Meaning
--postgresql-password The password of the root database user
--postgresql-path The path to the database setup files

The database tests use the pytest-postgresql plugin to generate temporary test databases that mirror the DTOcean database schema and tables. Any additional option provided by pytest-postgresql plugin can also be applied to the DTOcean tests (for instance, if the default port is not 5432, it can be set with the --postgresql-port option).

To include the database tests (with example values):

poetry run pytest --postgresql-password="example" --postgresql-path="/path/to/the/database/setup/files"

Multi-Version Tests

The above tests can be run across all compatible Python versions using tox and tox-uv. To install:

poetry install --with tox

To run without the database tests:

poetry run tox

To include the database tests (with example values):

poetry run tox -- --postgresql-password="example" --postgresql-path="/path/to/the/database/setup/files"

Integration Tests

Integration tests are included in the integration directory. These tests are designed to be used in combination with the scripts/make_test_project.py script, which generates a .dtop file, labelled with the OS and Python version used to create it and saved in the test_data/projects directory.

The integration tests will try to open all the project files in the test_data/projects directory. This is primarily useful for testing cross-platform loading of save files and is automated in the GitHub Action workflow for dtocean-core.

To run the tests:

poetry run pytest integration

Contributing

Please see the dtocean GitHub repository for contributing guidelines.

Credits

This package was initially created as part of the EU DTOcean project by:

It is now maintained by Mathew Topper at Data Only Greater.

License

GPL-3.0

Metadata

Release files for dtocean-core 4.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dtocean-core 4.0.3
File Size Uploaded
dtocean_core-4.0.3.tar.gz 143.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dtocean-core 4.0.3
File Interpreter ABI Platform
dtocean_core-4.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 323.3 kB

Release files / dtocean_core-4.0.3.tar.gz

Download URL dtocean_core-4.0.3.tar.gz
Size 143.6 kB
Tags Source
SHA-256 checksum
How to use checksums
05af1fab185d16d9b85b2ac58e28b40293ea19b0697ae550a3f1f74682b726b4
BLAKE2b-256 checksum
How to use checksums
8a418a579b75c89a1255e80fa4ad85cc5e748185bde1c4b3af60503a472517d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.

Transparency log

Release files / dtocean_core-4.0.3-py3-none-any.whl

Download URL dtocean_core-4.0.3-py3-none-any.whl
Size 179.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d031816bd8b978ec2d24e226cf17eda6d60fb96dff11264204fe5b3d5bcb53e0
BLAKE2b-256 checksum
How to use checksums
cb14d73fd8d057f6f612ccfde5ba0787614922cf48803321c8dbd1f4cda6e59b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 21, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

4.0.3 This release

2 release files

4.0.2

2 release files

4.0.1

2 release files

4.0.0

2 release files

3.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page