Skip to content

Commit

Permalink
Update README and increment version
Browse files Browse the repository at this point in the history
  • Loading branch information
stkbailey committed Oct 26, 2021
1 parent 08b85cc commit 7892c39
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 50 deletions.
53 changes: 13 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

`tap-slack` is a Singer tap for Slack, built with the [Meltano Tap SDK](https://sdk.meltano.com) for Singer Taps.

**THIS PROJECT IS CURRENTLY UNDER DEVELOPMENT AND NOT SUITABLE FOR USE**

## 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.
You can install this repository directly from the Github repo. For example, by running:

```bash
pipx install tap-slack
pipx install https://github.com/MeltanoLabs/tap-slack.git
```

## Configuration
Expand All @@ -26,24 +24,25 @@ tap-slack --about
### Creating the Tap-Slack App

In order to access the records in your workspace, you will need to create a new Slack App.
The token used to authenticate against the API will require access to several API endpoints and require the following scopes:


Below is an example App Manifest that you can use for your workspace.
Below is an example App Manifest that you can use for your workspace. If you would like to
access additional channels, such as direct messages, you will need to provide additional scopes
to your Slack app.

```
_metadata:
major_version: 1
minor_version: 1
display_information:
name: tap-slack
description: Slack App to support the implementation of Singer.io tap-slack.
long_description: This application is used for extracting channel, user, and message data from the Slack workspace via the tap-slack application. On GitHub at https://github.com/MeltanoLabs/tap-slack.
name: MeltanoLabs Tap-Slack
description: Slack App to support the implementation of Singer.io tap-slack
long_description: This application is used for extracting channel, user, and message data from the Slack workspace via the tap-slack application. Found on GitHub at https://github.com/MeltanoLabs/tap-slack.
features:
bot_user:
display_name: Tap Slack
display_name: MeltanoLabs Tap-Slack
always_online: false
oauth_config:
redirect_urls:
- https://meltano.com/
scopes:
bot:
- channels:join
Expand All @@ -60,7 +59,8 @@ settings:
### Rate Limits

The Slack API implements a tiered rate limiting system, where certain methods operate under
different rate limitations. For more information, see Slack's [rate limits documentation](https://api.slack.com/docs/rate-limits).
different rate limitations. In this tap, rate limiting is handled by adding a pause
between API calls. For more information, see Slack's [rate limits documentation](https://api.slack.com/docs/rate-limits).

## Usage

Expand Down Expand Up @@ -98,33 +98,6 @@ You can also test the `tap-slack` CLI interface directly using `poetry run`:
poetry run tap-slack --help
```

### Testing with [Meltano](https://www.meltano.com)

_**Note:** This tap will work in any Singer environment and does not require Meltano.
Examples here are for convenience and to streamline end-to-end orchestration scenarios._

Your project comes with a custom `meltano.yml` project file already created. Open the `meltano.yml` and follow any _"TODO"_ items listed in
the file.

Next, install Meltano (if you haven't already) and any needed plugins:

```bash
# Install meltano
pipx install meltano
# Initialize meltano within this directory
cd tap-slack
meltano install
```

Now you can test and orchestrate using Meltano:

```bash
# Test invocation:
meltano invoke tap-slack --version
# OR run a test `elt` pipeline:
meltano elt tap-slack target-jsonl
```

### SDK Dev Guide

See the [dev guide](https://sdk.meltano.com/en/latest/dev_guide.html) for more instructions on how to use the SDK to
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tap-slack"
version = "0.0.1"
version = "0.1.0"
description = "`tap-slack` is a Singer tap for Slack, built with the Meltano SDK for Singer Taps."
authors = ["Stephen Bailey"]
license = "Apache 2.0"
Expand Down
9 changes: 2 additions & 7 deletions tap_slack/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ def parse_response(self, response):
user_list = extract_jsonpath(self.records_jsonpath, input=response.json())
yield from ({"member_id": ii} for ii in user_list)

@property
def state_partitioning_keys(self):
"Remove partitioning keys to prevent state logging for individual threads."
return []


class MessagesStream(SlackStream):
name = "messages"
Expand Down Expand Up @@ -122,8 +117,8 @@ class ThreadsStream(SlackStream):

@property
def state_partitioning_keys(self):
"Remove partitioning keys to prevent state logging for individual threads."
return []
"Remove thread_ts to prevent state logging for individual threads."
return ["channel_id"]


class UsersStream(SlackStream):
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
def sample_config():
yield {
"api_key": os.environ.get("TAP_SLACK_API_KEY"),
"start_date": datetime.datetime.today().strftime("%Y-%m-%d"),
"start_date": "2021-01-01T00:00:00Z",
}


Expand Down
1 change: 0 additions & 1 deletion tests/test_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def test_messages_stream(tap_slack, full_sync_records):

def test_threads_stream(tap_slack, full_sync_records):
stream_record_comparison(tap_slack, "threads", full_sync_records)
stream_schema_comparison(tap_slack, "threads", full_sync_records)


def test_users_stream(tap_slack, full_sync_records):
Expand Down

0 comments on commit 7892c39

Please sign in to comment.