Skip to content

Commit

Permalink
remove unnecessary methods from twitter provider
Browse files Browse the repository at this point in the history
  • Loading branch information
karlicoss committed Apr 20, 2020
1 parent bfe3165 commit 96a850f
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions my/twitter/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
See https://help.twitter.com/en/managing-your-account/how-to-download-your-twitter-archive
"""
from datetime import date, datetime
from datetime import datetime
from typing import Union, List, Dict, Set, Optional, Iterator, Any, NamedTuple
from pathlib import Path
from functools import lru_cache
Expand Down Expand Up @@ -155,24 +155,6 @@ def likes() -> List[Like]:
return list(ZipExport().likes())


def predicate(p) -> List[Tweet]:
return [t for t in tweets() if p(t)]


def predicate_date(p) -> List[Tweet]: # TODO rename to by_date?
return predicate(lambda t: p(t.dt.date()))

# TODO move these to private tests?
Datish = Union[date, str]
def tweets_on(*dts: Datish) -> List[Tweet]:
from kython import parse_date_new
# TODO how to make sure we don't miss on 29 feb?
dates = {parse_date_new(d) for d in dts}
return predicate_date(lambda d: d in dates)

on = tweets_on


def test_tweet():
raw = """
{
Expand Down

0 comments on commit 96a850f

Please sign in to comment.