Skip to content

Commit 964b4a2

Browse files
docs: update path to garf.* in python examples
1 parent 15e123c commit 964b4a2

30 files changed

+101
-346
lines changed

docs/development/create-api-client.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Creating an API client is the easiest way of developing with `garf`.
99

1010
`garf-core` library has a `BaseClient` which one mandatory method you need to implement `get_response`.
1111

12-
Your implementation should take an instance of `garf_core.query_editor.BaseQueryElements` class and return `garf_core.api_clients.GarfApiResponse`.
12+
Your implementation should take an instance of `garf.core.query_editor.BaseQueryElements` class and return `garf.core.api_clients.GarfApiResponse`.
1313

1414
* `BaseQueryElements` contains various elements parsed from the query such as fields, sorts, filters, and resource to get data from.
1515
* `GarfApiReponse` contains `results` property that should be a list of dictionary-like objects.
@@ -18,7 +18,7 @@ Your implementation should take an instance of `garf_core.query_editor.BaseQuery
1818
Let see and example implementation of `MyApiClient`.
1919

2020
```python
21-
from garf_core import api_clients, query_editor
21+
from garf.core import api_clients, query_editor
2222

2323
class MyApiClient(api_clients.BaseClient):
2424

@@ -35,7 +35,7 @@ class MyApiClient(api_clients.BaseClient):
3535
Once your ApiClient class is defined, you can use with built-in `ApiReportFetcher`.
3636

3737
```python
38-
from garf_core import ApiReportFetcher
38+
from garf.core import ApiReportFetcher
3939

4040
api_client = MyClient()
4141
report_fetcher = ApiReportFetcher(api_client=api_client)

docs/development/create-api-response-parser.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
If your API client returns lists of structures that are not similar to dictionaries,
2-
you might need to implement a custom parser based on `garf_core.parsers.BaseParser`.
2+
you might need to implement a custom parser based on `garf.core.parsers.BaseParser`.
33

44

55
## Define Parser class
66

77
The only method you need to implement is `parse_row`.
88

99
```python
10-
from garf_core.parsers import BaseParser
10+
from garf.core.parsers import BaseParser
1111

1212
class MyParser(BaseParser):
1313

@@ -20,7 +20,7 @@ class MyParser(BaseParser):
2020
Once your Parser class is defined, you can use with built-in `ApiReportFetcher`.
2121

2222
```python
23-
from garf_core import ApiReportFetcher
23+
from garf.core import ApiReportFetcher
2424

2525
report_fetcher = ApiReportFetcher(api_client, parser=MyParser)
2626
```

docs/development/create-garf-library.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ It's up to you how to implement a request to an API given fields, dimensions, re
5555
* Create `<YOUR_LIBRARY>ApiClient` class:
5656

5757
```python
58-
from garf_core import api_clients, query_editor
58+
from garf.core import api_clients, query_editor
5959

6060

6161
class MyLibraryApiClient(api_clients.BaseClient):
@@ -76,7 +76,7 @@ and API response parsers as well as built-in queries associated with a concrete
7676
* Create `<YOUR_LIBRARY>ReportFetcher` class:
7777

7878
```python
79-
from garf_core import report_fetcher
79+
from garf.core import report_fetcher
8080

8181

8282
class MyLibraryApiReportFetcher(report_fetcher.ApiReportFetcher):

docs/fetchers/bid-manager.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ garf query.sql --source bid-manager \
4848
```python
4949
import os
5050

51-
from garf_io import writer
52-
from garf_bid_manager import BidManagerApiReportFetcher
51+
from garf.io import writer
52+
from garf.community.google.bid_manager import BidManagerApiReportFetcher
5353

5454
query = """
5555
SELECT

docs/fetchers/google-ads.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ garf query.sql --source google-ads \
4646
```python
4747
import os
4848

49-
from garf_io import writer
50-
from garf_google_ads import GoogleAdsApiReportFetcher
49+
from garf.io import writer
50+
from garf.community.google.ads import GoogleAdsApiReportFetcher
5151

5252
query = """
5353
SELECT

docs/fetchers/google-analytics-api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ garf query.sql --source google-analytics \
4848
/// tab | python
4949

5050
```python
51-
from garf_io import writer
52-
from garf_google_analytics import GoogleAnalyticsApiReportFetcher
51+
from garf.io import writer
52+
from garf.community.google.analytics import GoogleAnalyticsApiReportFetcher
5353

5454
query = """
5555
SELECT

docs/fetchers/merchant-center-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ garf <PATH_TO_QUERIES> --source merchant-api \
2222
where:
2323

2424
* `<PATH_TO_QUERIES>` - local or remove files containing queries
25-
* `<OUTPUT_TYPE>` - output supported by [`garf-io` library](https://github.com/google/garf/tree/main/libs/garf_io#readme).
25+
* `output` - output supported by [`garf-io` library](https://google.github.io/garf/usage/writers/).
2626
* `<SOURCE_PARAMETER=VALUE` - key-value pairs to refine fetching, check [available source parameters](#available-source-parameters).
2727

2828
### Available source parameters

docs/fetchers/youtube-data-api.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ garf query.sql --source youtube-data-api \
4343
```python
4444
import os
4545

46-
from garf_io import writer
46+
from garf.io import writer
4747
from garf_youtube_data_api import YouTubeDataApiReportFetcher
4848

4949
query = 'SELECT id, snippet.title AS channel_name FROM channels'
@@ -109,7 +109,7 @@ garf video_info.sql --source youtube-data-api \
109109
```python
110110
import os
111111

112-
from garf_io import writer
112+
from garf.io import writer
113113
from garf_youtube_data_api import YouTubeDataApiReportFetcher
114114

115115
query = """
@@ -167,7 +167,7 @@ garf video_orientation.sql --source youtube-data-api \
167167
```python hl_lines="19"
168168
import os
169169

170-
from garf_io import writer
170+
from garf.io import writer
171171
from garf_youtube_data_api import YouTubeDataApiReportFetcher
172172

173173
query = """
@@ -225,7 +225,7 @@ garf channel_info.sql --source youtube-data-api \
225225
```python
226226
import os
227227

228-
from garf_io import writer
228+
from garf.io import writer
229229
from garf_youtube_data_api import YouTubeDataApiReportFetcher
230230

231231
query = """
@@ -277,7 +277,7 @@ garf channel_videos.sql --source youtube-data-api \
277277
```python
278278
import os
279279

280-
from garf_io import writer
280+
from garf.io import writer
281281
from garf_youtube_data_api import YouTubeDataApiReportFetcher
282282

283283
query = """
@@ -322,7 +322,7 @@ garf video_commentaries.sql --source youtube-data-api \
322322
```python
323323
import os
324324

325-
from garf_io import writer
325+
from garf.io import writer
326326
from garf_youtube_data_api import YouTubeDataApiReportFetcher
327327

328328

docs/usage/api-client.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ApiClient is responsible for sending request to an API based on the query.
1111
It allows you to specify sample response from an API as JSON or a dictionary.
1212

1313
```python
14-
from garf_core.api_clients import FakeApiClient
14+
from garf.core.api_clients import FakeApiClient
1515

1616
fake_data = [
1717
{'field1': {'subfield': 1}, 'field2': 2},
@@ -23,7 +23,7 @@ api_client = FakeApiClient(results=fake_data)
2323
Instead of providing data as a variable you can read them from JSON or CSV.
2424

2525
```python
26-
from garf_core.api_clients import FakeApiClient
26+
from garf.core.api_clients import FakeApiClient
2727

2828
api_client = FakeApiClient.from_json('path/to/json')
2929
api_client = FakeApiClient.from_csv('path/to/csv')
@@ -38,7 +38,7 @@ REST API client is useful when you have a REST API available. Provide endpoint
3838
to get data from.
3939

4040
```python
41-
from garf_core.api_clients import RestApiClient
41+
from garf.core.api_clients import RestApiClient
4242

4343
endpoint= 'https://api.restful-api.dev'
4444
api_client = RestApiClient(endpoint=endpoint)

docs/usage/api-executor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ where
4646
///
4747
/// tab | Python
4848
```python
49-
from garf_executors import setup_executor
49+
from garf.executors import setup_executor
5050

5151

5252
query_executor = setup_executor(source='youtube-data-api')
@@ -114,7 +114,7 @@ garf query.sql --source youtube_data_api \
114114

115115
/// tab | Python
116116
```python
117-
from garf_executors import setup_executor
117+
from garf.executors import setup_executor
118118

119119

120120
query_executor = setup_executor(

0 commit comments

Comments
 (0)