Skip to content

Commit e49f727

Browse files
docs: update README
Unify root README and index page of the documentation
1 parent 354312a commit e49f727

File tree

4 files changed

+68
-23
lines changed

4 files changed

+68
-23
lines changed

README.md

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,60 @@
33
`garf` is a framework for building various connectors to reporting API that provides
44
users with a SQL-like interface to specify what needs to be extracted from the API.
55

6-
The framework allows you to define SQL-like queries alongside aliases and custom extractors and specify where the results of such query should be stored.
7-
Based on such a query the library constructs the correct query to a reporting API of your choice, automatically extract all necessary fields from API schema
8-
and transform them into a structure suitable for writing data.
6+
It allows you to define SQL-like queries alongside aliases and custom extractors and specify where the results of such query should be stored.\
7+
Based on a query `garf` builds the correct request to a reporting API, parses response
8+
and transform it into a structure suitable for writing data.
99

10-
`garf` consist of several core libraries:
10+
## Key features
1111

12-
* [`garf-core`](libs/garf_core) - exposes interfaces and core classes such as `GarfReport`.
13-
* [`garf-io`](libs/garf_io) - handles reading queries and writing `GarfReport` to various local/remote storages.
14-
* [`garf-executors`](libs/garf_executors) - responsible for orchestrating process of fetching from API and storing data in a storage.
12+
* SQL-like syntax to interact with reporting APIs
13+
* Built-in support for writing data into various local / remote storage
14+
* Available as library, CLI, FastAPI endpoint
15+
* Easily extendable to support various APIs
16+
17+
18+
## Installation
19+
20+
```bash
21+
pip install garf-executors
22+
```
1523

16-
[`garf-community`](libs/garf_community) folder contains concrete implementation of the framework for various APIs.
1724

1825
## Usage
1926

20-
Check usage of `garf` as a [library](docs/use-garf-as-a-library.md).
27+
### Get data from API to use in your code
28+
29+
```python
30+
from garf_core import ApiReportFetcher
31+
from garf_core.api_clients import FakeApiClient
32+
from garf_io import writer
33+
34+
my_api_client = FakeApiClient(results=[{'field': 1}])
35+
fetcher = ApiReportFetcher(my_api_client)
36+
report = fetcher.fetch('SELECT field FROM resource_name')
37+
38+
# Convert to Pandas
39+
report.to_pandas()
40+
41+
# Write to CSV
42+
writer.create_writer('csv').write(report, 'api_data')
43+
44+
```
45+
46+
### Use `garf` CLI tool to fetch data from an API
47+
48+
49+
```bash
50+
garf /path/to/queries \
51+
--source youtube --source.channel=MY_CHANNEL_ID \
52+
--output csv
53+
```
54+
55+
## Documentation
2156

22-
## Building your own libraries
57+
Explore full documentation on using and extending `garf`
2358

24-
If you wish to build your own garf-based libraries please refer to [documentation](docs/creating-your-own-libraries.md).
59+
* [Documentation](https://google.github.io/garf/)
2560

2661
## Disclaimer
2762
This is not an officially supported Google product. This project is not

docs/get-started/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Get Started
1+
# Overview
22

33
Garf allows you to define SQL-like queries alongside aliases and custom extractors and specify where the results of such query should be stored.
44
Based on such a query the library constructs the correct query to a reporting API of your choice, automatically extract all necessary fields from API schema

docs/index.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,38 @@
55
`garf` is a framework for building various connectors to reporting API that provides
66
users with a SQL-like interface to specify what needs to be extracted from the API.
77

8-
The framework allows you to define SQL-like queries alongside aliases and custom extractors and specify where the results of such query should be stored.
9-
Based on such a query the library constructs the correct query to a reporting API of your choice, automatically extract all necessary fields from API schema
10-
and transform them into a structure suitable for writing data.
8+
It allows you to define SQL-like queries alongside aliases and custom extractors and specify where the results of such query should be stored.\
9+
Based on a query `garf` builds the correct request to a reporting API, parses response
10+
and transform it into a structure suitable for writing data.
1111

1212
## Key features
1313

14-
* Uses SQL-like syntax to interact with reporting APIs
14+
15+
* SQL-like syntax to interact with reporting APIs
1516
* Built-in support for writing data into various local / remote storage
1617
* Available as library, CLI, FastAPI endpoint
1718
* Easily extendable to support various APIs
1819

1920

2021
## Installation
21-
```python
22+
23+
/// tab | pip
24+
```bash
2225
pip install garf-executors
2326
```
27+
///
2428

25-
`garf` consist of several core libraries:
29+
/// tab | uv
30+
```bash
31+
uv add garf-executors
32+
```
33+
///
2634

27-
* [`garf-core`](https://github.com/google/garf/tree/main/libs/garf_core) - exposes interfaces and core classes such as `GarfReport`.
28-
* [`garf-io`](https://github.com/google/garf/tree/main/libs/garf_io) - handles reading queries and writing `GarfReport` to various local/remote storages.
29-
* [`garf-executors`](https://github.com/google/garf/tree/main/libs/garf_executors) - responsible for orchestrating process of fetching from API and storing data in a storage.
3035

31-
[`garf-community`](https://github.com/google/garf/tree/main/libs/garf_community) folder contains concrete implementation of the framework for various APIs.
36+
## Usage
37+
38+
```bash
39+
garf /path/to/queries \
40+
--source youtube --source.channel=MY_CHANNEL_ID \
41+
--output csv
42+
```

mkdocs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ nav:
4949
- get-started/index.md
5050
- Installation: get-started/installation.md
5151
- Quickstart:
52-
- get-started/index.md
5352
- Library: get-started/library.md
5453
- CLI: get-started/cli.md
5554
- Server: get-started/server.md

0 commit comments

Comments
 (0)