Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Historic docs #1766

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 4 additions & 7 deletions docs/website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ const config = {
editUrl: (params) => {
return "https://github.com/dlt-hub/dlt/tree/devel/docs/website/docs/" + params.docPath;
},
versions: {
current: {
label: 'current',
},
},
lastVersion: 'current',

showLastUpdateAuthor: true,
showLastUpdateTime: true,
},
Expand Down Expand Up @@ -83,7 +78,9 @@ const config = {
href: 'https://dlthub.com'
},
items: [
{ label: 'dlt ' + (process.env.IS_MASTER_BRANCH ? "stable ": "devel ") + (process.env.DOCUSAURUS_DLT_VERSION || "0.0.1"), position: 'left', href: 'https://github.com/dlt-hub/dlt', className: 'version-navbar' },
{
type: 'docsVersionDropdown',
},
{
type: 'doc',
docId: 'intro',
Expand Down
Binary file added docs/website/static/img/streamlit1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/website/versioned_docs/version-0.3.25/.dlt/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[destination.weaviate]
vectorizer="text2vec-contextionary"
module_config={text2vec-contextionary = { vectorizeClassName = false, vectorizePropertyName = true}}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
sidebar_label: __init__
title: __init__
---

data load tool (dlt) — the open-source Python library for data loading

How to create a data loading pipeline with dlt in 3 seconds:

1. Write a pipeline script
```py
import dlt
from dlt.sources.helpers import requests
dlt.run(requests.get("https://pokeapi.co/api/v2/pokemon/").json()["results"], destination="duckdb", table_name="pokemon")
```

2. Run your pipeline script
> $ python pokemon.py

3. See and query your data with autogenerated Streamlit app
> $ dlt pipeline dlt_pokemon show

Or start with our pipeline template with sample PokeAPI (pokeapi.co) data loaded to bigquery

> $ dlt init pokemon bigquery

For more detailed info, see https://dlthub.com/docs/getting-started

## TSecretValue

When typing source/resource function arguments it indicates that a given argument is a secret and should be taken from dlt.secrets.

## TCredentials

When typing source/resource function arguments it indicates that a given argument represents credentials and should be taken from dlt.secrets. Credentials may be a string, dictionary or any other type.

Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
sidebar_label: accessors
title: common.configuration.accessors
---

## \_ConfigAccessor Objects

```python
class _ConfigAccessor(_Accessor)
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/accessors.py#L88)

Provides direct access to configured values that are not secrets.

### config\_providers

```python
@property
def config_providers() -> Sequence[ConfigProvider]
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/accessors.py#L92)

Return a list of config providers, in lookup order

### writable\_provider

```python
@property
def writable_provider() -> ConfigProvider
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/accessors.py#L101)

find first writable provider that does not support secrets - should be config.toml

### value

A placeholder that tells dlt to replace it with actual config value during the call to a source or resource decorated function.

## \_SecretsAccessor Objects

```python
class _SecretsAccessor(_Accessor)
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/accessors.py#L113)

Provides direct access to secrets.

### config\_providers

```python
@property
def config_providers() -> Sequence[ConfigProvider]
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/accessors.py#L117)

Return a list of config providers that can hold secrets, in lookup order

### writable\_provider

```python
@property
def writable_provider() -> ConfigProvider
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/accessors.py#L126)

find first writable provider that supports secrets - should be secrets.toml

### value

A placeholder that tells dlt to replace it with actual secret during the call to a source or resource decorated function.

## config

Dictionary-like access to all config values to dlt

## secrets

Dictionary-like access to all secrets known known to dlt

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
sidebar_label: container
title: common.configuration.container
---

## Container Objects

```python
class Container()
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/container.py#L15)

A singleton injection container holding several injection contexts. Implements basic dictionary interface.

Injection context is identified by its type and available via dict indexer. The common pattern is to instantiate default context value
if it is not yet present in container.

By default, the context is thread-affine so it can be injected only n the thread that originally set it. This behavior may be changed
in particular context type (spec).

The indexer is settable and allows to explicitly set the value. This is required by in any context that needs to be explicitly instantiated.

The `injectable_context` allows to set a context with a `with` keyword and then restore the previous one after it gets out of scope.

### thread\_contexts

A thread aware mapping of injection context

### main\_context

Injection context for the main thread

### injectable\_context

```python
@contextmanager
def injectable_context(config: TConfiguration,
lock_context: bool = False) -> Iterator[TConfiguration]
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/container.py#L134)

A context manager that will insert `config` into the container and restore the previous value when it gets out of scope.

### thread\_pool\_prefix

```python
@staticmethod
def thread_pool_prefix() -> str
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/container.py#L174)

Creates a container friendly pool prefix that contains starting thread id. Container implementation will automatically use it
for any thread-affine contexts instead of using id of the pool thread

Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
sidebar_label: exceptions
title: common.configuration.exceptions
---

## ContainerException Objects

```python
class ContainerException(DltException)
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/exceptions.py#L23)

base exception for all exceptions related to injectable container

## ConfigProviderException Objects

```python
class ConfigProviderException(ConfigurationException)
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/exceptions.py#L29)

base exceptions for all exceptions raised by config providers

## ConfigFieldMissingException Objects

```python
class ConfigFieldMissingException(KeyError, ConfigurationException)
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/exceptions.py#L43)

raises when not all required config fields are present

## UnmatchedConfigHintResolversException Objects

```python
class UnmatchedConfigHintResolversException(ConfigurationException)
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/exceptions.py#L93)

Raised when using `@resolve_type` on a field that doesn't exist in the spec

## FinalConfigFieldException Objects

```python
class FinalConfigFieldException(ConfigurationException)
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/exceptions.py#L110)

rises when field was annotated as final ie Final[str] and the value is modified by config provider

## ConfigValueCannotBeCoercedException Objects

```python
class ConfigValueCannotBeCoercedException(ConfigurationValueError)
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/exceptions.py#L119)

raises when value returned by config provider cannot be coerced to hinted type

## ConfigFileNotFoundException Objects

```python
class ConfigFileNotFoundException(ConfigurationException)
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/exceptions.py#L141)

thrown when configuration file cannot be found in config folder

## ConfigFieldMissingTypeHintException Objects

```python
class ConfigFieldMissingTypeHintException(ConfigurationException)
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/exceptions.py#L148)

thrown when configuration specification does not have type hint

## ConfigFieldTypeHintNotSupported Objects

```python
class ConfigFieldTypeHintNotSupported(ConfigurationException)
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/exceptions.py#L159)

thrown when configuration specification uses not supported type in hint

Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
sidebar_label: inject
title: common.configuration.inject
---

## with\_config

```python
def with_config(
func: Optional[AnyFun] = None,
spec: Type[BaseConfiguration] = None,
sections: Tuple[str, ...] = (),
sections_merge_style: ConfigSectionContext.
TMergeFunc = ConfigSectionContext.prefer_incoming,
auto_pipeline_section: bool = False,
include_defaults: bool = True,
accept_partial: bool = False,
initial_config: Optional[BaseConfiguration] = None,
base: Type[BaseConfiguration] = BaseConfiguration,
lock_context_on_injection: bool = True) -> Callable[[TFun], TFun]
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/inject.py#L60)

Injects values into decorated function arguments following the specification in `spec` or by deriving one from function's signature.

The synthesized spec contains the arguments marked with `dlt.secrets.value` and `dlt.config.value` which are required to be injected at runtime.
Optionally (and by default) arguments with default values are included in spec as well.

**Arguments**:

- `func` _Optional[AnyFun], optional_ - A function with arguments to be injected. Defaults to None.
- `spec` _Type[BaseConfiguration], optional_ - A specification of injectable arguments. Defaults to None.
- `sections` _Tuple[str, ...], optional_ - A set of config sections in which to look for arguments values. Defaults to ().
- `prefer_existing_sections` - (bool, optional): When joining existing section context, the existing context will be preferred to the one in `sections`. Default: False
- `auto_pipeline_section` _bool, optional_ - If True, a top level pipeline section will be added if `pipeline_name` argument is present . Defaults to False.
- `include_defaults` _bool, optional_ - If True then arguments with default values will be included in synthesized spec. If False only the required arguments marked with `dlt.secrets.value` and `dlt.config.value` are included
- `base` _Type[BaseConfiguration], optional_ - A base class for synthesized spec. Defaults to BaseConfiguration.
- `lock_context_on_injection` _bool, optional_ - If True, the thread context will be locked during injection to prevent race conditions. Defaults to True.

**Returns**:

Callable[[TFun], TFun]: A decorated function

## last\_config

```python
def last_config(**kwargs: Any) -> Any
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/inject.py#L252)

Get configuration instance used to inject function arguments

## create\_resolved\_partial

```python
def create_resolved_partial(f: AnyFun,
config: Optional[BaseConfiguration] = None
) -> AnyFun
```

[[view_source]](https://github.com/dlt-hub/dlt/blob/3739c9ac839aafef713f6d5ebbc6a81b2a39a1b0/dlt/common/configuration/inject.py#L261)

Create a pre-resolved partial of the with_config decorated function

Loading
Loading