Giter Site home page Giter Site logo

tap-sftp's Introduction

tap-sftp

Singer tap that extracts data from SFTP files and produces JSON-formatted data following the Singer spec.

Install:

First, make sure Python 3 is installed on your system or follow these installation instructions for Mac or Ubuntu.

It's recommended to use a virtualenv:

$ python3 -m venv venv
$ pip install tap-sftp

or

$ python3 -m venv venv
$ . venv/bin/activate
$ pip install --upgrade pip
$ pip install .

Configuration:

  1. Create a config.json file with connection details to snowflake.

    {
         "host": "SFTP_HOST_NAME",
         "port": 22,
         "username": "YOUR_USER",
         "password": "YOUR_PASS",
         "tables": [
             {
                 "table_name": "MyExportData",
                 "search_prefix": "\/Export\/SubFolder",
                 "search_pattern": "MyExportData.*\\.zip.gpg$",
                 "key_properties": [],
                 "delimiter": ",",
                 "encoding": "utf-8"
             }
         ],
         "start_date":"2021-01-28",
         "decryption_configs": {
             "SSM_key_name": "SSM_PARAMETER_KEY_NAME",
             "gnupghome": "/your/dir/.gnupg",
             "passphrase": "your_gpg_passphrase"
         },
         "private_key_file": "Optional_Path",
     }

    If using the decryption feature you must pass the configs shown above, including the AWS SSM parameter name for where the decryption private key is stored. In order to retrieve this parameter the runtime environment must have access to SSM through IAM environment variables (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN).

    The private_key_file is optional.

Discovery mode:

The tap can be invoked in discovery mode to find the available tables and columns in the database:

$ tap-sftp --config config.json --discover > catalog.json

A discovered catalog is output, with a JSON-schema description of each table. A source table directly corresponds to a Singer stream.

Edit the catalog.json and select the streams to replicate. Or use this helpful discovery utility.

Run Tap:

Run the tap like any other singer compatible tap:

$ tap-sftp --config config.json --catalog catalog.json --state state.json

To run tests:

  1. Install python dependencies in a virtual env and run unit and integration tests
  python3 -m venv venv
  . venv/bin/activate
  pip install --upgrade pip
  pip install .
  pip install tox
  1. To run unit tests:
  tox

License

Apache License Version 2.0

See LICENSE to see the full text.

tap-sftp's People

Contributors

pnadolny13 avatar cosimon avatar luandy64 avatar kallan357 avatar mghastin avatar dmosorast avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.