Skip to content

Commit

Permalink
Feature/pdct 1399 Add skeleton for GCF document mapping (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
katybaulch authored Aug 27, 2024
2 parents fce28ca + d29f550 commit 9d298d2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
3 changes: 2 additions & 1 deletion gcf_data_mapper/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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": [],
}

Expand Down
17 changes: 17 additions & 0 deletions gcf_data_mapper/parsers/document.py
Original file line number Diff line number Diff line change
@@ -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 []
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
license = "Apache-2.0"
Expand Down
9 changes: 9 additions & 0 deletions tests/unit_tests/parsers/document/test_document.py
Original file line number Diff line number Diff line change
@@ -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 == []

0 comments on commit 9d298d2

Please sign in to comment.