Skip to content

Commit

Permalink
Merge pull request #7 from jolan-du-bois/dev_alter_new_stream
Browse files Browse the repository at this point in the history
Dev alter new stream
  • Loading branch information
beubeu13220 committed Aug 8, 2023
2 parents 99a3993 + fa249de commit 26299b1
Show file tree
Hide file tree
Showing 9 changed files with 1,842 additions and 88 deletions.
74 changes: 58 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,38 @@
# tap-aircall

`tap-aircall` is a Singer tap for aircall.
`tap-aircall` is a Singer tap for extracting data from the [aircall API](https://developer.aircall.io/api-references/).

Built with the [Meltano Tap SDK](https://sdk.meltano.com) for Singer Taps.

## Capabilities

- catalog
- state
- discover
- about
- stream-maps
- schema-flattening
- batch

## Settings

Setting | Required | Default | Description
--- | --- | --- | ---
api_token | True | None | The token to authenticate against the API service
api_id | True | None | The id to authenticate against the API service
start_date | False | None | The earliest record date to sync in UTC Timezone
stream_maps | False | None | Config object for stream maps capability. For more information check out [Stream Maps](https://sdk.meltano.com/en/latest/stream_maps.html)
stream_map_config | False | None | User-defined config values to be used within map expressions
flattening_max_depth | False | None | 'True' to enable schema flattening and automatically expand nested properties
flattening_max_depth | False | None | The max depth to flatten schemas

A full list of supported settings and capabilities for this
tap is available by running:

```bash
poetry run tap-aircall --about
```

## Installation

- [ ] `Developer TODO:` Update the below as needed to correctly describe the install procedure. For instance, if you do not have a PyPi repo, or if you want users to directly install from your git repo, you can modify this step as appropriate.
Expand All @@ -14,15 +43,21 @@ pipx install tap-aircall

## Configuration

### Accepted Config Options
### Authorization Method

- [ ] `Developer TODO:` Provide a list of config options accepted by the tap.
To run tap-aircall, you will need an API ID and an API token. Create a file named .secret/config.json and fill it with an array containing the following fields:

A full list of supported settings and capabilities for this
tap is available by running:
- api_id
- api_token
- start_date

```bash
tap-aircall --about
The config file should look like this:
```json
{
"api_id": "123456789",
"api_token": "ABCDEFGHI",
"start_date": "2023-08-07 09:30:00"
}
```

### Configure using environment variables
Expand All @@ -31,25 +66,28 @@ This Singer tap will automatically import any environment variables within the w
`.env` if the `--config=ENV` is provided, such that config values will be considered if a matching
environment variable is set either in the terminal context or in the `.env` file.

### Source Authentication and Authorization

- [ ] `Developer TODO:` If your tap requires special access on the source system, or any special authentication requirements, provide those here.

## Usage

You can easily run `tap-aircall` by itself or in a pipeline using [Meltano](https://meltano.com/).

### Executing the Tap Directly

You can launch the tap in two different ways:

1. **catalog:** this option retrieves all data starting from the date specified in `.secrets/config.json` and updates the `samples/state.json` file with the latest retrieved item.

```bash
tap-aircall --version
tap-aircall --help
tap-aircall --config CONFIG --discover > ./catalog.json
./tap-aircall.sh catalog
```

## Developer Resources
2. **state:** this option retrieves all data starting from the state indicated in `samples/state.json`.


- [ ] `Developer TODO:` As a first step, scan the entire project for the text "`TODO:`" and complete any recommended steps, deleting the "TODO" references once completed.
```bash
./tap-aricall.sh state
```

## Developer Resources

### Initialize your Development Environment

Expand Down Expand Up @@ -104,3 +142,7 @@ meltano elt tap-aircall target-jsonl

See the [dev guide](https://sdk.meltano.com/en/latest/dev_guide.html) for more instructions on how to use the SDK to
develop your own taps and targets.

## Utilization

As explained above, this tap can be used in two different ways: `catalog` which retrieves all the data, and `state` which retrieves only the data since the last update. This second option allows fetching only the missing data every time the tap is run, making it a preferable choice. Nevertheless, it is important to note that any update made to an element in Aircall will not be considered when retrieving data via `state`. In other words, if one wishes to be able to retrieve all data, including updates, it is necessary to run the tap on the entire dataset every time. The only field for which there are no updates in the strictest sense (or at least no interesting updates to retrieve) is the 'Call' field. This field also happens to be the one containing the most data by far. Therefore, it is advised for the user to use `catalog` for the `User`, `Tag`, `Team`, `Contact`, and `Number` fields, but to use `state` for the `Call` field.

0 comments on commit 26299b1

Please sign in to comment.