# Introduction
Inspiration and API reverse engineering taken from various projects:
https://github.com/BastianPoe/owlet_api
https://github.com/mbevand/owlet_monitor
## Install
To install via pip run command
```
pip install pyowletapi
```
## To do
Tidy up exception logging
Create test routines
## Use
import the api and sock objects
```python
from pyowletapi.api import OwletAPI
from pyowlet.sock import Sock
```
create an api object passing your region, username and password, the OwletAPI will also take a aiohttp session as a keyword argument
```python
api = OwletAPI('europe', username, password)
```
you can then authenticate against the Owlet servers using this object and create a list of sock objects
```python
await api.authenticate()
socks = {device['device']['dsn']: Sock(api, device['device']) for device in devices}
```
to get current reading from sock call the update_properties function on each sock object
```python
device.update_properties()
```
This will return a dictionary, the key 'raw_properties' contains the raw response as a dict and the 'properties' key is a more cut down dict version of the response showing only the most relevant data and the 'tokens' key will return a dictionary if the api tokens have changed since the last call
Raw data
{
"_id": null,
"home_page": "https://github.com/ryanbdclark/pyowletapi",
"name": "pyowletapi",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "owlet, api, baby",
"author": "Ryan Clark",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/39/bb/750bc7f68e1f17c866a15b84dcae0ead96ff4a4496ece6f9cede56a8aa05/pyowletapi-2024.3.2.tar.gz",
"platform": null,
"description": "# Introduction\r\n\r\nInspiration and API reverse engineering taken from various projects:\r\n\r\nhttps://github.com/BastianPoe/owlet_api\r\n\r\nhttps://github.com/mbevand/owlet_monitor\r\n\r\n\r\n## Install\r\nTo install via pip run command \r\n\r\n```\r\npip install pyowletapi\r\n```\r\n\r\n## To do\r\nTidy up exception logging\r\n\r\nCreate test routines\r\n\r\n## Use\r\nimport the api and sock objects\r\n\r\n```python\r\nfrom pyowletapi.api import OwletAPI\r\nfrom pyowlet.sock import Sock\r\n```\r\n\r\ncreate an api object passing your region, username and password, the OwletAPI will also take a aiohttp session as a keyword argument\r\n\r\n```python\r\napi = OwletAPI('europe', username, password)\r\n```\r\n\r\nyou can then authenticate against the Owlet servers using this object and create a list of sock objects\r\n\r\n```python\r\nawait api.authenticate()\r\nsocks = {device['device']['dsn']: Sock(api, device['device']) for device in devices}\r\n```\r\n\r\nto get current reading from sock call the update_properties function on each sock object\r\n```python\r\ndevice.update_properties()\r\n```\r\nThis will return a dictionary, the key 'raw_properties' contains the raw response as a dict and the 'properties' key is a more cut down dict version of the response showing only the most relevant data and the 'tokens' key will return a dictionary if the api tokens have changed since the last call\r\n",
"bugtrack_url": null,
"license": null,
"summary": "Owlet baby montior API wrapper",
"version": "2024.3.2",
"project_urls": {
"Homepage": "https://github.com/ryanbdclark/pyowletapi"
},
"split_keywords": [
"owlet",
" api",
" baby"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "39bb750bc7f68e1f17c866a15b84dcae0ead96ff4a4496ece6f9cede56a8aa05",
"md5": "c1121a9a5e67e4f9dc979fcd71054c7d",
"sha256": "0b3dd5941bfdd65507c58860a61c310baf9771617657f9562f5f426e536c757f"
},
"downloads": -1,
"filename": "pyowletapi-2024.3.2.tar.gz",
"has_sig": false,
"md5_digest": "c1121a9a5e67e4f9dc979fcd71054c7d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 10158,
"upload_time": "2024-03-27T15:35:22",
"upload_time_iso_8601": "2024-03-27T15:35:22.574897Z",
"url": "https://files.pythonhosted.org/packages/39/bb/750bc7f68e1f17c866a15b84dcae0ead96ff4a4496ece6f9cede56a8aa05/pyowletapi-2024.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-27 15:35:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ryanbdclark",
"github_project": "pyowletapi",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pyowletapi"
}