PyHodl  0.2.8
Framework to download, update, analyze and plot your crypto-transactions. Completely off-line and security-oriented.
pyhodl.utils.dates Namespace Reference

Functions

def generate_dates (since, until, hours)
 
def datetime_to_unix_timestamp_ms (date_time)
 
def datetime_to_unix_timestamp_s (date_time)
 
def unix_timestamp_ms_to_datetime (milliseconds)
 
def unix_timestamp_s_to_datetime (seconds)
 
def parse_datetime (raw)
 
def datetime_to_str (date_time)
 
def localize (date_time)
 
def get_delta_seconds (first, second)
 
def get_delta_hours (first, second)
 
def dates_to_floats (lst)
 
def floats_to_dates (lst)
 
def parse_timedelta (raw)
 

Function Documentation

def pyhodl.utils.dates.dates_to_floats (   lst)
:param lst: [] of datetime
    List of dates
:return: [] of float
    List of floats (seconds since epoch)
def pyhodl.utils.dates.datetime_to_str (   date_time)
:param date_time: datetime
    Date and time
:return: str
    String representation
def pyhodl.utils.dates.datetime_to_unix_timestamp_ms (   date_time)
:param date_time: datetime
    Date and time
:return: int
    Unix timestamp (milliseconds)
def pyhodl.utils.dates.datetime_to_unix_timestamp_s (   date_time)
:param date_time: datetime
    Date and time
:return: int
    Unix timestamp (seconds)
def pyhodl.utils.dates.floats_to_dates (   lst)
:param lst: [] of float
    List of floats (seconds since epoch)
:return: [] of datetime
    List of dates
def pyhodl.utils.dates.generate_dates (   since,
  until,
  hours 
)
:param since: datetime
    Generate dates since this date
:param until: datetime
    Generate dates until this date
:param hours: float
    Number of hours between 2 consecutive dates
:return: generator of datetime
    Dates in between boundaries and separated by exact interval
def pyhodl.utils.dates.get_delta_hours (   first,
  second 
)
:param first: datetime
    Date and time
:param second: datetime
    Date and time to subtract to first
:return: int
    Total difference in hours
def pyhodl.utils.dates.get_delta_seconds (   first,
  second 
)
:param first: datetime
    Date and time
:param second: datetime
    Date and time to subtract to first
:return: int
    Total difference in seconds
def pyhodl.utils.dates.localize (   date_time)
:param date_time: datetime
    Date and time
:return: datetime
    UTC-localized date and time (if NOT localized), else original
def pyhodl.utils.dates.parse_datetime (   raw)
:param raw: str
    Raw date and time
:return: datetime
    Datetime
def pyhodl.utils.dates.parse_timedelta (   raw)
:param raw: str
    Time interval written in short format
:return: timedelta
    Time delta
def pyhodl.utils.dates.unix_timestamp_ms_to_datetime (   milliseconds)
:param milliseconds: int
    Unix timestamp (milliseconds)
:return: datetime
    Date and time (UTC)
def pyhodl.utils.dates.unix_timestamp_s_to_datetime (   seconds)
:param seconds: int
    Unix timestamp (seconds)
:return: datetime
    Date and time (UTC)