Skip to content

Commit

Permalink
oob deprecated, moved to localhost. Default changed to help with User…
Browse files Browse the repository at this point in the history
…ID, readme tweaked
  • Loading branch information
visch committed Dec 9, 2022
1 parent 06b2d61 commit 157505b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 17 deletions.
46 changes: 31 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,45 @@
# tap-gmail
# `tap-gmail`

`tap-gmail` is a Singer tap for Gmail.
Gmail tap class.

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

## Installation
## Capabilities

- [ ] `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.
* `catalog`
* `state`
* `discover`
* `about`
* `stream-maps`
* `schema-flattening`

```bash
pipx install tap-gmail
```
## Settings

## Configuration
| Setting | Required | Default | Description |
|:-------------------------------|:--------:|:-------:|:------------|
| oauth_credentials.client_id | False | None | Your google client_id |
| oauth_credentials.client_secret| False | None | Your google client_secret |
| oauth_credentials.refresh_token| False | None | Your google refresh token |
| user_id | False | me | The user's email address. The special value me can be used to indicate the authenticated user. More info [here](https://developers.google.com/gmail/api/reference/rest/v1/users/getProfile#path-parameters) |
| messages.include_spam_trash | False | 0 | Include messages from SPAM and TRASH in the results. |
| 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_enabled | False | None | 'True' to enable schema flattening and automatically expand nested properties. |
| flattening_max_depth | False | None | The max depth to flatten schemas. |

### Accepted Config Options
A full list of supported settings and capabilities is available by running: `tap-gmail --about`

- [ ] `Developer TODO:` Provide a list of config options accepted by the tap.

A full list of supported settings and capabilities for this
tap is available by running:
## 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.

```bash
tap-gmail --about
pipx install tap-gmail
```

## Configuration

### Configure using environment variables

This Singer tap will automatically import any environment variables within the working directory's
Expand All @@ -33,7 +48,8 @@ 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.
Look at the ./generate_refresh_token.py file to generate a refresh token


## Usage

Expand Down
2 changes: 1 addition & 1 deletion generate_refresh_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
SCOPE = "https://www.googleapis.com/auth/gmail.readonly"
# The redirect URI set for the given Client ID. The redirect URI for Client ID
# generated for an installed application will always have this value.
_REDIRECT_URI = "urn:ietf:wg:oauth:2.0:oob"
_REDIRECT_URI = "http://localhost"

parser = argparse.ArgumentParser(
description="Generates a refresh token with " "the provided credentials."
Expand Down
6 changes: 5 additions & 1 deletion tap_gmail/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ class TapGmail(Tap):
th.StringType,
description="Your google refresh token",
),
th.Property("user_id", th.StringType, description="Your Gmail User ID"),
th.Property(
"user_id",
th.StringType,
default="me",
description="The user's email address. The special value me can be used to indicate the authenticated user. More info [here](https://developers.google.com/gmail/api/reference/rest/v1/users/getProfile#path-parameters)"),
th.Property(
"messages.include_spam_trash",
th.BooleanType,
Expand Down

0 comments on commit 157505b

Please sign in to comment.