Skip to content

Commit 493ef13

Browse files
committed
Switch back to explicit arguments for get_dataframes()
1 parent 06151ab commit 493ef13

File tree

7 files changed

+45
-8
lines changed

7 files changed

+45
-8
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,13 @@ def main() -> None:
146146
cli_args = ica.get_cli_parser().parse_args()
147147
# Retrieve the dataframes corresponding to the massaged contents of the
148148
# database; dataframes include `message` and `attachment`
149-
dfs = ica.get_dataframes(**vars(cli_args))
149+
dfs = ica.get_dataframes(
150+
contact_name=cli_args.contact_name,
151+
timezone=cli_args.timezone,
152+
from_date=cli_args.from_date,
153+
to_date=cli_args.to_date,
154+
from_person=cli_args.from_person,
155+
)
150156
# Send the results to stdout (or to file) in the given format
151157
ica.output_results(
152158
pd.DataFrame(

ica/analyzers/attachment_totals.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,14 @@ def main() -> None:
1818
shared, YouTube videos, Apple Music, etc.
1919
"""
2020
cli_args = ica.get_cli_parser().parse_args()
21-
dfs = ica.get_dataframes(**vars(cli_args))
21+
dfs = ica.get_dataframes(
22+
contact_name=cli_args.contact_name,
23+
timezone=cli_args.timezone,
24+
from_date=cli_args.from_date,
25+
to_date=cli_args.to_date,
26+
from_person=cli_args.from_person,
27+
)
28+
2229
is_reaction = dfs.messages["is_reaction"]
2330
totals_map = {
2431
"gifs": dfs.attachments["mime_type"].eq("image/gif").sum(),

ica/analyzers/message_totals.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,13 @@ def main() -> None:
8181
as well as other insightful metrics
8282
"""
8383
cli_args = ica.get_cli_parser().parse_args()
84-
dfs = ica.get_dataframes(**vars(cli_args))
84+
dfs = ica.get_dataframes(
85+
contact_name=cli_args.contact_name,
86+
timezone=cli_args.timezone,
87+
from_date=cli_args.from_date,
88+
to_date=cli_args.to_date,
89+
from_person=cli_args.from_person,
90+
)
8591

8692
all_datestrs = get_dates_between(
8793
get_first_message_date(dfs), str(datetime.date.today())

ica/analyzers/most_frequent_emojis.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@ def main() -> None:
2929
entire conversation
3030
"""
3131
cli_args = ica.get_cli_parser().parse_args()
32-
dfs = ica.get_dataframes(**vars(cli_args))
32+
dfs = ica.get_dataframes(
33+
contact_name=cli_args.contact_name,
34+
timezone=cli_args.timezone,
35+
from_date=cli_args.from_date,
36+
to_date=cli_args.to_date,
37+
from_person=cli_args.from_person,
38+
)
39+
3340
emojis = get_emoji_list()
3441
text = dfs.messages[dfs.messages["is_reaction"].eq(False)].get("text")
3542
emoji_patt = re.compile(

ica/analyzers/totals_by_day.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ def main() -> None:
1414
the other person have been messaging in the conversation
1515
"""
1616
cli_args = ica.get_cli_parser().parse_args()
17-
dfs = ica.get_dataframes(**vars(cli_args))
17+
dfs = ica.get_dataframes(
18+
contact_name=cli_args.contact_name,
19+
timezone=cli_args.timezone,
20+
from_date=cli_args.from_date,
21+
to_date=cli_args.to_date,
22+
from_person=cli_args.from_person,
23+
)
1824
ica.output_results(
1925
(
2026
dfs.messages[["text", "is_from_me", "datetime", "is_reaction"]]

ica/analyzers/transcript.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ def main() -> None:
1818
reactions, between you and the other person (attachment files not included)
1919
"""
2020
cli_args = ica.get_cli_parser().parse_args()
21-
dfs = ica.get_dataframes(**vars(cli_args))
21+
dfs = ica.get_dataframes(
22+
contact_name=cli_args.contact_name,
23+
timezone=cli_args.timezone,
24+
from_date=cli_args.from_date,
25+
to_date=cli_args.to_date,
26+
from_person=cli_args.from_person,
27+
)
2228
ica.output_results(
2329
pd.DataFrame(
2430
{

ica/core.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from dataclasses import dataclass
1111
from io import BytesIO, StringIO
1212
from pathlib import Path
13-
from typing import Any, Callable, Union
13+
from typing import Callable, Union
1414

1515
import pandas as pd
1616
import tzlocal
@@ -239,7 +239,6 @@ def get_dataframes(
239239
from_date: Union[str, None] = None,
240240
to_date: Union[str, None] = None,
241241
from_person: Union[str, None] = None,
242-
**kwargs: Any,
243242
) -> DataFrameNamespace:
244243
"""
245244
Return all dataframes for a specific macOS Messages conversation

0 commit comments

Comments
 (0)