Seamapi

Latest version: v3.0.0

Safety actively analyzes 681812 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

1.0.0

Migration guide from [seampai](https://pypi.org/project/seamapi/) to [seam](https://pypi.org/project/seam/)

Learn how to migrate from the `seamapi` package to the `seam` package. This guide includes descriptions of all breaking changes.

The new SDK has fewer dependencies and is generated daily to ensure methods and types are always up-to-date with the latest API changes. It is mostly a drop-in replacement, however some method signatures and options have changed to improve overall consistency with the Seam API.

This guide includes descriptions of all breaking changes. Please refer to the [README](https://github.com/seamapi/python/blob/main/README.md) for updated usage instructions and a complete list of new features.

New Python package name

Changed the package name from `seamapi` to `seam`.

diff
- pip install seamapi
+ pip install seam


diff
- from seamapi import Seam
+ from seam import Seam


Updated API method signatures

Keyword arguments

API method signatures now only accept keyword arguments.

diff
- seam.access_codes.get("my_access_code_id")
+ seam.access_codes.get(access_code_id="my_access_code_id")


diff
- seam.thermostats.get("my_thermostat_device_id")
+ seam.thermostats.get(device_id="my_thermostat_device_id")


Standardized resource ID arguments

Changed from accepting both resource objects and resource ID strings to accepting only resource ID strings. Includes a renaming scheme for clarity.

diff
- def get(resource: Union[str, Resource]) -> Resource
+ def get(resource_id: str) -> Resource


Usage

diff
- seam.locks.get(device=my_device)
+ seam.locks.get(device_id=my_device.device_id)


Removed method arguments

Removed `wait_for_code` from `access_codes.create`. Use the newly-created `access_code_id` to poll or watch for events.

Return value changes

Changed the return types for some methods to enhance API consistency and reliability.

The following methods now return `void`:

- `access_codes.delete`: Instead, you should wait for the `access_code.deleted` event.
- `access_codes.unmanaged.delete`
- `access_codes.update`: Instead, you should watch for relevant `access_code.*` events or poll the resource as needed.
- `noise_sensors.noise_thresholds.delete`: Instead, you should wait for the `noise_threshold.deleted` event.
- `noise_sensors.noise_thresholds.update`: Instead, you should watch for relevant `noise_threshold.*` events or poll the resource as needed.
- `thermostats.climate_setting_schedules.update`: Instead, you should watch for relevant `climate_setting_schedule.*` events or poll the resource as needed.
- `access_codes.unmanaged.convert_to_managed`: Instead, you should wait for the `access_code.unmanaged.converted_to_managed` and `access_code.unmanaged.failed_to_convert_to_managed` events.

The following methods now return a `NoiseThreshold`:

- `noise_sensors.noise_thresholds.create`: Use the newly-created `noise_threshold_id` to poll or watch for events.

The following methods now return an `ActionAttempt`:

- `workspaces.reset_sandbox`: Instead, you should use the newly-created `action_attempt_id` to poll the status of the action attempt via the `/action_attempt/get` endpoint.

Action attempt resolution

Methods returning action attempts still wait for the action attempt to resolve by default. Further, you can now configure this behavior using the [`wait_for_action_attempt` option](https://github.com/seamapi/javascript-http#action-attempts) on a per-request basis. You can also set the default behavior for the client.

Set per request

py
Wait for the action attempt to be ready with a default timeout of 5.0 seconds and a default polling interval of 0.5 seconds.
seam.locks.lock_door(
device_id="my_device_id",
wait_for_action_attempt=True
)

Wait up to 10 seconds for the action attempt to be ready, checking every 2 seconds.
seam.locks.lock_door(
device_id="my_device_id",
wait_for_action_attempt={
"timeout": 10.0, Up to 10 seconds
"polling_interval": 2.0 Every 2 seconds
}
)


Set default behavior

py
seam = Seam(wait_for_action_attempt=True)


Environment variables

Added support for the `SEAM_ENDPOINT` environment variable.

Using Personal Access Tokens without a Workspace ID

Use `SeamMultiWorkspace` to call the subset of Seam API endpoints that allow authentication with a personal access token without a workspace ID.

diff
- const seam = new Seam({ personal_access_token: 'your-personal-access-token' })
- const workspace = seam.workspaces.create({ company_name: 'Example Inc.' })
+ const seam_multi_workspace = new SeamMultiWorkspace({ personal_access_token: 'your-personal-access-token' })
+ const workspace = seam_multi_workspace.workspaces.create({ company_name: 'Example Inc.' })


Third-party component support and version changes

- Updated the minimum supported Python version to 3.9.
- Updated the `dataclasses-json` version to 0.6.4.
- Removed Sentry support.
- Replaced `requests` with `niquests` version 3.6.4.

1.0.0rc0

[0.15.0](https://github.com/seamapi/python/compare/v0.14.0...v0.15.0) (2024-06-27)


Features

* **deps-dev:** Bump seamapi/types from 1.186.0 to 1.187.0 in the seam group ([100](https://github.com/seamapi/python/issues/100)) ([4cc1967](https://github.com/seamapi/python/commit/4cc1967bf8ba35af3190665be89b17760cde2aca))

0.15.0

[0.15.0](https://github.com/seamapi/python-next/compare/v0.14.0...v0.15.0) (2024-06-27)


Features

* **deps-dev:** Bump seamapi/types from 1.186.0 to 1.187.0 in the seam group ([100](https://github.com/seamapi/python-next/issues/100)) ([4cc1967](https://github.com/seamapi/python-next/commit/4cc1967bf8ba35af3190665be89b17760cde2aca))

0.14.0

[0.14.0](https://github.com/seamapi/python-next/compare/v0.13.1...v0.14.0) (2024-06-27)


Features

* introduce `SeamHttpUnauthorizedError` and `SeamHttpInvalidInputError` ([99](https://github.com/seamapi/python-next/issues/99)) ([5298da5](https://github.com/seamapi/python-next/commit/5298da51689d401379986d797d00d246b11b1109))

0.13.1

[0.13.1](https://github.com/seamapi/python-next/compare/v0.13.0...v0.13.1) (2024-06-26)


Bug Fixes

* Rename Event to SeamEvent ([97](https://github.com/seamapi/python-next/issues/97)) ([4f10fa2](https://github.com/seamapi/python-next/commit/4f10fa26f721c03a3e996cc7778535aa2d5412ba))

0.13.0

[0.13.0](https://github.com/seamapi/python-next/compare/v0.12.1...v0.13.0) (2024-06-26)


Features

* Default wait_for_action_attempt to True ([91](https://github.com/seamapi/python-next/issues/91)) ([8c54178](https://github.com/seamapi/python-next/commit/8c541787d7667cd0f2d7facd296de6b95b7999ab))

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.