diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5748f7..d391a54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,8 +21,8 @@ jobs: - run: pip install pipenv==2022.12.19 - run: pipenv install --dev --deploy - run: pipenv run black --check --diff --color --exclude '.*_pb2.py' . - - run: pipenv run pyright foxglove_data_platform - - run: pipenv run python -m flake8 foxglove_data_platform + - run: pipenv run pyright foxglove + - run: pipenv run python -m flake8 foxglove - run: pipenv run python -m pytest - run: pipenv run python -m build diff --git a/README.md b/README.md index 8de4c8b..58333ab 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ This library provides a convenient python client for [Foxglove](https://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](https://app.foxglove.dev/~/settings). +Read more about the API in the [Foxglove API Docs](https://docs.foxglove.dev/api/). + ## Sample Usage Examples of various client features can be found in the `examples` directory. diff --git a/examples/downloading_data.py b/examples/downloading_data.py index 79649ac..742013d 100644 --- a/examples/downloading_data.py +++ b/examples/downloading_data.py @@ -1,7 +1,7 @@ import datetime from datetime import datetime, timedelta -from foxglove_data_platform.client import Client +from foxglove.client import Client token = "" device_id = "" diff --git a/examples/events.py b/examples/events.py index ff86154..553c64d 100644 --- a/examples/events.py +++ b/examples/events.py @@ -1,6 +1,6 @@ from datetime import datetime -from foxglove_data_platform.client import Client +from foxglove.client import Client token = "" device_id = "" diff --git a/examples/fetching_messages.py b/examples/fetching_messages.py index 0f0fceb..45ad237 100644 --- a/examples/fetching_messages.py +++ b/examples/fetching_messages.py @@ -1,7 +1,7 @@ import datetime from datetime import datetime, timedelta -from foxglove_data_platform.client import Client +from foxglove.client import Client token = "" device_id = "" diff --git a/examples/uploading_data.py b/examples/uploading_data.py index 571ffc1..d5a36d2 100644 --- a/examples/uploading_data.py +++ b/examples/uploading_data.py @@ -1,6 +1,6 @@ from pathlib import Path -from foxglove_data_platform.client import Client +from foxglove.client import Client token = "" device_id = "" diff --git a/foxglove_data_platform/__init__.py b/foxglove/__init__.py similarity index 100% rename from foxglove_data_platform/__init__.py rename to foxglove/__init__.py diff --git a/foxglove_data_platform/client.py b/foxglove/client.py similarity index 99% rename from foxglove_data_platform/client.py rename to foxglove/client.py index 23daf88..43f0cbe 100644 --- a/foxglove_data_platform/client.py +++ b/foxglove/client.py @@ -166,11 +166,6 @@ def _download_stream_with_progress( class Client: def __init__(self, token: str, host: str = "api.foxglove.dev"): - warnings.warn( - "The `foxglove-data-platform` package has been renamed to `foxglove-client`." - + " Please migrate to `foxglove-client` to receive future updates.", - DeprecationWarning, - ) self.__token = token self.__headers = { "Content-type": "application/json", diff --git a/foxglove_data_platform/py.typed b/foxglove/py.typed similarity index 100% rename from foxglove_data_platform/py.typed rename to foxglove/py.typed diff --git a/setup.cfg b/setup.cfg index e2519fb..c40581a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,10 +1,10 @@ [metadata] -name = foxglove-data-platform -version = 0.14.2 -description = Client library for Foxglove Data Platform. +name = foxglove-client +version = 0.15.0 +description = Client library for the Foxglove API. long_description = file: README.md long_description_content_type = text/markdown -url = https://github.com/foxglove/py-data-platform +url = https://github.com/foxglove/foxglove-python classifiers = Programming Language :: Python :: 3 License :: OSI Approved :: MIT License @@ -21,4 +21,4 @@ packages = find: python_requires = >=3.7 [options.package_data] -foxglove_data_platform = py.typed +foxglove = py.typed diff --git a/tests/test_attachments.py b/tests/test_attachments.py index 2bf5197..6afef42 100644 --- a/tests/test_attachments.py +++ b/tests/test_attachments.py @@ -1,6 +1,6 @@ import responses from faker import Faker -from foxglove_data_platform.client import Client +from foxglove.client import Client from datetime import datetime from dateutil.tz import tzoffset diff --git a/tests/test_client.py b/tests/test_client.py index 603caed..065023b 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -3,7 +3,7 @@ import pytest import responses from faker import Faker -from foxglove_data_platform.client import Client, camelize +from foxglove.client import Client, camelize from requests.exceptions import RequestException from .api_url import api_url diff --git a/tests/test_coverage.py b/tests/test_coverage.py index 1fc500f..f1566d9 100644 --- a/tests/test_coverage.py +++ b/tests/test_coverage.py @@ -2,7 +2,7 @@ import responses from faker import Faker -from foxglove_data_platform.client import Client +from foxglove.client import Client from .api_url import api_url diff --git a/tests/test_data.py b/tests/test_data.py index 67b2895..8db5a0e 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -3,7 +3,7 @@ import responses from faker import Faker -from foxglove_data_platform.client import Client +from foxglove.client import Client from responses.matchers import json_params_matcher from .api_url import api_url diff --git a/tests/test_devices.py b/tests/test_devices.py index 1e3cebd..36891b9 100644 --- a/tests/test_devices.py +++ b/tests/test_devices.py @@ -2,7 +2,7 @@ import responses from faker import Faker -from foxglove_data_platform.client import Client +from foxglove.client import Client from responses.matchers import json_params_matcher from .api_url import api_url diff --git a/tests/test_events.py b/tests/test_events.py index 096d817..dc6650d 100644 --- a/tests/test_events.py +++ b/tests/test_events.py @@ -3,7 +3,7 @@ import responses from faker import Faker -from foxglove_data_platform.client import Client +from foxglove.client import Client from responses.matchers import json_params_matcher from .api_url import api_url diff --git a/tests/test_imports.py b/tests/test_imports.py index ae84204..3291d4b 100644 --- a/tests/test_imports.py +++ b/tests/test_imports.py @@ -2,7 +2,7 @@ import responses from faker import Faker -from foxglove_data_platform.client import Client +from foxglove.client import Client from .api_url import api_url diff --git a/tests/test_json_messages.py b/tests/test_json_messages.py index 2df6132..fe52284 100644 --- a/tests/test_json_messages.py +++ b/tests/test_json_messages.py @@ -1,7 +1,7 @@ from datetime import datetime from unittest.mock import MagicMock -from foxglove_data_platform.client import Client +from foxglove.client import Client from .generate import generate_json_data diff --git a/tests/test_protobuf_messages.py b/tests/test_protobuf_messages.py index 41a8bd7..02dd3e7 100644 --- a/tests/test_protobuf_messages.py +++ b/tests/test_protobuf_messages.py @@ -3,13 +3,13 @@ import pytest -from foxglove_data_platform.client import Client +from foxglove.client import Client from .generate import generate_protobuf_data def test_download_without_decoder(): - with patch("foxglove_data_platform.client.DEFAULT_DECODER_FACTORIES", []): + with patch("foxglove.client.DEFAULT_DECODER_FACTORIES", []): client = Client("test") client.download_data = MagicMock(return_value=generate_protobuf_data()) with pytest.raises(Exception): diff --git a/tests/test_recordings.py b/tests/test_recordings.py index 600d482..94ddbdf 100644 --- a/tests/test_recordings.py +++ b/tests/test_recordings.py @@ -3,7 +3,7 @@ import responses from faker import Faker -from foxglove_data_platform.client import Client +from foxglove.client import Client from .api_url import api_url diff --git a/tests/test_ros1_messages.py b/tests/test_ros1_messages.py index a3a4728..21a5187 100644 --- a/tests/test_ros1_messages.py +++ b/tests/test_ros1_messages.py @@ -3,13 +3,13 @@ import pytest -from foxglove_data_platform.client import Client +from foxglove.client import Client from .generate import generate_ros1_data def test_download_without_decoder(): - with patch("foxglove_data_platform.client.DEFAULT_DECODER_FACTORIES", []): + with patch("foxglove.client.DEFAULT_DECODER_FACTORIES", []): client = Client("test") client.download_data = MagicMock() client.download_data.return_value = generate_ros1_data() diff --git a/tests/test_ros2_messages.py b/tests/test_ros2_messages.py index 0d9ee6a..609932a 100644 --- a/tests/test_ros2_messages.py +++ b/tests/test_ros2_messages.py @@ -3,13 +3,13 @@ import pytest -from foxglove_data_platform.client import Client +from foxglove.client import Client from .generate import generate_ros2_data def test_download_without_decoder(): - with patch("foxglove_data_platform.client.DEFAULT_DECODER_FACTORIES", []): + with patch("foxglove.client.DEFAULT_DECODER_FACTORIES", []): client = Client("test") client.download_data = MagicMock() client.download_data.return_value = generate_ros2_data() diff --git a/tests/test_stream_messages.py b/tests/test_stream_messages.py index e0dea52..010c7e9 100644 --- a/tests/test_stream_messages.py +++ b/tests/test_stream_messages.py @@ -4,7 +4,7 @@ from mcap.records import Schema, Channel, Message -from foxglove_data_platform.client import Client +from foxglove.client import Client from .generate import generate_json_data