diff options
Diffstat (limited to 'datamaps/api')
-rw-r--r-- | datamaps/api/__init__.py | 5 | ||||
-rw-r--r-- | datamaps/api/api.py | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/datamaps/api/__init__.py b/datamaps/api/__init__.py new file mode 100644 index 0000000..bb48fdb --- /dev/null +++ b/datamaps/api/__init__.py @@ -0,0 +1,5 @@ +from .api import project_data_from_master_api as project_data_from_master +from ..core.master import Master as Master +from ..core.row import Row as Row +from ..core.temporal import FinancialYear as FinancialYear +from ..core.temporal import Quarter as Quarter diff --git a/datamaps/api/api.py b/datamaps/api/api.py new file mode 100644 index 0000000..59458e7 --- /dev/null +++ b/datamaps/api/api.py @@ -0,0 +1,14 @@ +from ..core import Master, Quarter + + +def project_data_from_master_api(master_file: str, quarter: int, year: int): + """Create a Master object directly without the need to explicitly pass + a Quarter object. + + Args: + master_file (str): the path to a master file + quarter (int): an integer representing the financial quarter + year (int): an integer representing the year + """ + m = Master(Quarter(quarter, year), master_file) + return m |