Skip to main content

Mooring Data Generator

A simple script to generate fake mooring data for use in a hackathon. This script will send data payloads to and endpoint to simulate the data which might exist.

These will be http POST queries to the url provided as an argument at run time.

The script will run forever until the user sends a Ctrl+C command to end the script.

Install

If you don't have UV on your system, read the install instructions for UV

uv tool install -U mooring-data-generator

Vanilla python (If you don't want UV)

pip install -U mooring-data-generator

Usage

Running the package

Sending data via HTTP POST

mooring-data-generator http://127.0.0.1:8000/my/endpoint/

Saving data to a file

You can also save the generated mooring data to a JSON file instead of sending it via HTTP:

mooring-data-generator --file output.json

This will continuously generate mooring data and save it to the specified file.

Getting the OpenAPI specification

You can output an OpenAPI 3.0 specification for the mooring data format:

mooring-data-generator --openapi

This will print a complete OpenAPI specification in JSON format that describes the structure of the mooring data being generated. This is useful for:

  • Understanding the data format
  • Generating client libraries
  • API documentation
  • Integration planning

The specification can be saved to a file for use with OpenAPI tools:

mooring-data-generator --openapi > openapi.json

Testing data is being sent

There's a helper application included in this package to allow you to check that the data is being sent.

mooring-data-receiver will display to the console all http traffic it receives.

mooring-data-receiver

By default it will run listening to any traffic 0.0.0.0 on port 8000

You can adjust this if needed by using a commend like

mooring-data-receiver --host 127.0.0.1 --port 5000

Formatting output

You can use the --format flag to control how the request body is displayed:

mooring-data-receiver --format

When --format is used, the request body content will be formatted using json.dumps(indent=2) for better readability. Without this flag, the content is displayed as received.

Troubleshooting

Command not found

If you are having trouble with the command not being found, you can attempt to run it as a module calling python

python -m mooring-data-generator http://127.0.0.1:8000/my/endpoint/

Pip not found

If pip can't be found on your system.

First, make sure you have Python installed.

python --version

you can call pip from python directly as a module.

python -m pip install -U mooring-data-generator

Release a new version

Be sure the tests pass

uv sync --all-groups
uv run ruff format
uv run ruff check
uv run tox

bump version and tag new release

uv version --bump minor
git commit -am "Release version v$(uv version --short)"
git tag -a "v$(uv version --short)" -m "v$(uv version --short)"

push to github

git push
git push --tags

Metadata

Release files for mooring-data-generator 2.3.0

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

Source distribution (sdist)

Source distribution for mooring-data-generator 2.3.0
File Size Uploaded Provenance Actions
mooring_data_generator-2.3.0.tar.gz 12.9 kB Without provenance Details for mooring_data_generator-2.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mooring-data-generator 2.3.0
File Interpreter ABI Platform Actions
mooring_data_generator-2.3.0-py3-none-any.whl Python 3 none any Details for mooring_data_generator-2.3.0-py3-none-any.whl

Total release size: 29.3 kB

Release files / mooring_data_generator-2.3.0.tar.gz

Download URL mooring_data_generator-2.3.0.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
65db8022625a9a947691417ca4e78e7e830c4e1e51edb6a1c4c798dea32fac30
BLAKE2b-256 checksum
How to use checksums
08b1000b53198af8d12da1355c3316aa3834f5a724b0f0d06c599258151fe6d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / mooring_data_generator-2.3.0-py3-none-any.whl

Download URL mooring_data_generator-2.3.0-py3-none-any.whl
Size 16.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e2211f97f05c91c5c2d8d1434e7ee6357f9d7ae70513a2b2ac8b4fdaa654042
BLAKE2b-256 checksum
How to use checksums
960f9dfba6c48d1bd323b1f419f43fb93c84078f07a5a75b557a6339143b913c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for mooring-data-generator 2.3.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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