Skip to content

Commit 81d7894

Browse files
authored
Chore: rename 'airbyte-lib' and 'airbyte_lib' to 'PyAirbyte' or 'airbyte' (#40)
1 parent 39eabc7 commit 81d7894

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+401
-397
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Virtual Environments
2+
.venv
3+
.venv-*
4+
15
# Byte-compiled / optimized / DLL files
26
__pycache__/
37
*.py[cod]

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# airbyte-lib
1+
# PyAirbyte
22

3-
airbyte-lib is a library that allows to run Airbyte syncs embedded into any Python application, without the need to run Airbyte server.
3+
PyAirbyte is a library that allows to run Airbyte syncs embedded into any Python application, without the need to run Airbyte server.
44

55
## Development
66

@@ -25,12 +25,12 @@ AirbyteLib can auto-import secrets from the following sources:
2525
3. [Google Colab secrets](https://medium.com/@parthdasawant/how-to-use-secrets-in-google-colab-450c38e3ec75).
2626
4. Manual entry via [`getpass`](https://docs.python.org/3.9/library/getpass.html).
2727

28-
_Note: Additional secret store options may be supported in the future. [More info here.](https://github.com/airbytehq/airbyte-lib-private-beta/discussions/5)_
28+
_Note: Additional secret store options may be supported in the future. [More info here.](https://github.com/airbytehq/PyAirbyte-private-beta/discussions/5)_
2929

3030
### Retrieving Secrets
3131

3232
```python
33-
from airbyte_lib import get_secret, SecretSource
33+
from airbyte import get_secret, SecretSource
3434

3535
source = get_connection("source-github")
3636
source.set_config(
@@ -56,7 +56,7 @@ A unit test validates the documentation is up to date.
5656

5757
## Connector compatibility
5858

59-
To make a connector compatible with airbyte-lib, the following requirements must be met:
59+
To make a connector compatible with PyAirbyte, the following requirements must be met:
6060
* The connector must be a Python package, with a `pyproject.toml` or a `setup.py` file.
6161
* In the package, there must be a `run.py` file that contains a `run` method. This method should read arguments from the command line, and run the connector with them, outputting messages to stdout.
6262
* The `pyproject.toml` or `setup.py` file must specify a command line entry point for the `run` method called `source-<connector name>`. This is usually done by adding a `console_scripts` section to the `pyproject.toml` file, or a `entry_points` section to the `setup.py` file. For example:

airbyte/__init__.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"""AirbyteLib brings Airbyte ELT to every Python developer."""
2+
from __future__ import annotations
3+
4+
from airbyte._factories.cache_factories import get_default_cache, new_local_cache
5+
from airbyte._factories.connector_factories import get_source
6+
from airbyte.caches import DuckDBCache, DuckDBCacheConfig
7+
from airbyte.datasets import CachedDataset
8+
from airbyte.registry import get_available_connectors
9+
from airbyte.results import ReadResult
10+
from airbyte.secrets import SecretSource, get_secret
11+
from airbyte.source import Source
12+
13+
14+
__all__ = [
15+
"CachedDataset",
16+
"DuckDBCache",
17+
"DuckDBCacheConfig",
18+
"get_available_connectors",
19+
"get_source",
20+
"get_default_cache",
21+
"get_secret",
22+
"new_local_cache",
23+
"ReadResult",
24+
"SecretSource",
25+
"Source",
26+
]

airbyte_lib/_executor.py airbyte/_executor.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
from rich import print
1414

15-
from airbyte_lib import exceptions as exc
16-
from airbyte_lib.registry import ConnectorMetadata
17-
from airbyte_lib.telemetry import SourceTelemetryInfo, SourceType
15+
from airbyte import exceptions as exc
16+
from airbyte.registry import ConnectorMetadata
17+
from airbyte.telemetry import SourceTelemetryInfo, SourceType
1818

1919

2020
if TYPE_CHECKING:
@@ -435,13 +435,13 @@ def ensure_installation(
435435

436436
def install(self) -> NoReturn:
437437
raise exc.AirbyteConnectorInstallationError(
438-
message="Connector cannot be installed because it is not managed by airbyte-lib.",
438+
message="Connector cannot be installed because it is not managed by PyAirbyte.",
439439
connector_name=self.name,
440440
)
441441

442442
def uninstall(self) -> NoReturn:
443443
raise exc.AirbyteConnectorInstallationError(
444-
message="Connector cannot be uninstalled because it is not managed by airbyte-lib.",
444+
message="Connector cannot be uninstalled because it is not managed by PyAirbyte.",
445445
connector_name=self.name,
446446
)
447447

File renamed without changes.

airbyte_lib/_factories/cache_factories.py airbyte/_factories/cache_factories.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
import ulid
77

8-
from airbyte_lib import exceptions as exc
9-
from airbyte_lib.caches.duckdb import DuckDBCache, DuckDBCacheConfig
8+
from airbyte import exceptions as exc
9+
from airbyte.caches.duckdb import DuckDBCache, DuckDBCacheConfig
1010

1111

1212
def get_default_cache() -> DuckDBCache:

airbyte_lib/_factories/connector_factories.py airbyte/_factories/connector_factories.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
from pathlib import Path
77
from typing import Any
88

9-
from airbyte_lib import exceptions as exc
10-
from airbyte_lib._executor import PathExecutor, VenvExecutor
11-
from airbyte_lib.registry import ConnectorMetadata, get_connector_metadata
12-
from airbyte_lib.source import Source
9+
from airbyte import exceptions as exc
10+
from airbyte._executor import PathExecutor, VenvExecutor
11+
from airbyte.registry import ConnectorMetadata, get_connector_metadata
12+
from airbyte.source import Source
1313

1414

1515
def get_connector(
File renamed without changes.

airbyte_lib/_file_writers/base.py airbyte/_file_writers/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
from overrides import overrides
1313

14-
from airbyte_lib._processors import BatchHandle, RecordProcessor
15-
from airbyte_lib.config import CacheConfigBase
14+
from airbyte._processors import BatchHandle, RecordProcessor
15+
from airbyte.config import CacheConfigBase
1616

1717

1818
if TYPE_CHECKING:

airbyte_lib/_file_writers/parquet.py airbyte/_file_writers/parquet.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
from overrides import overrides
1212
from pyarrow import parquet
1313

14-
from airbyte_lib import exceptions as exc
15-
from airbyte_lib._file_writers.base import (
14+
from airbyte import exceptions as exc
15+
from airbyte._file_writers.base import (
1616
FileWriterBase,
1717
FileWriterBatchHandle,
1818
FileWriterConfigBase,
1919
)
20-
from airbyte_lib._util.text_util import lower_case_set
20+
from airbyte._util.text_util import lower_case_set
2121

2222

2323
class ParquetWriterConfig(FileWriterConfigBase):

airbyte_lib/_processors.py airbyte/_processors.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@
3131
Type,
3232
)
3333

34-
from airbyte_lib import exceptions as exc
35-
from airbyte_lib._util import protocol_util
36-
from airbyte_lib.progress import progress
37-
from airbyte_lib.strategies import WriteStrategy
34+
from airbyte import exceptions as exc
35+
from airbyte._util import protocol_util
36+
from airbyte.progress import progress
37+
from airbyte.strategies import WriteStrategy
3838

3939

4040
if TYPE_CHECKING:
4141
from collections.abc import Generator, Iterable, Iterator
4242

43-
from airbyte_lib.caches._catalog_manager import CatalogManager
44-
from airbyte_lib.config import CacheConfigBase
43+
from airbyte.caches._catalog_manager import CatalogManager
44+
from airbyte.config import CacheConfigBase
4545

4646

4747
DEFAULT_BATCH_SIZE = 10_000

airbyte_lib/_util/__init__.py airbyte/_util/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"""
77
from __future__ import annotations
88

9-
from airbyte_lib._util.pip_util import connector_pip_url, github_pip_url
9+
from airbyte._util.pip_util import connector_pip_url, github_pip_url
1010

1111

1212
__all__ = [
File renamed without changes.

airbyte_lib/_util/protocol_util.py airbyte/_util/protocol_util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Type,
1313
)
1414

15-
from airbyte_lib import exceptions as exc
15+
from airbyte import exceptions as exc
1616

1717

1818
if TYPE_CHECKING:
File renamed without changes.

airbyte/caches/__init__.py

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""Base module for all caches."""
2+
from __future__ import annotations
3+
4+
from airbyte.caches.base import SQLCacheBase
5+
from airbyte.caches.duckdb import DuckDBCache, DuckDBCacheConfig
6+
from airbyte.caches.postgres import PostgresCache, PostgresCacheConfig
7+
from airbyte.caches.snowflake import SnowflakeCacheConfig, SnowflakeSQLCache
8+
9+
10+
# We export these classes for easy access: `airbyte.caches...`
11+
__all__ = [
12+
"DuckDBCache",
13+
"DuckDBCacheConfig",
14+
"PostgresCache",
15+
"PostgresCacheConfig",
16+
"SQLCacheBase",
17+
"SnowflakeCacheConfig",
18+
"SnowflakeSQLCache",
19+
]

airbyte_lib/caches/_catalog_manager.py airbyte/caches/_catalog_manager.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
SyncMode,
2121
)
2222

23-
from airbyte_lib import exceptions as exc
23+
from airbyte import exceptions as exc
2424

2525

2626
if TYPE_CHECKING:

airbyte_lib/caches/base.py airbyte/caches/base.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@
2828
from sqlalchemy.pool import StaticPool
2929
from sqlalchemy.sql.elements import TextClause
3030

31-
from airbyte_lib import exceptions as exc
32-
from airbyte_lib._file_writers.base import FileWriterBase, FileWriterBatchHandle
33-
from airbyte_lib._processors import BatchHandle, RecordProcessor
34-
from airbyte_lib._util.text_util import lower_case_set
35-
from airbyte_lib.caches._catalog_manager import CatalogManager
36-
from airbyte_lib.config import CacheConfigBase
37-
from airbyte_lib.datasets._sql import CachedDataset
38-
from airbyte_lib.strategies import WriteStrategy
39-
from airbyte_lib.types import SQLTypeConverter
31+
from airbyte import exceptions as exc
32+
from airbyte._file_writers.base import FileWriterBase, FileWriterBatchHandle
33+
from airbyte._processors import BatchHandle, RecordProcessor
34+
from airbyte._util.text_util import lower_case_set
35+
from airbyte.caches._catalog_manager import CatalogManager
36+
from airbyte.config import CacheConfigBase
37+
from airbyte.datasets._sql import CachedDataset
38+
from airbyte.strategies import WriteStrategy
39+
from airbyte.types import SQLTypeConverter
4040

4141

4242
if TYPE_CHECKING:
@@ -53,8 +53,8 @@
5353
ConfiguredAirbyteCatalog,
5454
)
5555

56-
from airbyte_lib.datasets._base import DatasetBase
57-
from airbyte_lib.telemetry import CacheTelemetryInfo
56+
from airbyte.datasets._base import DatasetBase
57+
from airbyte.telemetry import CacheTelemetryInfo
5858

5959

6060
DEBUG_MODE = False # Set to True to enable additional debug logging.

airbyte_lib/caches/duckdb.py airbyte/caches/duckdb.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
from overrides import overrides
1313

14-
from airbyte_lib._file_writers import ParquetWriter, ParquetWriterConfig
15-
from airbyte_lib.caches.base import SQLCacheBase, SQLCacheConfigBase
16-
from airbyte_lib.telemetry import CacheTelemetryInfo
14+
from airbyte._file_writers import ParquetWriter, ParquetWriterConfig
15+
from airbyte.caches.base import SQLCacheBase, SQLCacheConfigBase
16+
from airbyte.telemetry import CacheTelemetryInfo
1717

1818

1919
# Suppress warnings from DuckDB about reflection on indices.

airbyte_lib/caches/postgres.py airbyte/caches/postgres.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
from overrides import overrides
88

9-
from airbyte_lib._file_writers import ParquetWriter, ParquetWriterConfig
10-
from airbyte_lib.caches.base import SQLCacheBase, SQLCacheConfigBase
11-
from airbyte_lib.telemetry import CacheTelemetryInfo
9+
from airbyte._file_writers import ParquetWriter, ParquetWriterConfig
10+
from airbyte.caches.base import SQLCacheBase, SQLCacheConfigBase
11+
from airbyte.telemetry import CacheTelemetryInfo
1212

1313

1414
class PostgresCacheConfig(SQLCacheConfigBase, ParquetWriterConfig):

airbyte_lib/caches/snowflake.py airbyte/caches/snowflake.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
from overrides import overrides
1212
from snowflake.sqlalchemy import URL, VARIANT
1313

14-
from airbyte_lib._file_writers import ParquetWriter, ParquetWriterConfig
15-
from airbyte_lib.caches.base import (
14+
from airbyte._file_writers import ParquetWriter, ParquetWriterConfig
15+
from airbyte.caches.base import (
1616
RecordDedupeMode,
1717
SQLCacheBase,
1818
SQLCacheConfigBase,
1919
)
20-
from airbyte_lib.telemetry import CacheTelemetryInfo
21-
from airbyte_lib.types import SQLTypeConverter
20+
from airbyte.telemetry import CacheTelemetryInfo
21+
from airbyte.types import SQLTypeConverter
2222

2323

2424
if TYPE_CHECKING:
File renamed without changes.

airbyte/datasets/__init__.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from __future__ import annotations
2+
3+
from airbyte.datasets._base import DatasetBase
4+
from airbyte.datasets._lazy import LazyDataset
5+
from airbyte.datasets._map import DatasetMap
6+
from airbyte.datasets._sql import CachedDataset, SQLDataset
7+
8+
9+
__all__ = [
10+
"CachedDataset",
11+
"DatasetBase",
12+
"DatasetMap",
13+
"LazyDataset",
14+
"SQLDataset",
15+
]
File renamed without changes.

airbyte_lib/datasets/_lazy.py airbyte/datasets/_lazy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from overrides import overrides
77

8-
from airbyte_lib.datasets import DatasetBase
8+
from airbyte.datasets import DatasetBase
99

1010

1111
if TYPE_CHECKING:

airbyte_lib/datasets/_map.py airbyte/datasets/_map.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
if TYPE_CHECKING:
15-
from airbyte_lib.datasets._base import DatasetBase
15+
from airbyte.datasets._base import DatasetBase
1616

1717

1818
class DatasetMap(Mapping):

airbyte_lib/datasets/_sql.py airbyte/datasets/_sql.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from overrides import overrides
88
from sqlalchemy import and_, func, select, text
99

10-
from airbyte_lib.datasets._base import DatasetBase
10+
from airbyte.datasets._base import DatasetBase
1111

1212

1313
if TYPE_CHECKING:
@@ -17,7 +17,7 @@
1717
from sqlalchemy import Selectable, Table
1818
from sqlalchemy.sql import ClauseElement
1919

20-
from airbyte_lib.caches import SQLCacheBase
20+
from airbyte.caches import SQLCacheBase
2121

2222

2323
class SQLDataset(DatasetBase):

airbyte_lib/exceptions.py airbyte/exceptions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class AirbyteConnectorNotPyPiPublishedError(AirbyteConnectorRegistryError):
204204
"""Connector found, but not published to PyPI."""
205205

206206
connector_name: str | None = None
207-
guidance = "This likely means that the connector is not ready for use with airbyte-lib."
207+
guidance = "This likely means that the connector is not ready for use with PyAirbyte."
208208

209209

210210
# Connector Errors
File renamed without changes.
File renamed without changes.

airbyte_lib/registry.py airbyte/registry.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
import requests
1111

12-
from airbyte_lib import exceptions as exc
13-
from airbyte_lib.version import get_version
12+
from airbyte import exceptions as exc
13+
from airbyte.version import get_version
1414

1515

1616
__cache: dict[str, ConnectorMetadata] | None = None

airbyte_lib/results.py airbyte/results.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
from collections.abc import Mapping
55
from typing import TYPE_CHECKING
66

7-
from airbyte_lib.datasets import CachedDataset
7+
from airbyte.datasets import CachedDataset
88

99

1010
if TYPE_CHECKING:
1111
from collections.abc import Iterator
1212

1313
from sqlalchemy.engine import Engine
1414

15-
from airbyte_lib.caches import SQLCacheBase
15+
from airbyte.caches import SQLCacheBase
1616

1717

1818
class ReadResult(Mapping[str, CachedDataset]):

0 commit comments

Comments
 (0)