This commit is contained in:
parent
a674eabf89
commit
bf0f556278
2 changed files with 4 additions and 5 deletions
|
@ -1,6 +1,5 @@
|
||||||
"""This module contains the RestAdapter class, which is used to make requests to the Zipline server."""""
|
"""This module contains the RestAdapter class, which is used to make requests to the Zipline server."""""
|
||||||
import logging
|
import logging
|
||||||
from typing import Dict
|
|
||||||
from json import JSONDecodeError
|
from json import JSONDecodeError
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"""This is a list of various utility functions used in PyZipline."""
|
"""This is a list of various utility functions used in PyZipline."""
|
||||||
from datetime import datetime
|
from datetime import datetime as dtime
|
||||||
|
|
||||||
def convert_str_to_datetime(date_string: str) -> datetime:
|
def convert_str_to_datetime(date_string: str) -> dtime:
|
||||||
"""Converts a Zipline date string to a datetime object
|
"""Converts a Zipline date string to a datetime object
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
@ -10,9 +10,9 @@ def convert_str_to_datetime(date_string: str) -> datetime:
|
||||||
Returns:
|
Returns:
|
||||||
datetime: Datetime object
|
datetime: Datetime object
|
||||||
"""
|
"""
|
||||||
return datetime.strptime(date_string, '%Y-%m-%dT%H:%M:%S.%fZ')
|
return dtime.strptime(date_string, '%Y-%m-%dT%H:%M:%S.%fZ')
|
||||||
|
|
||||||
def convert_datetime_to_str(datetime: datetime) -> str:
|
def convert_datetime_to_str(datetime: dtime) -> str:
|
||||||
"""Converts a datetime object to a Zipline (`ISO 8601`) date string
|
"""Converts a datetime object to a Zipline (`ISO 8601`) date string
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
|
Loading…
Reference in a new issue