Skip to content

svinstech/tap-anvil

 
 

Repository files navigation

tap-anvil

tap-anvil is a Singer tap for Anvil.

A Singer tap extracts data from any source and write it to a standard stream in a JSON-based format.

Anvil is a tool for programmatically filling out PDF forms.


GitHub Workflow Status pre-commit.ci status Codecov

Installation

pipx install git+https://github.com/k-aranke/mode-client.git@latest

Usage

Get your Anvil API key using these instructions. Create a .env file to save your Anvil API key.

TAP_ANVIL_API_KEY=<your-api-key>

Alternatively, save TAP_ANVIL_API_KEY as an environment variable. Now you can run:

dotenv run tap-anvil --config=ENV

API

The following objects are currently synced:

  1. Organization
  2. Weld
  3. Forge
  4. WeldData
  5. Submission

If you'd like to see another object, please open a feature request.

References

Local Development

Installation

pipx install poetry
poetry install

Download Data

pipx install tap-jsonl
rm -rf output/*.jsonl && dotenv run tap-anvil --config=ENV | target-jsonl -c output/target-jsonl-config.json

Testing

poetry run pytest --cov=tap_anvil

Creating a new release

tap-anvil uses Commitizen to automatically create GitHub releases with semantic versioning. In practice, this means that prefacing commits with feat: will create a minor release and fix: will create a patch release.

tap-anvil currently isn't published to PyPI.

Running a GraphQL query locally

Use the Anvil Postman collection.

Caveat

Previously for CreatedAt, UpdatedAt and some other date attribute, we have

 "createdAt": {
      "anyOf": [
        {
          "type": "null"
        },
        {
          "format": "date-time",
          "type": "string"
        }
	]
    },

this kind of type for them. Because we're using target-snowflake downstream of tap-anvil to load this data into our datawarehouse in Snowflake and there is a known issue in target-snowflake that it will skip anyOf type attribute. So we just make this a string type like below.

"type": [
        "null",
        "string"
      ]