Singer.io target for loading data
Project description
target-airtable
This is a Singer target that reads JSON-formatted data from stdin following the Singer spec and persists it to Airtable.
Install
Implemented and tested with Python 3.9.0. It is recommented to install this target into a separate virtual environment to avoid dependency conflicts. Clone the repository and install it from source:
› pip install target-airtable
Use
target-airtable takes two types of input:
- A config file containing
- api_token (from your Airtable account)
- base (the Airtable base id)
- endpoint (optional, default="https://api.airtable.com/v0", the Airtable API endpoint)
- typecast (optional, default=True, tries to cast types according to your Airtable table schema)
- output_schema (optional, default=False, collects and write the (flattened) stream schema to a file)
- output_schema_path (optional, default="", the output path to write the schema file)
- failed_insert_exception (optional, default=True, raises an exception for any failed insert instead of error only)
- upsert (optional, default=False, if set to True, it updates existing records and inserts new ones from the received streams. The parameter unique_field_name might be specified. Exceptions will be thrown if duplicate records are found both in the data to be upserted and the existing table data)
- unique_field_name (optional, default="id", the field name which is assumed to be unique)
- A stream of Singer-formatted data on stdin
target-airtable replicates the incomming streams from a tap into Airtable tables with the same name as the stream. Make sure that these tables and the fields exist in your selected Airtable base.
If you want to make sure how the (flattened) schema has to look like in Airtable, set the option output_schema to
True. A file with the required table fields will be written to output_schema_path/output_schema.txt and no
records will be submitted to Airtable.
Create a config file with your configuration data:
{
"api_token": "my_token",
"base": "my_base",
"endpoint": "https://api.airtable.com/v0",
"typecast": true,
"output_schema": false,
"output_schema_path": "",
"failed_insert_exception": true,
"upsert": false,
"unique_field_name": "id"
}
› tap-some-api | target-airtable --config config.json
where tap-some-api is a Singer Tap.
Want to help?
Fork, improve and PR.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file target-airtable-1.3.0.tar.gz.
File metadata
- Download URL: target-airtable-1.3.0.tar.gz
- Upload date:
- Size: 16.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df40127725605e6e583fc2aaa7282fb3a8384d901e1b59809ff3c74ce890b796
|
|
| MD5 |
7a307052a152f90b01c719d8cd70b600
|
|
| BLAKE2b-256 |
689fa33d4dfe91e5724f41fddf64d0fa245b5aa2a4c20c366aa0d435566639bd
|
File details
Details for the file target_airtable-1.3.0-py3-none-any.whl.
File metadata
- Download URL: target_airtable-1.3.0-py3-none-any.whl
- Upload date:
- Size: 16.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c4ec3d1b4bba78dce5206a6965f17f8a96e4140c50da5f8e285532d33578724
|
|
| MD5 |
f85a403efa46e39550a46b36480dbe2e
|
|
| BLAKE2b-256 |
14823b9feab5da4dbb49243c5d71c84dd404ea0ccabddcc89f064b354114a458
|