diff --git a/gcf_data_mapper/cli.py b/gcf_data_mapper/cli.py index 15b2609..7b6fcfc 100644 --- a/gcf_data_mapper/cli.py +++ b/gcf_data_mapper/cli.py @@ -4,6 +4,7 @@ import click from gcf_data_mapper.parsers.collection import collection +from gcf_data_mapper.parsers.document import document from gcf_data_mapper.parsers.family import family @@ -45,7 +46,7 @@ def wrangle_to_json(debug) -> dict[str, list[Optional[dict[str, Any]]]]: return { "collections": collection(debug), "families": family(debug), - "documents": [], + "documents": document(debug), "events": [], } diff --git a/gcf_data_mapper/parsers/document.py b/gcf_data_mapper/parsers/document.py new file mode 100644 index 0000000..2d7c6e4 --- /dev/null +++ b/gcf_data_mapper/parsers/document.py @@ -0,0 +1,17 @@ +from typing import Any, Optional + +import click + + +def document(debug: bool) -> list[Optional[dict[str, Any]]]: + """Map the GCF document info to new structure. + + :param bool debug: Whether debug mode is on. + :return list[Optional[dict[str, Any]]]: A list of GCF families in + the 'destination' format described in the GCF Data Mapper Google + Sheet. + """ + if debug: + click.echo("📝 Wrangling GCF document data.") + + return [] diff --git a/pyproject.toml b/pyproject.toml index 5a56a7b..da31e58 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "gcf-data-mapper" -version = "0.1.3" +version = "0.1.4" description = "A CLI tool to wrangle GCF data into format recognised by the bulk-import tool." authors = ["CPR-dev-team "] license = "Apache-2.0" diff --git a/tests/unit_tests/parsers/document/test_document.py b/tests/unit_tests/parsers/document/test_document.py new file mode 100644 index 0000000..27223c7 --- /dev/null +++ b/tests/unit_tests/parsers/document/test_document.py @@ -0,0 +1,9 @@ +import pytest + +from gcf_data_mapper.parsers.document import document + + +@pytest.mark.parametrize("debug", [True, False]) +def test_returns_empty(debug: bool): + document_data = document(debug) + assert document_data == []