pydexcom

PyPI Python versions Pre-commit Tests Docs

A simple Python API to interact with Dexcom Share service. Used to get real-time Dexcom CGM sensor data.

Quick-start

  1. Download the Dexcom G7 / G6 / G5 / G4 mobile app and enable the Share service.

The Dexcom Share service requires setup of at least one follower to enable the share service, but pydexcom will use your (or the dependent's) credentials, not the follower's or manager's.

  1. Install the pydexcom package.

pip install pydexcom

  1. Profit.
>>> from pydexcom import Dexcom
>>> dexcom = Dexcom(username="username", password="password") # `region="ous"` if outside of US, `region="jp"` if Japan
>>> dexcom = Dexcom(username="+11234567890", password="password") # phone number
>>> dexcom = Dexcom(username="user@email.com", password="password") # email address
>>> dexcom = Dexcom(account_id="12345678-90ab-cdef-1234-567890abcdef", password="password") # account ID (advanced)
>>> glucose_reading = dexcom.get_current_glucose_reading()
>>> print(glucose_reading)
85

>>> glucose_reading.value
85

>>> glucose_reading.mmol_l
4.7

>>> glucose_reading.trend
4

>>> glucose_reading.trend_direction
'Flat'

>>> glucose_reading.trend_description
'steady'

>>> glucose_reading.trend_arrow
'→'

>>> print(bg.datetime)
2023-08-07 20:40:58

>>> glucose_reading.json
{'WT': 'Date(1691455258000)', 'ST': 'Date(1691455258000)', 'DT': 'Date(1691455258000-0400)', 'Value': 85, 'Trend': 'Flat'}

Documentation

https://gagebenne.github.io/pydexcom/pydexcom.html

Frequently Asked Questions

Why is my password not working?

The Dexcom Share API understandably reports limited information during account validation. If anything is incorrect, the API simply reports back invalid password ( pydexcom.errors.AccountErrorEnum ). However, there could be many reasons you are getting this error:

1. Ensure your credentials are valid.

Validate your Dexcom account credentials by logging on to the Dexcom Account Management website for your region:

For users in the United States: uam1.dexcom.com. For users outside of the United States: uam2.dexcom.com. For users in the Asia-Pacific: uam.dexcom.jp.

2. Use the correct Dexcom Share API endpoint.

For users in the United States: use the default, or set region="us" when initializing Dexcom. For users outside of the United States: be sure to set region="ous" when initializing Dexcom . For users in Japan: be sure to set region="jp" when initializing Dexcom.

3. Ensure your username is correctly formatted.

Format phone numbers with a +, your country code, then your phone number. For example, a US phone number of (123)-456-7890 would be supplied as a username="+11234567890".

4. Use _your_ Dexcom Share credentials, not the _follower's_ credentials.

Use the same credentials used to login to the Dexcom mobile application publishing the glucose readings.

5. Ensure you have at least one follower on Dexcom Share.

The Dexcom Share service requires setup of at least one follower to enable the service, as does this package.

6. Try using your account ID.

You can find your account ID by logging in to Dexcom Account Management website for your region. After logging in, note the UUID in the URL -- this is your account ID.

Format account IDs (UUIDs) with hyphens. For example, an account ID of 1234567890abcdef1234567890abcdef found in the URL after logging in would be supplied as account_id="12345678-90ab-cdef-1234-567890abcdef".

7. Report it!

The Dexcom Share API sometimes changes. If you believe there is an issue with pydexcom , feel free to create an issue if one has not been created yet already.

Why not use the official Dexcom Developer API?

The official Dexcom API is a great tool to view trends, statistics, and day-by-day data, but is not suitable for real time fetching of glucose readings as it is a retrospective API.

Can I use the Dexcom Stelo with this package?

No, the Dexcom Stelo isn't compatible with the Dexcom Share service, so this package can't retrieve its readings.

How can I let you know of suggestions or issues?

By all means submit a pull request if you have a feature you would like to see in the next release. Alternatively, you may create an issue if you have a suggestion or bug you'd like to report.

Where is this package being used?

Primarily this package is used in the Home Assistant Dexcom integration, but it's fantastic to see community projects involving pydexcom :

 1"""
 2.. include:: ../README.md
 3"""  # noqa: D200, D400, D415
 4
 5from .const import Region
 6from .dexcom import Dexcom
 7from .glucose_reading import GlucoseReading
 8
 9__all__ = [
10    "Dexcom",
11    "GlucoseReading",
12    "Region",
13    "const",
14    "errors",
15]
class Dexcom:
 37class Dexcom:
 38    """Class for communicating with Dexcom Share API."""
 39
 40    def __init__(
 41        self,
 42        *,
 43        password: str,
 44        account_id: str | None = None,
 45        username: str | None = None,
 46        region: Region = Region.US,
 47    ) -> None:
 48        """
 49        Initialize `Dexcom` with Dexcom Share credentials.
 50
 51        :param username: username for the Dexcom Share user, *not follower*.
 52        :param account_id: account ID for the Dexcom Share user, *not follower*.
 53        :param password: password for the Dexcom Share user.
 54        :param region: the region to use, one of `"us"`, `"ous"`, `"jp"`.
 55        """
 56        self._validate_region(region)
 57        self._validate_user_ids(account_id, username)
 58
 59        self._base_url = DEXCOM_BASE_URLS[region]
 60        self._application_id = DEXCOM_APPLICATION_IDS[region]
 61        self._password = password
 62        self._username: str | None = username
 63        self._account_id: str | None = account_id
 64        self._session_id: str | None = None
 65        self._session = requests.Session()
 66        self._get_session()
 67
 68    @property
 69    def username(self) -> str | None:
 70        """Get username."""
 71        return self._username
 72
 73    @property
 74    def account_id(self) -> str | None:
 75        """Get account ID."""
 76        return self._account_id
 77
 78    def _post(
 79        self,
 80        endpoint: str,
 81        params: dict[str, Any] | None = None,
 82        json: dict[str, Any] | None = None,
 83    ) -> Any:  # noqa: ANN401
 84        """
 85        Send post request to Dexcom Share API.
 86
 87        :param endpoint: URL of the post request
 88        :param params: `dict` to send in the query string of the post request
 89        :param json: JSON to send in the body of the post request
 90        """
 91        response = self._session.post(
 92            f"{self._base_url}{endpoint}",
 93            headers=HEADERS,
 94            params=params,
 95            json={} if json is None else json,
 96        )
 97
 98        try:
 99            response_json = response.json()
100            response.raise_for_status()
101        except requests.HTTPError as http_error:
102            raise self._handle_error_code(response_json) from http_error
103        except requests.JSONDecodeError as json_error:
104            _LOGGER.exception("JSON decode error: %s", response.text)
105            raise ServerError(ServerErrorEnum.INVALID_JSON) from json_error
106        else:
107            return response_json
108
109    def _handle_error_code(self, json: dict[str, Any]) -> DexcomError:  # noqa: C901, PLR0911
110        """
111        Parse `requests.Response` JSON for `pydexcom.errors.DexcomError`.
112
113        :param response: `requests.Response` JSON to parse
114        """
115        _LOGGER.debug("%s", json)
116        code, message = json.get("Code"), json.get("Message")
117        if code == "SessionIdNotFound":
118            return SessionError(SessionErrorEnum.NOT_FOUND)
119        if code == "SessionNotValid":
120            return SessionError(SessionErrorEnum.INVALID)
121        if code == "AccountPasswordInvalid":
122            return AccountError(AccountErrorEnum.FAILED_AUTHENTICATION)
123        if code == "SSO_AuthenticateMaxAttemptsExceeded":
124            return AccountError(AccountErrorEnum.MAX_ATTEMPTS)
125        if code == "SSO_InternalError":  # noqa: SIM102
126            if message and (
127                "Cannot Authenticate by AccountName" in message
128                or "Cannot Authenticate by AccountId" in message
129            ):
130                return AccountError(AccountErrorEnum.FAILED_AUTHENTICATION)
131        if code == "InvalidArgument":
132            if message and "accountName" in message:
133                return ArgumentError(ArgumentErrorEnum.USERNAME_INVALID)
134            if message and "password" in message:
135                return ArgumentError(ArgumentErrorEnum.PASSWORD_INVALID)
136            if message and "UUID" in message:
137                return ArgumentError(ArgumentErrorEnum.ACCOUNT_ID_INVALID)
138        if code and message:
139            _LOGGER.error("%s: %s", code, message)
140            return ServerError(ServerErrorEnum.UNKNOWN_CODE)
141        _LOGGER.error("%s", json)
142        return ServerError(ServerErrorEnum.UNEXPECTED)
143
144    def _validate_region(self, region: Region) -> None:
145        if region not in list(Region):
146            raise ArgumentError(ArgumentErrorEnum.REGION_INVALID)
147
148    def _validate_user_ids(self, account_id: str | None, username: str | None) -> None:
149        user_ids = sum(user_id is not None for user_id in [account_id, username])
150        if user_ids == 0:
151            raise ArgumentError(ArgumentErrorEnum.USER_ID_REQUIRED)
152        if user_ids != 1:
153            raise ArgumentError(ArgumentErrorEnum.USER_ID_MULTIPLE)
154
155    def _validate_session_id(self) -> None:
156        """Validate session ID."""
157        if any(
158            [
159                not isinstance(self._session_id, str),
160                not self._session_id,
161                not valid_uuid(self._session_id),
162            ],
163        ):
164            raise ArgumentError(ArgumentErrorEnum.SESSION_ID_INVALID)
165        if self._session_id == DEFAULT_UUID:
166            raise ArgumentError(ArgumentErrorEnum.SESSION_ID_DEFAULT)
167
168    def _validate_username(self) -> None:
169        """Validate username."""
170        if any([not isinstance(self._username, str), not self._username]):
171            raise ArgumentError(ArgumentErrorEnum.USERNAME_INVALID)
172
173    def _validate_password(self) -> None:
174        """Validate password."""
175        if any([not isinstance(self._password, str), not self._password]):
176            raise ArgumentError(ArgumentErrorEnum.PASSWORD_INVALID)
177
178    def _validate_account_id(self) -> None:
179        """Validate account ID."""
180        if any(
181            [
182                not isinstance(self._account_id, str),
183                not self._account_id,
184                not valid_uuid(self._account_id),
185            ],
186        ):
187            raise ArgumentError(ArgumentErrorEnum.ACCOUNT_ID_INVALID)
188        if self._account_id == DEFAULT_UUID:
189            raise ArgumentError(ArgumentErrorEnum.ACCOUNT_ID_DEFAULT)
190
191    def _validate_minutes_max_count(self, minutes: int, max_count: int) -> None:
192        if not isinstance(minutes, int) or any([minutes < 0, minutes > MAX_MINUTES]):
193            raise ArgumentError(ArgumentErrorEnum.MINUTES_INVALID)
194        if not isinstance(max_count, int) or any(
195            [max_count < 0, max_count > MAX_MAX_COUNT],
196        ):
197            raise ArgumentError(ArgumentErrorEnum.MAX_COUNT_INVALID)
198
199    @property
200    def _authenticate_endpoint_arguments(self) -> dict[str, Any]:
201        return {
202            "endpoint": DEXCOM_AUTHENTICATE_ENDPOINT,
203            "json": {
204                "accountName": self._username,
205                "password": self._password,
206                "applicationId": self._application_id,
207            },
208        }
209
210    @property
211    def _login_id_endpoint_arguments(self) -> dict[str, Any]:
212        return {
213            "endpoint": DEXCOM_LOGIN_ID_ENDPOINT,
214            "json": {
215                "accountId": self._account_id,
216                "password": self._password,
217                "applicationId": self._application_id,
218            },
219        }
220
221    def _glucose_readings_endpoint_arguments(
222        self,
223        minutes: int = MAX_MINUTES,
224        max_count: int = MAX_MAX_COUNT,
225    ) -> dict[str, Any]:
226        return {
227            "endpoint": DEXCOM_GLUCOSE_READINGS_ENDPOINT,
228            "params": {
229                "sessionId": self._session_id,
230                "minutes": minutes,
231                "maxCount": max_count,
232            },
233        }
234
235    def _get_account_id(self) -> str:
236        """
237        Retrieve account ID from the authentication endpoint.
238
239        See `pydexcom.const.DEXCOM_AUTHENTICATE_ENDPOINT`.
240        """
241        _LOGGER.debug("Retrieve account ID from the authentication endpoint")
242        return self._post(**self._authenticate_endpoint_arguments)
243
244    def _get_session_id(self) -> str:
245        """
246        Retrieve session ID from the login endpoint.
247
248        See `pydexcom.const.DEXCOM_LOGIN_ID_ENDPOINT`.
249        """
250        _LOGGER.debug("Retrieve session ID from the login endpoint")
251        return self._post(**self._login_id_endpoint_arguments)
252
253    def _get_session(self) -> None:
254        """Create Dexcom Share API session."""
255        self._validate_password()
256
257        if self._account_id is None:
258            self._validate_username()
259            self._account_id = self._get_account_id()
260
261        self._validate_account_id()
262        self._session_id = self._get_session_id()
263        self._validate_session_id()
264
265    def _get_glucose_readings(
266        self,
267        minutes: int = MAX_MINUTES,
268        max_count: int = MAX_MAX_COUNT,
269    ) -> list[dict[str, Any]]:
270        """
271        Retrieve glucose readings from the glucose readings endpoint.
272
273        See `pydexcom.const.DEXCOM_GLUCOSE_READINGS_ENDPOINT`.
274        """
275        _LOGGER.debug("Retrieve glucose readings from the glucose readings endpoint")
276        self._validate_minutes_max_count(minutes, max_count)
277
278        return self._post(
279            **self._glucose_readings_endpoint_arguments(minutes, max_count),
280        )
281
282    def get_glucose_readings(
283        self,
284        minutes: int = MAX_MINUTES,
285        max_count: int = MAX_MAX_COUNT,
286    ) -> list[GlucoseReading]:
287        """
288        Get `max_count` glucose readings within specified number of `minutes`.
289
290        Catches one instance of a thrown `pydexcom.errors.SessionError` if session ID
291        expired, attempts to get a new session ID and retries.
292
293        :param minutes: Number of minutes to retrieve glucose readings from (1-1440)
294        :param max_count: Maximum number of glucose readings to retrieve (1-288)
295        """
296        json_glucose_readings: list[dict[str, Any]] = []
297
298        try:
299            # Requesting glucose reading with DEFAULT_UUID returns non-JSON empty string
300            self._validate_session_id()
301            json_glucose_readings = self._get_glucose_readings(minutes, max_count)
302        except SessionError:
303            # Attempt to update expired session ID
304            self._get_session()
305            json_glucose_readings = self._get_glucose_readings(minutes, max_count)
306
307        return [GlucoseReading(json_reading) for json_reading in json_glucose_readings]
308
309    def get_latest_glucose_reading(self) -> GlucoseReading | None:
310        """Get latest available glucose reading, within the last 24 hours."""
311        return next(iter(self.get_glucose_readings(max_count=1)), None)
312
313    def get_current_glucose_reading(self) -> GlucoseReading | None:
314        """Get current available glucose reading, within the last 10 minutes."""
315        return next(iter(self.get_glucose_readings(minutes=10, max_count=1)), None)

Class for communicating with Dexcom Share API.

Dexcom( *, password: str, account_id: str | None = None, username: str | None = None, region: Region = <Region.US: 'us'>)
40    def __init__(
41        self,
42        *,
43        password: str,
44        account_id: str | None = None,
45        username: str | None = None,
46        region: Region = Region.US,
47    ) -> None:
48        """
49        Initialize `Dexcom` with Dexcom Share credentials.
50
51        :param username: username for the Dexcom Share user, *not follower*.
52        :param account_id: account ID for the Dexcom Share user, *not follower*.
53        :param password: password for the Dexcom Share user.
54        :param region: the region to use, one of `"us"`, `"ous"`, `"jp"`.
55        """
56        self._validate_region(region)
57        self._validate_user_ids(account_id, username)
58
59        self._base_url = DEXCOM_BASE_URLS[region]
60        self._application_id = DEXCOM_APPLICATION_IDS[region]
61        self._password = password
62        self._username: str | None = username
63        self._account_id: str | None = account_id
64        self._session_id: str | None = None
65        self._session = requests.Session()
66        self._get_session()

Initialize Dexcom with Dexcom Share credentials.

Parameters
  • username: username for the Dexcom Share user, not follower.
  • account_id: account ID for the Dexcom Share user, not follower.
  • password: password for the Dexcom Share user.
  • region: the region to use, one of "us", "ous", "jp".
username: str | None
68    @property
69    def username(self) -> str | None:
70        """Get username."""
71        return self._username

Get username.

account_id: str | None
73    @property
74    def account_id(self) -> str | None:
75        """Get account ID."""
76        return self._account_id

Get account ID.

def get_glucose_readings( self, minutes: int = 1440, max_count: int = 288) -> list[GlucoseReading]:
282    def get_glucose_readings(
283        self,
284        minutes: int = MAX_MINUTES,
285        max_count: int = MAX_MAX_COUNT,
286    ) -> list[GlucoseReading]:
287        """
288        Get `max_count` glucose readings within specified number of `minutes`.
289
290        Catches one instance of a thrown `pydexcom.errors.SessionError` if session ID
291        expired, attempts to get a new session ID and retries.
292
293        :param minutes: Number of minutes to retrieve glucose readings from (1-1440)
294        :param max_count: Maximum number of glucose readings to retrieve (1-288)
295        """
296        json_glucose_readings: list[dict[str, Any]] = []
297
298        try:
299            # Requesting glucose reading with DEFAULT_UUID returns non-JSON empty string
300            self._validate_session_id()
301            json_glucose_readings = self._get_glucose_readings(minutes, max_count)
302        except SessionError:
303            # Attempt to update expired session ID
304            self._get_session()
305            json_glucose_readings = self._get_glucose_readings(minutes, max_count)
306
307        return [GlucoseReading(json_reading) for json_reading in json_glucose_readings]

Get max_count glucose readings within specified number of minutes.

Catches one instance of a thrown pydexcom.errors.SessionError if session ID expired, attempts to get a new session ID and retries.

Parameters
  • minutes: Number of minutes to retrieve glucose readings from (1-1440)
  • max_count: Maximum number of glucose readings to retrieve (1-288)
def get_latest_glucose_reading(self) -> GlucoseReading | None:
309    def get_latest_glucose_reading(self) -> GlucoseReading | None:
310        """Get latest available glucose reading, within the last 24 hours."""
311        return next(iter(self.get_glucose_readings(max_count=1)), None)

Get latest available glucose reading, within the last 24 hours.

def get_current_glucose_reading(self) -> GlucoseReading | None:
313    def get_current_glucose_reading(self) -> GlucoseReading | None:
314        """Get current available glucose reading, within the last 10 minutes."""
315        return next(iter(self.get_glucose_readings(minutes=10, max_count=1)), None)

Get current available glucose reading, within the last 10 minutes.

class GlucoseReading:
 22class GlucoseReading:
 23    """Class for parsing glucose reading from Dexcom Share API."""
 24
 25    def __init__(self, json_glucose_reading: dict[str, Any]) -> None:
 26        """
 27        Initialize `GlucoseReading` with JSON glucose reading from Dexcom Share API.
 28
 29        :param json_glucose_reading: JSON glucose reading from Dexcom Share API
 30        """
 31        self._json = json_glucose_reading
 32        try:
 33            self._value = int(json_glucose_reading["Value"])
 34            self._trend_direction: str = json_glucose_reading["Trend"]
 35            # Dexcom Share API returns `str` direction now, previously `int` trend
 36            self._trend: int = DEXCOM_TREND_DIRECTIONS[self._trend_direction]
 37
 38            match = re.match(
 39                r"Date\((?P<timestamp>\d+)(?P<timezone>[+-]\d{4})\)",
 40                json_glucose_reading["DT"],
 41            )
 42            if match:
 43                self._datetime = datetime.fromtimestamp(
 44                    int(match.group("timestamp")) / 1000.0,
 45                    tz=datetime.strptime(match.group("timezone"), "%z").tzinfo,
 46                )
 47        except (KeyError, TypeError, ValueError) as error:
 48            raise ArgumentError(ArgumentErrorEnum.GLUCOSE_READING_INVALID) from error
 49
 50    @property
 51    def value(self) -> int:
 52        """Blood glucose value in mg/dL."""
 53        return self._value
 54
 55    @property
 56    def mg_dl(self) -> int:
 57        """Blood glucose value in mg/dL."""
 58        return self._value
 59
 60    @property
 61    def mmol_l(self) -> float:
 62        """Blood glucose value in mmol/L."""
 63        return round(self.value * MMOL_L_CONVERSION_FACTOR, 1)
 64
 65    @property
 66    def trend(self) -> int:
 67        """
 68        Blood glucose trend information.
 69
 70        Value of `pydexcom.const.DEXCOM_TREND_DIRECTIONS`.
 71        """
 72        return self._trend
 73
 74    @property
 75    def trend_direction(self) -> str:
 76        """
 77        Blood glucose trend direction.
 78
 79        Key of `pydexcom.const.DEXCOM_TREND_DIRECTIONS`.
 80        """
 81        return self._trend_direction
 82
 83    @property
 84    def trend_description(self) -> str | None:
 85        """
 86        Blood glucose trend information description.
 87
 88        See `pydexcom.const.TREND_DESCRIPTIONS`.
 89        """
 90        return TREND_DESCRIPTIONS[self._trend]
 91
 92    @property
 93    def trend_arrow(self) -> str:
 94        """Blood glucose trend as unicode arrow (`pydexcom.const.TREND_ARROWS`)."""
 95        return TREND_ARROWS[self._trend]
 96
 97    @property
 98    def datetime(self) -> datetime:
 99        """Glucose reading recorded time as datetime."""
100        return self._datetime
101
102    @property
103    def json(self) -> dict[str, Any]:
104        """JSON glucose reading from Dexcom Share API."""
105        return self._json
106
107    def __str__(self) -> str:
108        """Blood glucose value as in mg/dL."""
109        return str(self._value)

Class for parsing glucose reading from Dexcom Share API.

GlucoseReading(json_glucose_reading: dict[str, typing.Any])
25    def __init__(self, json_glucose_reading: dict[str, Any]) -> None:
26        """
27        Initialize `GlucoseReading` with JSON glucose reading from Dexcom Share API.
28
29        :param json_glucose_reading: JSON glucose reading from Dexcom Share API
30        """
31        self._json = json_glucose_reading
32        try:
33            self._value = int(json_glucose_reading["Value"])
34            self._trend_direction: str = json_glucose_reading["Trend"]
35            # Dexcom Share API returns `str` direction now, previously `int` trend
36            self._trend: int = DEXCOM_TREND_DIRECTIONS[self._trend_direction]
37
38            match = re.match(
39                r"Date\((?P<timestamp>\d+)(?P<timezone>[+-]\d{4})\)",
40                json_glucose_reading["DT"],
41            )
42            if match:
43                self._datetime = datetime.fromtimestamp(
44                    int(match.group("timestamp")) / 1000.0,
45                    tz=datetime.strptime(match.group("timezone"), "%z").tzinfo,
46                )
47        except (KeyError, TypeError, ValueError) as error:
48            raise ArgumentError(ArgumentErrorEnum.GLUCOSE_READING_INVALID) from error

Initialize GlucoseReading with JSON glucose reading from Dexcom Share API.

Parameters
  • json_glucose_reading: JSON glucose reading from Dexcom Share API
value: int
50    @property
51    def value(self) -> int:
52        """Blood glucose value in mg/dL."""
53        return self._value

Blood glucose value in mg/dL.

mg_dl: int
55    @property
56    def mg_dl(self) -> int:
57        """Blood glucose value in mg/dL."""
58        return self._value

Blood glucose value in mg/dL.

mmol_l: float
60    @property
61    def mmol_l(self) -> float:
62        """Blood glucose value in mmol/L."""
63        return round(self.value * MMOL_L_CONVERSION_FACTOR, 1)

Blood glucose value in mmol/L.

trend: int
65    @property
66    def trend(self) -> int:
67        """
68        Blood glucose trend information.
69
70        Value of `pydexcom.const.DEXCOM_TREND_DIRECTIONS`.
71        """
72        return self._trend

Blood glucose trend information.

Value of pydexcom.const.DEXCOM_TREND_DIRECTIONS.

trend_direction: str
74    @property
75    def trend_direction(self) -> str:
76        """
77        Blood glucose trend direction.
78
79        Key of `pydexcom.const.DEXCOM_TREND_DIRECTIONS`.
80        """
81        return self._trend_direction

Blood glucose trend direction.

Key of pydexcom.const.DEXCOM_TREND_DIRECTIONS.

trend_description: str | None
83    @property
84    def trend_description(self) -> str | None:
85        """
86        Blood glucose trend information description.
87
88        See `pydexcom.const.TREND_DESCRIPTIONS`.
89        """
90        return TREND_DESCRIPTIONS[self._trend]

Blood glucose trend information description.

See pydexcom.const.TREND_DESCRIPTIONS.

trend_arrow: str
92    @property
93    def trend_arrow(self) -> str:
94        """Blood glucose trend as unicode arrow (`pydexcom.const.TREND_ARROWS`)."""
95        return TREND_ARROWS[self._trend]

Blood glucose trend as unicode arrow (pydexcom.const.TREND_ARROWS).

datetime: <property object at 0x7fbfb5866bb0>
 97    @property
 98    def datetime(self) -> datetime:
 99        """Glucose reading recorded time as datetime."""
100        return self._datetime

Glucose reading recorded time as datetime.

json: dict[str, typing.Any]
102    @property
103    def json(self) -> dict[str, Any]:
104        """JSON glucose reading from Dexcom Share API."""
105        return self._json

JSON glucose reading from Dexcom Share API.

class Region(builtins.str, enum.Enum):
 7class Region(str, Enum):
 8    """Regions."""
 9
10    US = "us"
11    OUS = "ous"
12    JP = "jp"

Regions.

US = <Region.US: 'us'>
OUS = <Region.OUS: 'ous'>
JP = <Region.JP: 'jp'>