fitbit-cli 1.2.0__tar.gz → 1.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fitbit_cli-1.2.0/fitbit_cli.egg-info → fitbit_cli-1.3.1}/PKG-INFO +40 -21
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/README.md +21 -16
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/fitbit_cli/__init__.py +1 -1
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/fitbit_cli/cli.py +43 -9
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/fitbit_cli/formatter.py +2 -0
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1/fitbit_cli.egg-info}/PKG-INFO +40 -21
- fitbit_cli-1.3.1/fitbit_cli.egg-info/requires.txt +2 -0
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/setup.py +2 -2
- fitbit_cli-1.2.0/fitbit_cli.egg-info/requires.txt +0 -2
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/LICENSE +0 -0
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/MANIFEST.in +0 -0
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/fitbit_cli/exceptions.py +0 -0
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/fitbit_cli/fitbit_api.py +0 -0
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/fitbit_cli/fitbit_setup.py +0 -0
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/fitbit_cli/main.py +0 -0
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/fitbit_cli.egg-info/SOURCES.txt +0 -0
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/fitbit_cli.egg-info/dependency_links.txt +0 -0
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/fitbit_cli.egg-info/entry_points.txt +0 -0
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/fitbit_cli.egg-info/top_level.txt +0 -0
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/pyproject.toml +0 -0
- {fitbit_cli-1.2.0 → fitbit_cli-1.3.1}/setup.cfg +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: fitbit-cli
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.1
|
|
4
4
|
Summary: Access your Fitbit data at your terminal.
|
|
5
5
|
Home-page: https://github.com/veerendra2/fitbit-cli
|
|
6
|
-
Download-URL: https://github.com/veerendra2/fitbit-cli/archive/1.
|
|
6
|
+
Download-URL: https://github.com/veerendra2/fitbit-cli/archive/1.3.1.tar.gz
|
|
7
7
|
Author: veerendra2
|
|
8
8
|
Author-email: vk.tyk23@simplelogin.com
|
|
9
9
|
License: MIT
|
|
@@ -27,8 +27,22 @@ Classifier: Topic :: Utilities
|
|
|
27
27
|
Requires-Python: >=3.9
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
29
|
License-File: LICENSE
|
|
30
|
-
Requires-Dist: requests==2.32.
|
|
31
|
-
Requires-Dist: rich==
|
|
30
|
+
Requires-Dist: requests==2.32.4
|
|
31
|
+
Requires-Dist: rich==14.0.0
|
|
32
|
+
Dynamic: author
|
|
33
|
+
Dynamic: author-email
|
|
34
|
+
Dynamic: classifier
|
|
35
|
+
Dynamic: description
|
|
36
|
+
Dynamic: description-content-type
|
|
37
|
+
Dynamic: download-url
|
|
38
|
+
Dynamic: home-page
|
|
39
|
+
Dynamic: keywords
|
|
40
|
+
Dynamic: license
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
Dynamic: project-url
|
|
43
|
+
Dynamic: requires-dist
|
|
44
|
+
Dynamic: requires-python
|
|
45
|
+
Dynamic: summary
|
|
32
46
|
|
|
33
47
|
# Fitbit CLI
|
|
34
48
|
|
|
@@ -67,11 +81,12 @@ Access your Fitbit data directly from your terminal 💻. View 💤 sleep logs,
|
|
|
67
81
|
python -m pip install fitbit-cli
|
|
68
82
|
```
|
|
69
83
|
|
|
70
|
-
2. Help
|
|
84
|
+
2. See Help
|
|
71
85
|
|
|
72
86
|
```bash
|
|
73
87
|
fitbit-cli -h
|
|
74
|
-
usage: fitbit-cli [-h] [-i] [-s [DATE[,DATE]]] [-o [DATE[,DATE]]] [-e [DATE[,DATE]]] [-a [DATE[,DATE]]]
|
|
88
|
+
usage: fitbit-cli [-h] [-i] [-s [DATE[,DATE]|RELATIVE]] [-o [DATE[,DATE]|RELATIVE]] [-e [DATE[,DATE]|RELATIVE]] [-a [DATE[,DATE]|RELATIVE]]
|
|
89
|
+
[-b [DATE[,DATE]|RELATIVE]] [-u] [-v]
|
|
75
90
|
|
|
76
91
|
Fitbit CLI -- Access your Fitbit data at your terminal.
|
|
77
92
|
|
|
@@ -81,17 +96,20 @@ options:
|
|
|
81
96
|
-v, --version Show fitbit-cli version
|
|
82
97
|
|
|
83
98
|
APIs:
|
|
84
|
-
Specify date
|
|
85
|
-
|
|
99
|
+
Specify a date, date range (YYYY-MM-DD[,YYYY-MM-DD]), or relative date.
|
|
100
|
+
Relative dates: yesterday, last-week, last-month, last-N-days/weeks/months (e.g., last-2-days).
|
|
101
|
+
If not provided, defaults to today's date.
|
|
86
102
|
|
|
87
|
-
-s, --sleep [DATE[,DATE]]
|
|
103
|
+
-s, --sleep [DATE[,DATE]|RELATIVE]
|
|
88
104
|
Show sleep data
|
|
89
|
-
-o, --spo2 [DATE[,DATE]]
|
|
105
|
+
-o, --spo2 [DATE[,DATE]|RELATIVE]
|
|
90
106
|
Show SpO2 data
|
|
91
|
-
-e, --heart [DATE[,DATE]]
|
|
107
|
+
-e, --heart [DATE[,DATE]|RELATIVE]
|
|
92
108
|
Show Heart Rate Time Series data
|
|
93
|
-
-a, --active-zone [DATE[,DATE]]
|
|
109
|
+
-a, --active-zone [DATE[,DATE]|RELATIVE]
|
|
94
110
|
Show Active Zone Minutes (AZM) Time Series data
|
|
111
|
+
-b, --breathing-rate [DATE[,DATE]|RELATIVE]
|
|
112
|
+
Show Breathing Rate Summary data
|
|
95
113
|
-u, --show-user-profile
|
|
96
114
|
Show user profile data
|
|
97
115
|
```
|
|
@@ -112,19 +130,18 @@ APIs:
|
|
|
112
130
|
fitbit-cli --init-auth
|
|
113
131
|
```
|
|
114
132
|
|
|
115
|
-
For a visual guide, see the Asciinema recording below
|
|
116
133
|
[](https://asciinema.org/a/696115)
|
|
117
134
|
|
|
118
135
|
5. Start using it 😎
|
|
119
136
|
|
|
120
137
|
```bash
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
┃ Date 📆 ┃ Deep Sleep 🛏 ┃ Light Sleep 💤 ┃ REM Sleep 🌙 ┃ Wake Time ⏰ ┃ Efficiency 💯 ┃
|
|
125
|
-
|
|
126
|
-
│
|
|
127
|
-
|
|
138
|
+
fitbit-cli -s
|
|
139
|
+
Sleep Data Summary 😴
|
|
140
|
+
┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
|
|
141
|
+
┃ Date 📆 ┃ Deep Sleep 🛏 ┃ Light Sleep 💤 ┃ REM Sleep 🌙 ┃ Wake Time ⏰ ┃ Efficiency 💯 ┃ Time in Bed 🕐 ┃
|
|
142
|
+
┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
|
|
143
|
+
│ 2025-05-03 │ 129 min │ 271 min │ 140 min │ 66 min │ 57% │ 10.1 hr │
|
|
144
|
+
└────────────┴──────────────┴────────────────┴──────────────┴──────────────┴───────────────┴────────────────┘
|
|
128
145
|
```
|
|
129
146
|
|
|
130
147
|
_**NOTE: The token is valid for only 8 hours, `fitbit-cli` automatically refreshes the token when it expires.**_
|
|
@@ -141,4 +158,6 @@ cd fitbit-cli
|
|
|
141
158
|
python -m venv venv
|
|
142
159
|
source venv/bin/activate
|
|
143
160
|
python -m pip install -e .
|
|
161
|
+
|
|
162
|
+
deactivate
|
|
144
163
|
```
|
|
@@ -35,11 +35,12 @@ Access your Fitbit data directly from your terminal 💻. View 💤 sleep logs,
|
|
|
35
35
|
python -m pip install fitbit-cli
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
2. Help
|
|
38
|
+
2. See Help
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
41
|
fitbit-cli -h
|
|
42
|
-
usage: fitbit-cli [-h] [-i] [-s [DATE[,DATE]]] [-o [DATE[,DATE]]] [-e [DATE[,DATE]]] [-a [DATE[,DATE]]]
|
|
42
|
+
usage: fitbit-cli [-h] [-i] [-s [DATE[,DATE]|RELATIVE]] [-o [DATE[,DATE]|RELATIVE]] [-e [DATE[,DATE]|RELATIVE]] [-a [DATE[,DATE]|RELATIVE]]
|
|
43
|
+
[-b [DATE[,DATE]|RELATIVE]] [-u] [-v]
|
|
43
44
|
|
|
44
45
|
Fitbit CLI -- Access your Fitbit data at your terminal.
|
|
45
46
|
|
|
@@ -49,17 +50,20 @@ options:
|
|
|
49
50
|
-v, --version Show fitbit-cli version
|
|
50
51
|
|
|
51
52
|
APIs:
|
|
52
|
-
Specify date
|
|
53
|
-
|
|
53
|
+
Specify a date, date range (YYYY-MM-DD[,YYYY-MM-DD]), or relative date.
|
|
54
|
+
Relative dates: yesterday, last-week, last-month, last-N-days/weeks/months (e.g., last-2-days).
|
|
55
|
+
If not provided, defaults to today's date.
|
|
54
56
|
|
|
55
|
-
-s, --sleep [DATE[,DATE]]
|
|
57
|
+
-s, --sleep [DATE[,DATE]|RELATIVE]
|
|
56
58
|
Show sleep data
|
|
57
|
-
-o, --spo2 [DATE[,DATE]]
|
|
59
|
+
-o, --spo2 [DATE[,DATE]|RELATIVE]
|
|
58
60
|
Show SpO2 data
|
|
59
|
-
-e, --heart [DATE[,DATE]]
|
|
61
|
+
-e, --heart [DATE[,DATE]|RELATIVE]
|
|
60
62
|
Show Heart Rate Time Series data
|
|
61
|
-
-a, --active-zone [DATE[,DATE]]
|
|
63
|
+
-a, --active-zone [DATE[,DATE]|RELATIVE]
|
|
62
64
|
Show Active Zone Minutes (AZM) Time Series data
|
|
65
|
+
-b, --breathing-rate [DATE[,DATE]|RELATIVE]
|
|
66
|
+
Show Breathing Rate Summary data
|
|
63
67
|
-u, --show-user-profile
|
|
64
68
|
Show user profile data
|
|
65
69
|
```
|
|
@@ -80,19 +84,18 @@ APIs:
|
|
|
80
84
|
fitbit-cli --init-auth
|
|
81
85
|
```
|
|
82
86
|
|
|
83
|
-
For a visual guide, see the Asciinema recording below
|
|
84
87
|
[](https://asciinema.org/a/696115)
|
|
85
88
|
|
|
86
89
|
5. Start using it 😎
|
|
87
90
|
|
|
88
91
|
```bash
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
┃ Date 📆 ┃ Deep Sleep 🛏 ┃ Light Sleep 💤 ┃ REM Sleep 🌙 ┃ Wake Time ⏰ ┃ Efficiency 💯 ┃
|
|
93
|
-
|
|
94
|
-
│
|
|
95
|
-
|
|
92
|
+
fitbit-cli -s
|
|
93
|
+
Sleep Data Summary 😴
|
|
94
|
+
┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
|
|
95
|
+
┃ Date 📆 ┃ Deep Sleep 🛏 ┃ Light Sleep 💤 ┃ REM Sleep 🌙 ┃ Wake Time ⏰ ┃ Efficiency 💯 ┃ Time in Bed 🕐 ┃
|
|
96
|
+
┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
|
|
97
|
+
│ 2025-05-03 │ 129 min │ 271 min │ 140 min │ 66 min │ 57% │ 10.1 hr │
|
|
98
|
+
└────────────┴──────────────┴────────────────┴──────────────┴──────────────┴───────────────┴────────────────┘
|
|
96
99
|
```
|
|
97
100
|
|
|
98
101
|
_**NOTE: The token is valid for only 8 hours, `fitbit-cli` automatically refreshes the token when it expires.**_
|
|
@@ -109,4 +112,6 @@ cd fitbit-cli
|
|
|
109
112
|
python -m venv venv
|
|
110
113
|
source venv/bin/activate
|
|
111
114
|
python -m pip install -e .
|
|
115
|
+
|
|
116
|
+
deactivate
|
|
112
117
|
```
|
|
@@ -4,14 +4,47 @@ CLI Arguments Parser
|
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
6
|
import argparse
|
|
7
|
-
|
|
7
|
+
import re
|
|
8
|
+
from datetime import datetime, timedelta
|
|
8
9
|
|
|
9
10
|
from . import __version__
|
|
10
11
|
|
|
11
12
|
|
|
13
|
+
def _get_date_range(delta_days):
|
|
14
|
+
return (
|
|
15
|
+
(datetime.today() - timedelta(days=delta_days)).strftime("%Y-%m-%d"),
|
|
16
|
+
datetime.today().strftime("%Y-%m-%d"),
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
def _parse_relative_dates(date_str):
|
|
21
|
+
"""Helper function to parse relative date patterns"""
|
|
22
|
+
if date_str.lower() == "yesterday":
|
|
23
|
+
return ((datetime.today() - timedelta(days=1)).strftime("%Y-%m-%d"), None)
|
|
24
|
+
|
|
25
|
+
match = re.match(r"^last-(\d+)-(days|weeks|months)$", date_str, re.IGNORECASE)
|
|
26
|
+
if match:
|
|
27
|
+
number = int(match.group(1))
|
|
28
|
+
unit = match.group(2).lower()
|
|
29
|
+
multipliers = {"days": 1, "weeks": 7, "months": 30}
|
|
30
|
+
return _get_date_range(number * multipliers[unit])
|
|
31
|
+
|
|
32
|
+
match = re.match(r"^last-(week|month)$", date_str, re.IGNORECASE)
|
|
33
|
+
if match:
|
|
34
|
+
unit = match.group(1).lower()
|
|
35
|
+
days = 7 if unit == "week" else 30
|
|
36
|
+
return _get_date_range(days)
|
|
37
|
+
|
|
38
|
+
return None
|
|
39
|
+
|
|
40
|
+
|
|
12
41
|
def parse_date_range(date_str):
|
|
13
|
-
"""Date parser"""
|
|
42
|
+
"""Date parser that handles both absolute and relative dates"""
|
|
43
|
+
relative_result = _parse_relative_dates(date_str)
|
|
44
|
+
if relative_result:
|
|
45
|
+
return relative_result
|
|
14
46
|
|
|
47
|
+
# Handle absolute dates
|
|
15
48
|
dates = date_str.split(",")
|
|
16
49
|
start_date = datetime.strptime(dates[0], "%Y-%m-%d").date()
|
|
17
50
|
try:
|
|
@@ -41,8 +74,9 @@ def parse_arguments():
|
|
|
41
74
|
|
|
42
75
|
group = parser.add_argument_group(
|
|
43
76
|
"APIs",
|
|
44
|
-
"Specify date
|
|
45
|
-
"
|
|
77
|
+
"Specify a date, date range (YYYY-MM-DD[,YYYY-MM-DD]), or relative date.\n"
|
|
78
|
+
"Relative dates: yesterday, last-week, last-month, last-N-days/weeks/months (e.g., last-2-days).\n"
|
|
79
|
+
"If not provided, defaults to today's date.",
|
|
46
80
|
)
|
|
47
81
|
group.add_argument(
|
|
48
82
|
"-s",
|
|
@@ -50,7 +84,7 @@ def parse_arguments():
|
|
|
50
84
|
type=parse_date_range,
|
|
51
85
|
nargs="?",
|
|
52
86
|
const=(datetime.today().date(), None),
|
|
53
|
-
metavar="DATE[,DATE]",
|
|
87
|
+
metavar="DATE[,DATE]|RELATIVE",
|
|
54
88
|
help="Show sleep data",
|
|
55
89
|
)
|
|
56
90
|
group.add_argument(
|
|
@@ -59,7 +93,7 @@ def parse_arguments():
|
|
|
59
93
|
type=parse_date_range,
|
|
60
94
|
nargs="?",
|
|
61
95
|
const=(datetime.today().date(), None),
|
|
62
|
-
metavar="DATE[,DATE]",
|
|
96
|
+
metavar="DATE[,DATE]|RELATIVE",
|
|
63
97
|
help="Show SpO2 data",
|
|
64
98
|
)
|
|
65
99
|
group.add_argument(
|
|
@@ -68,7 +102,7 @@ def parse_arguments():
|
|
|
68
102
|
type=parse_date_range,
|
|
69
103
|
nargs="?",
|
|
70
104
|
const=(datetime.today().date(), None),
|
|
71
|
-
metavar="DATE[,DATE]",
|
|
105
|
+
metavar="DATE[,DATE]|RELATIVE",
|
|
72
106
|
help="Show Heart Rate Time Series data",
|
|
73
107
|
)
|
|
74
108
|
group.add_argument(
|
|
@@ -77,7 +111,7 @@ def parse_arguments():
|
|
|
77
111
|
type=parse_date_range,
|
|
78
112
|
nargs="?",
|
|
79
113
|
const=(datetime.today().date(), None),
|
|
80
|
-
metavar="DATE[,DATE]",
|
|
114
|
+
metavar="DATE[,DATE]|RELATIVE",
|
|
81
115
|
help="Show Active Zone Minutes (AZM) Time Series data",
|
|
82
116
|
)
|
|
83
117
|
group.add_argument(
|
|
@@ -86,7 +120,7 @@ def parse_arguments():
|
|
|
86
120
|
type=parse_date_range,
|
|
87
121
|
nargs="?",
|
|
88
122
|
const=(datetime.today().date(), None),
|
|
89
|
-
metavar="DATE[,DATE]",
|
|
123
|
+
metavar="DATE[,DATE]|RELATIVE",
|
|
90
124
|
help="Show Breathing Rate Summary data",
|
|
91
125
|
)
|
|
92
126
|
group.add_argument(
|
|
@@ -45,6 +45,7 @@ def display_sleep(sleep_data):
|
|
|
45
45
|
table.add_column("REM Sleep :crescent_moon:")
|
|
46
46
|
table.add_column("Wake Time :alarm_clock:")
|
|
47
47
|
table.add_column("Efficiency :100:")
|
|
48
|
+
table.add_column("Time in Bed :clock1:")
|
|
48
49
|
|
|
49
50
|
for sleep in sleep_data["sleep"]:
|
|
50
51
|
table.add_row(
|
|
@@ -54,6 +55,7 @@ def display_sleep(sleep_data):
|
|
|
54
55
|
f"{sleep['levels']['summary'].get('rem', {}).get('minutes', 'N/A')} min",
|
|
55
56
|
f"{sleep['levels']['summary'].get('wake', {}).get('minutes', 'N/A')} min",
|
|
56
57
|
f"{sleep['efficiency']}%",
|
|
58
|
+
f"{sleep['timeInBed'] / 60:.1f} hr",
|
|
57
59
|
)
|
|
58
60
|
|
|
59
61
|
CONSOLE.print(table)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: fitbit-cli
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.1
|
|
4
4
|
Summary: Access your Fitbit data at your terminal.
|
|
5
5
|
Home-page: https://github.com/veerendra2/fitbit-cli
|
|
6
|
-
Download-URL: https://github.com/veerendra2/fitbit-cli/archive/1.
|
|
6
|
+
Download-URL: https://github.com/veerendra2/fitbit-cli/archive/1.3.1.tar.gz
|
|
7
7
|
Author: veerendra2
|
|
8
8
|
Author-email: vk.tyk23@simplelogin.com
|
|
9
9
|
License: MIT
|
|
@@ -27,8 +27,22 @@ Classifier: Topic :: Utilities
|
|
|
27
27
|
Requires-Python: >=3.9
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
29
|
License-File: LICENSE
|
|
30
|
-
Requires-Dist: requests==2.32.
|
|
31
|
-
Requires-Dist: rich==
|
|
30
|
+
Requires-Dist: requests==2.32.4
|
|
31
|
+
Requires-Dist: rich==14.0.0
|
|
32
|
+
Dynamic: author
|
|
33
|
+
Dynamic: author-email
|
|
34
|
+
Dynamic: classifier
|
|
35
|
+
Dynamic: description
|
|
36
|
+
Dynamic: description-content-type
|
|
37
|
+
Dynamic: download-url
|
|
38
|
+
Dynamic: home-page
|
|
39
|
+
Dynamic: keywords
|
|
40
|
+
Dynamic: license
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
Dynamic: project-url
|
|
43
|
+
Dynamic: requires-dist
|
|
44
|
+
Dynamic: requires-python
|
|
45
|
+
Dynamic: summary
|
|
32
46
|
|
|
33
47
|
# Fitbit CLI
|
|
34
48
|
|
|
@@ -67,11 +81,12 @@ Access your Fitbit data directly from your terminal 💻. View 💤 sleep logs,
|
|
|
67
81
|
python -m pip install fitbit-cli
|
|
68
82
|
```
|
|
69
83
|
|
|
70
|
-
2. Help
|
|
84
|
+
2. See Help
|
|
71
85
|
|
|
72
86
|
```bash
|
|
73
87
|
fitbit-cli -h
|
|
74
|
-
usage: fitbit-cli [-h] [-i] [-s [DATE[,DATE]]] [-o [DATE[,DATE]]] [-e [DATE[,DATE]]] [-a [DATE[,DATE]]]
|
|
88
|
+
usage: fitbit-cli [-h] [-i] [-s [DATE[,DATE]|RELATIVE]] [-o [DATE[,DATE]|RELATIVE]] [-e [DATE[,DATE]|RELATIVE]] [-a [DATE[,DATE]|RELATIVE]]
|
|
89
|
+
[-b [DATE[,DATE]|RELATIVE]] [-u] [-v]
|
|
75
90
|
|
|
76
91
|
Fitbit CLI -- Access your Fitbit data at your terminal.
|
|
77
92
|
|
|
@@ -81,17 +96,20 @@ options:
|
|
|
81
96
|
-v, --version Show fitbit-cli version
|
|
82
97
|
|
|
83
98
|
APIs:
|
|
84
|
-
Specify date
|
|
85
|
-
|
|
99
|
+
Specify a date, date range (YYYY-MM-DD[,YYYY-MM-DD]), or relative date.
|
|
100
|
+
Relative dates: yesterday, last-week, last-month, last-N-days/weeks/months (e.g., last-2-days).
|
|
101
|
+
If not provided, defaults to today's date.
|
|
86
102
|
|
|
87
|
-
-s, --sleep [DATE[,DATE]]
|
|
103
|
+
-s, --sleep [DATE[,DATE]|RELATIVE]
|
|
88
104
|
Show sleep data
|
|
89
|
-
-o, --spo2 [DATE[,DATE]]
|
|
105
|
+
-o, --spo2 [DATE[,DATE]|RELATIVE]
|
|
90
106
|
Show SpO2 data
|
|
91
|
-
-e, --heart [DATE[,DATE]]
|
|
107
|
+
-e, --heart [DATE[,DATE]|RELATIVE]
|
|
92
108
|
Show Heart Rate Time Series data
|
|
93
|
-
-a, --active-zone [DATE[,DATE]]
|
|
109
|
+
-a, --active-zone [DATE[,DATE]|RELATIVE]
|
|
94
110
|
Show Active Zone Minutes (AZM) Time Series data
|
|
111
|
+
-b, --breathing-rate [DATE[,DATE]|RELATIVE]
|
|
112
|
+
Show Breathing Rate Summary data
|
|
95
113
|
-u, --show-user-profile
|
|
96
114
|
Show user profile data
|
|
97
115
|
```
|
|
@@ -112,19 +130,18 @@ APIs:
|
|
|
112
130
|
fitbit-cli --init-auth
|
|
113
131
|
```
|
|
114
132
|
|
|
115
|
-
For a visual guide, see the Asciinema recording below
|
|
116
133
|
[](https://asciinema.org/a/696115)
|
|
117
134
|
|
|
118
135
|
5. Start using it 😎
|
|
119
136
|
|
|
120
137
|
```bash
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
┃ Date 📆 ┃ Deep Sleep 🛏 ┃ Light Sleep 💤 ┃ REM Sleep 🌙 ┃ Wake Time ⏰ ┃ Efficiency 💯 ┃
|
|
125
|
-
|
|
126
|
-
│
|
|
127
|
-
|
|
138
|
+
fitbit-cli -s
|
|
139
|
+
Sleep Data Summary 😴
|
|
140
|
+
┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┓
|
|
141
|
+
┃ Date 📆 ┃ Deep Sleep 🛏 ┃ Light Sleep 💤 ┃ REM Sleep 🌙 ┃ Wake Time ⏰ ┃ Efficiency 💯 ┃ Time in Bed 🕐 ┃
|
|
142
|
+
┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━┩
|
|
143
|
+
│ 2025-05-03 │ 129 min │ 271 min │ 140 min │ 66 min │ 57% │ 10.1 hr │
|
|
144
|
+
└────────────┴──────────────┴────────────────┴──────────────┴──────────────┴───────────────┴────────────────┘
|
|
128
145
|
```
|
|
129
146
|
|
|
130
147
|
_**NOTE: The token is valid for only 8 hours, `fitbit-cli` automatically refreshes the token when it expires.**_
|
|
@@ -141,4 +158,6 @@ cd fitbit-cli
|
|
|
141
158
|
python -m venv venv
|
|
142
159
|
source venv/bin/activate
|
|
143
160
|
python -m pip install -e .
|
|
161
|
+
|
|
162
|
+
deactivate
|
|
144
163
|
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|