Skip to main content

Python client to communicate with FarSounder's ARGOS sensors

Project description

SDK Client for live FarSounder data

Python client to communicate with SonaSoft via API.

Usage

Clone locally and install (uv add .) or install from pypi like:

uv add farsounder

(or use pip, etc)

Then - for example to subscribe to TargetData messages:

import asyncio

from farsounder import config, requests, subscriber
from farsounder.proto import nav_api_pb2


async def main() -> None:
    cfg = config.build_config(
        host="127.0.0.1",
        subscribe=["TargetData"],
    )

    sub = subscriber.subscribe(config)

    def on_targets(message: nav_api_pb2.TargetData) -> None:
        print("Got a TargetData!")
        print("Targets:", len(message.groups))

    # Pub/Sub
    sub.on("TargetData", on_targets)
    await sub.start()

    # Req/rep
    settings = await requests.get_processor_settings(config)
    print(settings)

    # History data
    history = await requests.get_history_data(
        config,
        latitude=41.7223,
        longitude=-71.35,
        radius_meters=500,
    )
    print(history.gridded_bottom_detections)

    await asyncio.sleep(1.0)
    await sub.stop()


if __name__ == "__main__":
    asyncio.run(main())

Simulated backend

You can run a local simulated backend that publishes dummy messages and responds to request/reply calls:

uv run examples/simulated_backend.py

Note: the examples/ directory is not installed with uv add farsounder. Clone the repo to run the examples locally.

Development

Re-generate Protobuf stubs

Protobuf sources live in proto/. Generate Python stubs with:

uv run --group dev gen-protos

Or:

uv run tools/gen_protos.py

Tests

Run tests with:

uv run --group dev pytest

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

farsounder-0.1.0.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

farsounder-0.1.0-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file farsounder-0.1.0.tar.gz.

File metadata

  • Download URL: farsounder-0.1.0.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for farsounder-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1e78063591ebefb353d2d56ab8c7b8229d54a99afca38e4c2349577fac17c863
MD5 dd4b33fb801b3bb9e35c521cb2777259
BLAKE2b-256 8ecd37e7d57bdfad3f93bd6dfdb78af129987aaa19e0acffcf35efa4325aae3a

See more details on using hashes here.

File details

Details for the file farsounder-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: farsounder-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for farsounder-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 503ad1a6c2e85d382528cc77cdb44d4a463f45a5ca855a249cb6730b393d315a
MD5 395ca409d987a77fb31fcc976c79e3bc
BLAKE2b-256 ec32d39016d405947e187e094d73818e219cd014ce18420569a78df99ce6f81a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page