Skip to content

Commit

Permalink
main: rename package to Carte
Browse files Browse the repository at this point in the history
  • Loading branch information
balinthaller committed Feb 9, 2021
1 parent e9e47db commit 50bc014
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 36 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
File renamed without changes.
4 changes: 2 additions & 2 deletions flyover/__main__.py → carte/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

__version__ = '0.1.7'
__version__ = '0.1.8'

requirements = [
"boto3>=1.16.25",
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions tests/extractor/test_glue_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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({})
Expand Down
12 changes: 6 additions & 6 deletions tests/loader/test_carte_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tests/model/test_carte_table_model.py
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
12 changes: 6 additions & 6 deletions tests/utils/test_frontmatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand All @@ -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"]

Expand All @@ -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"]

Expand All @@ -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")

Expand Down

0 comments on commit 50bc014

Please sign in to comment.