diff --git a/README.md b/README.md index 25c39d5..37c55b8 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,19 @@ -# Carte Flyover -[![PyPI version](https://badge.fury.io/py/flyover.svg)](https://badge.fury.io/py/flyover) +# Carte +[![PyPI version](https://badge.fury.io/py/carte.svg)](https://badge.fury.io/py/carte) [![License](http://img.shields.io/:license-Apache%202-blue.svg)](LICENSE) -[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/flyover.svg)](https://pypi.org/project/flyover/) +[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/carte.svg)](https://pypi.org/project/carte/) -Flyover is a Python library for extracting metadata from your data sources and generating structured Markdown files from it. It's a companion library to Carte, a lightweight data catalog for fast moving data teams. Flyover currently supports the AWS Glue catalog but more sources are coming. +Carte is a Python library for extracting metadata from your data sources and generating structured Markdown files from it. It's a companion library to the Carte front end, a lightweight data catalog for fast moving data teams. Carte currently supports the AWS Glue catalog and PostgreSQL but more sources are coming. -The files generated by Flyover can be fed into Carte as-is to get a statically generated data catalog. +The files generated by Carte can be fed into the front end as-is to get a statically generated data catalog. ## Installation ``` sh -pip install flyover +pip install carte ``` ## Usage -Flyover uses the Boto3 library to fetch the Glue catalog. This means you need an AWS CLI profile defined that can access the required databases and tables. +Carte uses the Boto3 library to fetch the Glue catalog. This means you need an AWS CLI profile defined that can access the required databases and tables. diff --git a/flyover/__init__.py b/carte/__init__.py similarity index 100% rename from flyover/__init__.py rename to carte/__init__.py diff --git a/flyover/__main__.py b/carte/__main__.py similarity index 92% rename from flyover/__main__.py rename to carte/__main__.py index 03e145f..6fa5735 100644 --- a/flyover/__main__.py +++ b/carte/__main__.py @@ -8,9 +8,9 @@ from databuilder.transformer.base_transformer import NoopTransformer from pyhocon import ConfigFactory -from flyover.loader.carte_loader import CarteLoader +from carte.loader.carte_loader import CarteLoader -from flyover.utils.config_parser import parse_config +from carte.utils.config_parser import parse_config parser = argparse.ArgumentParser(description="Run metadata extraction for Carte") parser.add_argument( diff --git a/flyover/extractor/__init__.py b/carte/extractor/__init__.py similarity index 100% rename from flyover/extractor/__init__.py rename to carte/extractor/__init__.py diff --git a/flyover/extractor/glue_extractor.py b/carte/extractor/glue_extractor.py similarity index 96% rename from flyover/extractor/glue_extractor.py rename to carte/extractor/glue_extractor.py index 2235948..9ff9d96 100644 --- a/flyover/extractor/glue_extractor.py +++ b/carte/extractor/glue_extractor.py @@ -4,7 +4,7 @@ from pyhocon import ConfigTree from typing import Iterator, Union, Dict, Any, List from databuilder.extractor.base_extractor import Extractor -from flyover.model.carte_table_model import TableMetadata, ColumnMetadata, TableType +from carte.model.carte_table_model import TableMetadata, ColumnMetadata, TableType class GlueExtractor(Extractor): diff --git a/flyover/loader/__init__.py b/carte/loader/__init__.py similarity index 100% rename from flyover/loader/__init__.py rename to carte/loader/__init__.py diff --git a/flyover/loader/carte_loader.py b/carte/loader/carte_loader.py similarity index 93% rename from flyover/loader/carte_loader.py rename to carte/loader/carte_loader.py index a3ae6ca..d08b95c 100644 --- a/flyover/loader/carte_loader.py +++ b/carte/loader/carte_loader.py @@ -8,9 +8,9 @@ from pyhocon import ConfigTree -from flyover.model.job_metadata import JobMetadata -from flyover.model.carte_table_model import TableMetadata -import flyover.utils.frontmatter as frontmatter +from carte.model.job_metadata import JobMetadata +from carte.model.carte_table_model import TableMetadata +import carte.utils.frontmatter as frontmatter TABLES_OUTPUT_PATH = "content/tables" JOBS_OUTPUT_PATH = "content/jobs" diff --git a/flyover/model/__init__.py b/carte/model/__init__.py similarity index 100% rename from flyover/model/__init__.py rename to carte/model/__init__.py diff --git a/flyover/model/carte_table_model.py b/carte/model/carte_table_model.py similarity index 100% rename from flyover/model/carte_table_model.py rename to carte/model/carte_table_model.py diff --git a/flyover/model/job_metadata.py b/carte/model/job_metadata.py similarity index 100% rename from flyover/model/job_metadata.py rename to carte/model/job_metadata.py diff --git a/flyover/utils/__init__.py b/carte/utils/__init__.py similarity index 100% rename from flyover/utils/__init__.py rename to carte/utils/__init__.py diff --git a/flyover/utils/config_parser.py b/carte/utils/config_parser.py similarity index 97% rename from flyover/utils/config_parser.py rename to carte/utils/config_parser.py index 96b2a93..368b6be 100644 --- a/flyover/utils/config_parser.py +++ b/carte/utils/config_parser.py @@ -1,6 +1,6 @@ import io from ruamel.yaml import YAML -from flyover.extractor.glue_extractor import GlueExtractor +from carte.extractor.glue_extractor import GlueExtractor from databuilder.extractor.postgres_metadata_extractor import PostgresMetadataExtractor yaml = YAML() diff --git a/flyover/utils/frontmatter.py b/carte/utils/frontmatter.py similarity index 100% rename from flyover/utils/frontmatter.py rename to carte/utils/frontmatter.py diff --git a/setup.py b/setup.py index 37907e6..a031344 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -__version__ = '0.1.7' +__version__ = '0.1.8' requirements = [ "boto3>=1.16.25", @@ -10,16 +10,16 @@ ] setup( - name='flyover', + name='carte', version=__version__, - description='Carte Flyover – extract metadata from data storage into files', - url='https://github.com/CarteData/carte-flyover', + description='Carte – extract metadata from data storage into files', + url='https://github.com/carte-data/carte', maintainer='Balint Haller', - maintainer_email='balint@haller.io', + maintainer_email='balint@hey.com', packages=find_packages(exclude=['tests*']), entry_points=''' [console_scripts] - flyover=flyover.__main__:main + carte=carte.__main__:main ''', dependency_links=[], install_requires=requirements, diff --git a/tests/extractor/test_glue_extractor.py b/tests/extractor/test_glue_extractor.py index e6e4dfe..c2f3e20 100644 --- a/tests/extractor/test_glue_extractor.py +++ b/tests/extractor/test_glue_extractor.py @@ -3,11 +3,11 @@ from unittest.mock import patch from pyhocon import ConfigFactory -from flyover.extractor.glue_extractor import GlueExtractor -from flyover.model.carte_table_model import TableMetadata, ColumnMetadata, TableType +from carte.extractor.glue_extractor import GlueExtractor +from carte.model.carte_table_model import TableMetadata, ColumnMetadata, TableType -@patch("flyover.extractor.glue_extractor.boto3.client", lambda x: None) +@patch("carte.extractor.glue_extractor.boto3.client", lambda x: None) class TestGlueExtractor(unittest.TestCase): def setUp(self) -> None: self.conf = ConfigFactory.from_dict({}) diff --git a/tests/loader/test_carte_loader.py b/tests/loader/test_carte_loader.py index 8b7dd5f..b1081d6 100644 --- a/tests/loader/test_carte_loader.py +++ b/tests/loader/test_carte_loader.py @@ -6,8 +6,8 @@ from pyhocon import ConfigFactory from typing import Dict, Iterable, Any, Callable # noqa: F401 -from flyover.loader.carte_loader import CarteLoader -from flyover.model.carte_table_model import TableMetadata, ColumnMetadata, TableType +from carte.loader.carte_loader import CarteLoader +from carte.model.carte_table_model import TableMetadata, ColumnMetadata, TableType @pytest.fixture @@ -17,8 +17,8 @@ def patched_config(): ) -@patch("flyover.loader.carte_loader.frontmatter") -@patch("flyover.loader.carte_loader.os") +@patch("carte.loader.carte_loader.frontmatter") +@patch("carte.loader.carte_loader.os") def test_load_carte_metadata(mock_os, mock_frontmatter, patched_config): test_record = TableMetadata( name="test_name", @@ -48,8 +48,8 @@ def test_load_carte_metadata(mock_os, mock_frontmatter, patched_config): ) -@patch("flyover.loader.carte_loader.frontmatter") -@patch("flyover.loader.carte_loader.os") +@patch("carte.loader.carte_loader.frontmatter") +@patch("carte.loader.carte_loader.os") def test_load_carte_metadata_with_merge(mock_os, mock_frontmatter, patched_config): test_record = TableMetadata( name="test_name", diff --git a/tests/model/test_carte_table_model.py b/tests/model/test_carte_table_model.py index 34f9a86..eed7b2a 100644 --- a/tests/model/test_carte_table_model.py +++ b/tests/model/test_carte_table_model.py @@ -1,7 +1,7 @@ import unittest from unittest.mock import patch -from flyover.model.carte_table_model import TableMetadata, ColumnMetadata, TableType +from carte.model.carte_table_model import TableMetadata, ColumnMetadata, TableType from databuilder.models.table_metadata import ColumnMetadata as DatabuilderColumn from databuilder.models.table_metadata import ( DescriptionMetadata as DatabuilderDescription, diff --git a/tests/utils/test_frontmatter.py b/tests/utils/test_frontmatter.py index bfb1bc1..14efcd1 100644 --- a/tests/utils/test_frontmatter.py +++ b/tests/utils/test_frontmatter.py @@ -3,10 +3,10 @@ from unittest.mock import patch, mock_open import pytest -import flyover.utils.frontmatter as frontmatter +import carte.utils.frontmatter as frontmatter -@patch("flyover.utils.frontmatter._read_file", autospec=True) +@patch("carte.utils.frontmatter._read_file", autospec=True) class TestFrontmatter(unittest.TestCase): def test_parse_empty_file(self, mock_read_file): mock_read_file.return_value = [] @@ -16,7 +16,7 @@ def test_parse_empty_file(self, mock_read_file): assert metadata == {} assert content == "" - @patch("flyover.utils.frontmatter.yaml") + @patch("carte.utils.frontmatter.yaml") def test_read_only_yaml(self, mock_yaml, mock_read_file): mock_read_file.return_value = ["mock-yaml"] @@ -31,7 +31,7 @@ def test_read_only_yaml(self, mock_yaml, mock_read_file): assert metadata == mock_metadata assert content == "" - @patch("flyover.utils.frontmatter.yaml") + @patch("carte.utils.frontmatter.yaml") def test_read_with_content(self, mock_yaml, mock_read_file): mock_read_file.return_value = ["mock-yaml", "mock-content"] @@ -46,10 +46,10 @@ def test_read_with_content(self, mock_yaml, mock_read_file): assert metadata == mock_metadata assert content == "mock-content" - @patch("flyover.utils.frontmatter.print") + @patch("carte.utils.frontmatter.print") def test_write_prints_correct_content(self, mock_print, mock_read_file): m = mock_open() - with patch("flyover.utils.frontmatter.open", m): + with patch("carte.utils.frontmatter.open", m): frontmatter.dump("test-file", {"mock-metadata": "meta"}, "mock-content")