Git Product home page Git Product logo

foxglove-python's Introduction

Python Client Library for Foxglove

foxglove-client on PyPI

This library provides a convenient python client for Foxglove.

In order to use the client you will first have to create an API token for your organization on your organization's settings page.

Read more about the API in the Foxglove API Docs.

Sample Usage

Examples of various client features can be found in the examples directory.

Running Tests

pipenv install --dev
pipenv run python -m pytest

Stay in touch

Join our Slack channel to ask questions, share feedback, and stay up to date on what our team is working on.

foxglove-python's People

Contributors

foxymiles avatar bryfox avatar james-rms avatar jtbandes avatar wkalt avatar achim-k avatar amacneil avatar cdc97 avatar indirectlylit avatar jordanbangia avatar

Stargazers

pezy avatar Bjarne Johannsen avatar Nikolaus Schlemm avatar  avatar

Watchers

 avatar

foxglove-python's Issues

add `mcap`, `mcap-protobuf-support` as optional dependencies in setup.cfg

We can add a feature in setup.cfg to install mcap and mcap-protobuf-support if you ask for it with pip install foxglove-data-platform[mcap,protobuf]. ROS1 support is more complicated.

ROS1

there's no way in setup.cfg to point to a specific index for dependencies for a package. That means that we basically have to ask users to manually pip install genpy --index-url https://rospypi... before installing mcap-ros1-support. This would be true also if we tried adding mcap-ros1-support as an optional dependency of foxglove-data-platform.

IMO we should vendor genpy ( foxglove/mcap#547 )and block this issue on that.

Does not accept datetime.min when querying events

Description
The python client or the web client does not handle datetime.min when querying events

  • Version: 0.13.0
  • Platform: Ubuntu 22.04.3 LTS

Steps To Reproduce

import os
from datetime import datetime, timedelta

from foxglove_data_platform.client import Client

if __name__ == "__main__":
    foxglove_api_key = os.environ.get("FOXGLOVE_API_KEY")
    device_id = os.environ.get("FOXGLOVE_DEVICE")
    client = Client(token=foxglove_api_key)
    events = client.get_events(
        device_id=device_id,
        start=datetime.min,
        end=datetime.now(),
    )

Expected Behavior
Would expect it to get all events from start to end. Instead it gives me an error:

    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: data/start must match format "date-time" for url: https://api.foxglove.dev/v1/events?...

support for synchronous upload

It would be nice if the library supported a "synchronous" argument. This could work by using the request ID returned from the import endpoint and polling the /pending-imports endpoint until either a success or failure appears.

Currently the behavior of the backend is to display a failure on retryable failures (which could resolve to a success eventually if it succeeds before the retry count). We probably need to coordinate around that somehow, probably by indicating in the pending-imports response when a failure status is terminal.

Pip install doesn't grab typing-extensions dependency

Description
Although I see it in some of the pypi files, typing extensions doesn't seem to be getting downloaded when pip installing foxglove-data-platform

  • Version: 0.1.0
  • Platform: Ubuntu 20.04, Mac

Steps To Reproduce
Make sure that typing-extensions isn't already installed (pip list, pip uninstall)
Run pip install foxglove-data-platform
Verify with pip list that typing-extensions isn't installed

Expected Behavior
It's installed

Actual Behavior
It's not

Ideas for solutions

  • Upgrade to python 3.8, where Protocol is in the typing package
  • Debug issue with pip not installing the dependency
  • have a try/except statement that tries to import it from typing first, then tries typing-extensions if that fails

Upload example in README

Can you add an example of using the client to upload a bag to the data platform in the README? I'd like to try it out but want to make sure i'm using the client correctly.

Improve client error messages

If API responds with a 400-level status code, we should relay the message to the client. It sounds like currently we're relaying the status code but using default messages for the status.

Support get_messages() for ROS 2 data

Several customers have asked for the ability to iterate ROS 2 data directly using the get_messages() API.

Currently, get_messages() is only supported for ROS 1 data. For ROS 2, the only workaround is to download the raw mcap data using download_data(), then parse it using mcap and rclpy, which is pretty cumbersome. This would be slightly nicer if we at least had a way to iterate raw message data for unsupported serialization formats.

Add device creation to client

I have lots of devices that need to be created via API. Would it be possible to get a method on the data platform client for creating devices so I don't have to do it via requests?

device_id required (or not?) for client.delete_import()

Description
The Python Client API Reference states that the deviceID argument to delete_import() is deprecated. But in fact, it is required by the existing code base.

  • Version: Release 3
  • Platform: All

Steps To Reproduce

from foxglove_data_platform.client import Client
api_key = 'XXXXXXX'
client = Client(api_key)  
devices = client.get_devices() 
files = client.get_imports(device_id='XXXXXXX')
client.delete_import(import_id=files[0]['import_id'])

Expected Behavior
Deletes import and returns 200.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.