Skip to content

Singer tap for the Pocket items API, built with the Meltano SDK

Notifications You must be signed in to change notification settings

edgarrmondragon/tap-getpocket

Repository files navigation

tap-getpocket

Singer tap for extracting data from the Pocket API.

Built with the Meltano Singer SDK.

Capabilities

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

Settings

Setting Required Default Description
consumer_key True None Pocket application key
access_token True None Pocket user access token
start_date False None The earliest record datetime to sync as a UNIX timestamp
favorite False None Set to true to sync only favorite items, false to sync only non-favorite items, or omit to sync all items
content_type False None The content type of items to sync. By default, all content types are synced.
state True all Type of item state to sync. By default, all states are synced.
tag False None The tag to sync. By default, all tags are synced. Use _untagged_ to sync untagged items.
stream_maps False None Config object for stream maps capability. For more information check out Stream Maps.
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.
batch_config False None

A full list of supported settings and capabilities is available by running: tap-getpocket --about

Supported Python Versions

  • 3.7
  • 3.8
  • 3.9
  • 3.10
  • 3.11

Installation

pipx install git+https://github.com/edgarrmondragon/tap-getpocket.git

Configuration

Accepted Config Options

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

tap-getpocket --about

Source Authentication and Authorization

  1. Create a Pocket application: https://getpocket.com/developer/apps/new.
  2. Use the app's consumer key to make a request to the /v3/oauth/request with ru endpoint to get a request_token (code).
  3. Use the request_token to get authorization from the Pocket user: https://getpocket.com/auth/authorize?request_token=<request_token>&redirect_uri=<redirect_uri>.
  4. Make a request to the /v3/oauth/authorize endpoint to get an access_token.
  5. Put consumer_key and access_token in a JSON config file.

Documentation: https://getpocket.com/developer/docs/authentication

Usage

You can easily run tap-getpocket by itself or in a pipeline using Meltano.

Executing the Tap Directly

tap-getpocket --version
tap-getpocket --help
tap-getpocket --config CONFIG --discover > ./catalog.json

Developer Resources

Initialize your Development Environment

pipx install hatch

Create and Run Tests

Run integration tests:

hatch run test:integration

You can also test the tap-getpocket CLI interface directly:

hatch run sync:console -- --about --format=json

Testing with Meltano

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. Go ahead and install Meltano if you haven't already.

  1. Install all plugins

    meltano install
  2. Check that the extractor is working properly

    meltano invoke tap-getpocket --version
  3. Execute an ELT pipeline

    meltano run tap-getpocket target-jsonl

About

Singer tap for the Pocket items API, built with the Meltano SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages