Skip to content

Commit

Permalink
add dataset access example to getting started scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-rp committed Dec 11, 2024
1 parent 1687a40 commit c8fc3c0
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/website/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ pipeline = dlt.pipeline(
)

load_info = pipeline.run(source)

# print load info and posts table as dataframe
print(load_info)
print(pipeline.dataset().posts.df())
```

Follow the [REST API source tutorial](./tutorial/rest-api) to learn more about the source configuration and pagination methods.
Expand All @@ -92,6 +96,10 @@ pipeline = dlt.pipeline(
)

load_info = pipeline.run(source)

# print load info and the "family" table as dataframe
print(load_info)
print(pipeline.dataset().family.df())
```

Follow the [SQL source tutorial](./tutorial/sql-database) to learn more about the source configuration and supported databases.
Expand All @@ -116,6 +124,10 @@ pipeline = dlt.pipeline(
)

load_info = pipeline.run(resource)

# print load info and the "example" table as dataframe
print(load_info)
print(pipeline.dataset().example.df())
```

Follow the [filesystem source tutorial](./tutorial/filesystem) to learn more about the source configuration and supported storage services.
Expand All @@ -128,7 +140,7 @@ dlt is able to load data from Python generators or directly from Python data str
```py
import dlt

@dlt.resource
@dlt.resource(table_name="foo_data")
def foo():
for i in range(10):
yield {"id": i, "name": f"This is item {i}"}
Expand All @@ -139,6 +151,10 @@ pipeline = dlt.pipeline(
)

load_info = pipeline.run(foo)

# print load info and the "foo_data" table as dataframe
print(load_info)
print(pipeline.dataset().foo_table.df())
```

Check out the [Python data structures tutorial](./tutorial/load-data-from-an-api) to learn about dlt fundamentals and advanced usage scenarios.
Expand Down

0 comments on commit c8fc3c0

Please sign in to comment.