mage-integrations 0.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mage_integrations/__init__.py +0 -0
- mage_integrations/connections/__init__.py +0 -0
- mage_integrations/connections/airtable/__init__.py +31 -0
- mage_integrations/connections/base.py +19 -0
- mage_integrations/connections/bigquery/__init__.py +49 -0
- mage_integrations/connections/constants.py +3 -0
- mage_integrations/connections/couchbase/__init__.py +43 -0
- mage_integrations/connections/doris/__init__.py +89 -0
- mage_integrations/connections/dremio/__init__.py +104 -0
- mage_integrations/connections/google_analytics/__init__.py +104 -0
- mage_integrations/connections/google_analytics/constants.py +266 -0
- mage_integrations/connections/google_analytics/utils.py +14 -0
- mage_integrations/connections/google_cloud_storage/__init__.py +33 -0
- mage_integrations/connections/google_search_console/__init__.py +58 -0
- mage_integrations/connections/google_sheets/__init__.py +96 -0
- mage_integrations/connections/mssql/__init__.py +60 -0
- mage_integrations/connections/mysql/__init__.py +93 -0
- mage_integrations/connections/oracledb/__init__.py +33 -0
- mage_integrations/connections/postgresql/__init__.py +39 -0
- mage_integrations/connections/redshift/__init__.py +45 -0
- mage_integrations/connections/snowflake/__init__.py +47 -0
- mage_integrations/connections/sql/__init__.py +0 -0
- mage_integrations/connections/sql/base.py +124 -0
- mage_integrations/connections/teradata/__init__.py +33 -0
- mage_integrations/connections/trino/__init__.py +40 -0
- mage_integrations/connections/trino/connection_wrapper.py +28 -0
- mage_integrations/connections/utils/__init__.py +0 -0
- mage_integrations/connections/utils/google.py +14 -0
- mage_integrations/connections/utils/sql.py +2 -0
- mage_integrations/destinations/__init__.py +0 -0
- mage_integrations/destinations/airtable/Readme.md +27 -0
- mage_integrations/destinations/airtable/__init__.py +92 -0
- mage_integrations/destinations/airtable/templates/config.json +4 -0
- mage_integrations/destinations/amazon_s3/README.md +24 -0
- mage_integrations/destinations/amazon_s3/__init__.py +172 -0
- mage_integrations/destinations/amazon_s3/templates/config.json +10 -0
- mage_integrations/destinations/amplitude/README.md +58 -0
- mage_integrations/destinations/amplitude/__init__.py +91 -0
- mage_integrations/destinations/amplitude/templates/config.json +5 -0
- mage_integrations/destinations/base.py +810 -0
- mage_integrations/destinations/bigquery/README.md +54 -0
- mage_integrations/destinations/bigquery/__init__.py +834 -0
- mage_integrations/destinations/bigquery/constants.py +8 -0
- mage_integrations/destinations/bigquery/templates/config.json +8 -0
- mage_integrations/destinations/bigquery/utils.py +304 -0
- mage_integrations/destinations/clickhouse/LICENSE +201 -0
- mage_integrations/destinations/clickhouse/README.md +14 -0
- mage_integrations/destinations/clickhouse/__init__.py +32 -0
- mage_integrations/destinations/clickhouse/target_clickhouse/__init__.py +1 -0
- mage_integrations/destinations/clickhouse/target_clickhouse/sinks.py +234 -0
- mage_integrations/destinations/clickhouse/target_clickhouse/target.py +137 -0
- mage_integrations/destinations/clickhouse/templates/config.json +4 -0
- mage_integrations/destinations/constants.py +50 -0
- mage_integrations/destinations/delta_lake/README.md +0 -0
- mage_integrations/destinations/delta_lake/__init__.py +0 -0
- mage_integrations/destinations/delta_lake/base.py +227 -0
- mage_integrations/destinations/delta_lake/constants.py +2 -0
- mage_integrations/destinations/delta_lake_azure/README.md +18 -0
- mage_integrations/destinations/delta_lake_azure/__init__.py +45 -0
- mage_integrations/destinations/delta_lake_azure/templates/config.json +6 -0
- mage_integrations/destinations/delta_lake_s3/README.md +21 -0
- mage_integrations/destinations/delta_lake_s3/__init__.py +130 -0
- mage_integrations/destinations/delta_lake_s3/templates/config.json +9 -0
- mage_integrations/destinations/doris/README.md +32 -0
- mage_integrations/destinations/doris/__init__.py +209 -0
- mage_integrations/destinations/doris/constants.py +755 -0
- mage_integrations/destinations/doris/templates/config.json +9 -0
- mage_integrations/destinations/doris/utils.py +118 -0
- mage_integrations/destinations/elasticsearch/README.md +57 -0
- mage_integrations/destinations/elasticsearch/__init__.py +37 -0
- mage_integrations/destinations/elasticsearch/target_elasticsearch/__init__.py +0 -0
- mage_integrations/destinations/elasticsearch/target_elasticsearch/common.py +32 -0
- mage_integrations/destinations/elasticsearch/target_elasticsearch/sinks.py +262 -0
- mage_integrations/destinations/elasticsearch/target_elasticsearch/target.py +267 -0
- mage_integrations/destinations/elasticsearch/templates/config.json +8 -0
- mage_integrations/destinations/google_cloud_storage/README.md +19 -0
- mage_integrations/destinations/google_cloud_storage/__init__.py +109 -0
- mage_integrations/destinations/google_cloud_storage/templates/config.json +8 -0
- mage_integrations/destinations/kafka/README.md +18 -0
- mage_integrations/destinations/kafka/__init__.py +91 -0
- mage_integrations/destinations/kafka/templates/config.json +5 -0
- mage_integrations/destinations/mongodb/README.md +11 -0
- mage_integrations/destinations/mongodb/__init__.py +28 -0
- mage_integrations/destinations/mongodb/target_mongodb/__init__.py +0 -0
- mage_integrations/destinations/mongodb/target_mongodb/sinks.py +135 -0
- mage_integrations/destinations/mongodb/target_mongodb/target.py +169 -0
- mage_integrations/destinations/mongodb/templates/config.json +5 -0
- mage_integrations/destinations/mssql/README.md +31 -0
- mage_integrations/destinations/mssql/__init__.py +214 -0
- mage_integrations/destinations/mssql/templates/config.json +10 -0
- mage_integrations/destinations/mssql/utils.py +101 -0
- mage_integrations/destinations/mysql/README.md +36 -0
- mage_integrations/destinations/mysql/__init__.py +215 -0
- mage_integrations/destinations/mysql/constants.py +755 -0
- mage_integrations/destinations/mysql/templates/config.json +9 -0
- mage_integrations/destinations/mysql/utils.py +154 -0
- mage_integrations/destinations/opensearch/README.md +22 -0
- mage_integrations/destinations/opensearch/__init__.py +35 -0
- mage_integrations/destinations/opensearch/target_opensearch/__init__.py +0 -0
- mage_integrations/destinations/opensearch/target_opensearch/common.py +30 -0
- mage_integrations/destinations/opensearch/target_opensearch/sinks.py +221 -0
- mage_integrations/destinations/opensearch/target_opensearch/target.py +241 -0
- mage_integrations/destinations/opensearch/templates/config.json +5 -0
- mage_integrations/destinations/oracledb/README.md +22 -0
- mage_integrations/destinations/oracledb/__init__.py +241 -0
- mage_integrations/destinations/oracledb/templates/config.json +10 -0
- mage_integrations/destinations/oracledb/utils.py +114 -0
- mage_integrations/destinations/postgresql/README.md +30 -0
- mage_integrations/destinations/postgresql/__init__.py +264 -0
- mage_integrations/destinations/postgresql/templates/config.json +9 -0
- mage_integrations/destinations/postgresql/utils.py +77 -0
- mage_integrations/destinations/redshift/README.md +45 -0
- mage_integrations/destinations/redshift/__init__.py +306 -0
- mage_integrations/destinations/redshift/constants.py +155 -0
- mage_integrations/destinations/redshift/templates/config.json +11 -0
- mage_integrations/destinations/redshift/utils.py +28 -0
- mage_integrations/destinations/salesforce/README.md +38 -0
- mage_integrations/destinations/salesforce/__init__.py +37 -0
- mage_integrations/destinations/salesforce/target_salesforce/__init__.py +0 -0
- mage_integrations/destinations/salesforce/target_salesforce/session_credentials.py +96 -0
- mage_integrations/destinations/salesforce/target_salesforce/sinks.py +161 -0
- mage_integrations/destinations/salesforce/target_salesforce/target.py +182 -0
- mage_integrations/destinations/salesforce/target_salesforce/utils/__init__.py +0 -0
- mage_integrations/destinations/salesforce/target_salesforce/utils/exceptions.py +10 -0
- mage_integrations/destinations/salesforce/target_salesforce/utils/transformation.py +25 -0
- mage_integrations/destinations/salesforce/target_salesforce/utils/validation.py +54 -0
- mage_integrations/destinations/salesforce/templates/config.json +8 -0
- mage_integrations/destinations/sink.py +594 -0
- mage_integrations/destinations/snowflake/README.md +39 -0
- mage_integrations/destinations/snowflake/__init__.py +582 -0
- mage_integrations/destinations/snowflake/constants.py +1 -0
- mage_integrations/destinations/snowflake/templates/config.json +14 -0
- mage_integrations/destinations/snowflake/utils.py +92 -0
- mage_integrations/destinations/sql/__init__.py +0 -0
- mage_integrations/destinations/sql/base.py +435 -0
- mage_integrations/destinations/sql/constants.py +843 -0
- mage_integrations/destinations/sql/utils.py +363 -0
- mage_integrations/destinations/sqlsink.py +414 -0
- mage_integrations/destinations/target.py +561 -0
- mage_integrations/destinations/teradata/README.md +18 -0
- mage_integrations/destinations/teradata/__init__.py +357 -0
- mage_integrations/destinations/teradata/templates/config.json +7 -0
- mage_integrations/destinations/teradata/utils.py +103 -0
- mage_integrations/destinations/trino/README.md +84 -0
- mage_integrations/destinations/trino/__init__.py +27 -0
- mage_integrations/destinations/trino/connectors/__init__.py +0 -0
- mage_integrations/destinations/trino/connectors/base.py +325 -0
- mage_integrations/destinations/trino/connectors/deltalake.py +53 -0
- mage_integrations/destinations/trino/connectors/iceberg.py +19 -0
- mage_integrations/destinations/trino/templates/config.json +14 -0
- mage_integrations/destinations/trino/utils.py +33 -0
- mage_integrations/destinations/utils.py +50 -0
- mage_integrations/sources/README.md +3 -0
- mage_integrations/sources/__init__.py +0 -0
- mage_integrations/sources/airtable/README.md +27 -0
- mage_integrations/sources/airtable/__init__.py +180 -0
- mage_integrations/sources/airtable/templates/config.json +5 -0
- mage_integrations/sources/amazon_s3/README.md +25 -0
- mage_integrations/sources/amazon_s3/__init__.py +298 -0
- mage_integrations/sources/amazon_s3/templates/config.json +11 -0
- mage_integrations/sources/amplitude/README.md +67 -0
- mage_integrations/sources/amplitude/__init__.py +356 -0
- mage_integrations/sources/amplitude/constants.py +58 -0
- mage_integrations/sources/amplitude/schemas/active_users.json +28 -0
- mage_integrations/sources/amplitude/schemas/annotations.json +54 -0
- mage_integrations/sources/amplitude/schemas/average_session_length.json +28 -0
- mage_integrations/sources/amplitude/schemas/cohort_members.json +34 -0
- mage_integrations/sources/amplitude/schemas/cohorts.json +144 -0
- mage_integrations/sources/amplitude/schemas/event_properties.json +72 -0
- mage_integrations/sources/amplitude/schemas/event_types.json +77 -0
- mage_integrations/sources/amplitude/schemas/events.json +349 -0
- mage_integrations/sources/amplitude/schemas/new_users.json +28 -0
- mage_integrations/sources/amplitude/schemas/sessions_per_user.json +28 -0
- mage_integrations/sources/amplitude/schemas/user_properties.json +66 -0
- mage_integrations/sources/amplitude/templates/config.json +7 -0
- mage_integrations/sources/amplitude/templates/query.json +4 -0
- mage_integrations/sources/api/README.md +211 -0
- mage_integrations/sources/api/__init__.py +279 -0
- mage_integrations/sources/api/templates/config.json +9 -0
- mage_integrations/sources/azure_blob_storage/README.md +21 -0
- mage_integrations/sources/azure_blob_storage/__init__.py +160 -0
- mage_integrations/sources/azure_blob_storage/templates/config.json +5 -0
- mage_integrations/sources/base.py +781 -0
- mage_integrations/sources/bigquery/README.md +49 -0
- mage_integrations/sources/bigquery/__init__.py +56 -0
- mage_integrations/sources/bigquery/templates/config.json +4 -0
- mage_integrations/sources/catalog.py +125 -0
- mage_integrations/sources/chargebee/README.md +21 -0
- mage_integrations/sources/chargebee/__init__.py +83 -0
- mage_integrations/sources/chargebee/client.py +194 -0
- mage_integrations/sources/chargebee/schemas/common/cards.json +57 -0
- mage_integrations/sources/chargebee/schemas/common/comments.json +30 -0
- mage_integrations/sources/chargebee/schemas/common/credit_notes.json +404 -0
- mage_integrations/sources/chargebee/schemas/common/customers.json +428 -0
- mage_integrations/sources/chargebee/schemas/common/gifts.json +85 -0
- mage_integrations/sources/chargebee/schemas/common/invoices.json +680 -0
- mage_integrations/sources/chargebee/schemas/common/orders.json +431 -0
- mage_integrations/sources/chargebee/schemas/common/payment_sources.json +180 -0
- mage_integrations/sources/chargebee/schemas/common/promotional_credits.json +46 -0
- mage_integrations/sources/chargebee/schemas/common/quotes.json +380 -0
- mage_integrations/sources/chargebee/schemas/common/transactions.json +241 -0
- mage_integrations/sources/chargebee/schemas/common/virtual_bank_accounts.json +56 -0
- mage_integrations/sources/chargebee/schemas/item_model/coupons.json +251 -0
- mage_integrations/sources/chargebee/schemas/item_model/events.json +653 -0
- mage_integrations/sources/chargebee/schemas/item_model/item_families.json +63 -0
- mage_integrations/sources/chargebee/schemas/item_model/item_prices.json +342 -0
- mage_integrations/sources/chargebee/schemas/item_model/items.json +187 -0
- mage_integrations/sources/chargebee/schemas/item_model/subscriptions.json +873 -0
- mage_integrations/sources/chargebee/schemas/plan_model/addons.json +163 -0
- mage_integrations/sources/chargebee/schemas/plan_model/coupons.json +103 -0
- mage_integrations/sources/chargebee/schemas/plan_model/events.json +647 -0
- mage_integrations/sources/chargebee/schemas/plan_model/plans.json +250 -0
- mage_integrations/sources/chargebee/schemas/plan_model/subscriptions.json +465 -0
- mage_integrations/sources/chargebee/state.py +44 -0
- mage_integrations/sources/chargebee/streams/__init__.py +69 -0
- mage_integrations/sources/chargebee/streams/addons.py +19 -0
- mage_integrations/sources/chargebee/streams/base.py +244 -0
- mage_integrations/sources/chargebee/streams/comments.py +19 -0
- mage_integrations/sources/chargebee/streams/coupons.py +24 -0
- mage_integrations/sources/chargebee/streams/credit_notes.py +19 -0
- mage_integrations/sources/chargebee/streams/customers.py +19 -0
- mage_integrations/sources/chargebee/streams/events.py +24 -0
- mage_integrations/sources/chargebee/streams/gifts.py +19 -0
- mage_integrations/sources/chargebee/streams/invoices.py +19 -0
- mage_integrations/sources/chargebee/streams/item_families.py +19 -0
- mage_integrations/sources/chargebee/streams/item_prices.py +19 -0
- mage_integrations/sources/chargebee/streams/items.py +19 -0
- mage_integrations/sources/chargebee/streams/orders.py +19 -0
- mage_integrations/sources/chargebee/streams/payment_sources.py +19 -0
- mage_integrations/sources/chargebee/streams/plans.py +19 -0
- mage_integrations/sources/chargebee/streams/promotional_credits.py +19 -0
- mage_integrations/sources/chargebee/streams/quotes.py +19 -0
- mage_integrations/sources/chargebee/streams/subscriptions.py +24 -0
- mage_integrations/sources/chargebee/streams/transactions.py +19 -0
- mage_integrations/sources/chargebee/streams/util.py +6 -0
- mage_integrations/sources/chargebee/streams/virtual_bank_accounts.py +19 -0
- mage_integrations/sources/chargebee/templates/config.json +7 -0
- mage_integrations/sources/commercetools/README.md +28 -0
- mage_integrations/sources/commercetools/__init__.py +40 -0
- mage_integrations/sources/commercetools/client.py +54 -0
- mage_integrations/sources/commercetools/schemas/customers.json +108 -0
- mage_integrations/sources/commercetools/schemas/discount_codes.json +77 -0
- mage_integrations/sources/commercetools/schemas/inventory.json +50 -0
- mage_integrations/sources/commercetools/schemas/orders.json +542 -0
- mage_integrations/sources/commercetools/schemas/payments.json +113 -0
- mage_integrations/sources/commercetools/schemas/products.json +82 -0
- mage_integrations/sources/commercetools/schemas/shared/address.json +83 -0
- mage_integrations/sources/commercetools/schemas/shared/created_by.json +17 -0
- mage_integrations/sources/commercetools/schemas/shared/custom.json +17 -0
- mage_integrations/sources/commercetools/schemas/shared/dimension.json +11 -0
- mage_integrations/sources/commercetools/schemas/shared/discounted_price_per_quantity.json +30 -0
- mage_integrations/sources/commercetools/schemas/shared/field_type.json +8 -0
- mage_integrations/sources/commercetools/schemas/shared/key_reference.json +11 -0
- mage_integrations/sources/commercetools/schemas/shared/last_modified_by.json +17 -0
- mage_integrations/sources/commercetools/schemas/shared/localized_string.json +8 -0
- mage_integrations/sources/commercetools/schemas/shared/money.json +17 -0
- mage_integrations/sources/commercetools/schemas/shared/price.json +56 -0
- mage_integrations/sources/commercetools/schemas/shared/price_scoped.json +45 -0
- mage_integrations/sources/commercetools/schemas/shared/product_data.json +52 -0
- mage_integrations/sources/commercetools/schemas/shared/product_variant.json +132 -0
- mage_integrations/sources/commercetools/schemas/shared/reference.json +22 -0
- mage_integrations/sources/commercetools/schemas/shared/shipping_details.json +22 -0
- mage_integrations/sources/commercetools/schemas/shared/state.json +11 -0
- mage_integrations/sources/commercetools/schemas/shared/taxed_item_price.json +11 -0
- mage_integrations/sources/commercetools/schemas/shared/taxed_price.json +28 -0
- mage_integrations/sources/commercetools/schemas/shared/taxrate.json +37 -0
- mage_integrations/sources/commercetools/schemas.py +25 -0
- mage_integrations/sources/commercetools/streams/__init__.py +0 -0
- mage_integrations/sources/commercetools/streams/base.py +30 -0
- mage_integrations/sources/commercetools/streams/customers.py +7 -0
- mage_integrations/sources/commercetools/streams/discount_codes.py +7 -0
- mage_integrations/sources/commercetools/streams/inventory.py +7 -0
- mage_integrations/sources/commercetools/streams/orders.py +7 -0
- mage_integrations/sources/commercetools/streams/payments.py +7 -0
- mage_integrations/sources/commercetools/streams/products.py +7 -0
- mage_integrations/sources/commercetools/templates/config.json +7 -0
- mage_integrations/sources/constants.py +46 -0
- mage_integrations/sources/couchbase/README.md +25 -0
- mage_integrations/sources/couchbase/__init__.py +140 -0
- mage_integrations/sources/couchbase/templates/config.json +7 -0
- mage_integrations/sources/couchbase/utils.py +58 -0
- mage_integrations/sources/datadog/README.md +25 -0
- mage_integrations/sources/datadog/__init__.py +55 -0
- mage_integrations/sources/datadog/client.py +18 -0
- mage_integrations/sources/datadog/schemas/audit_logs.json +49 -0
- mage_integrations/sources/datadog/schemas/dashboards.json +55 -0
- mage_integrations/sources/datadog/schemas/downtimes.json +103 -0
- mage_integrations/sources/datadog/schemas/incident_teams.json +92 -0
- mage_integrations/sources/datadog/schemas/incidents.json +135 -0
- mage_integrations/sources/datadog/schemas/logs.json +61 -0
- mage_integrations/sources/datadog/schemas/synthetic_tests.json +105 -0
- mage_integrations/sources/datadog/schemas/users.json +76 -0
- mage_integrations/sources/datadog/streams/__init__.py +275 -0
- mage_integrations/sources/datadog/templates/config.json +9 -0
- mage_integrations/sources/doris/README.md +28 -0
- mage_integrations/sources/doris/__init__.py +68 -0
- mage_integrations/sources/doris/templates/config.json +13 -0
- mage_integrations/sources/dremio/README.md +44 -0
- mage_integrations/sources/dremio/__init__.py +174 -0
- mage_integrations/sources/dremio/templates/config.json +6 -0
- mage_integrations/sources/dremio/utils.py +28 -0
- mage_integrations/sources/dynamodb/README.md +14 -0
- mage_integrations/sources/dynamodb/__init__.py +225 -0
- mage_integrations/sources/dynamodb/templates/config.json +6 -0
- mage_integrations/sources/facebook_ads/README.md +49 -0
- mage_integrations/sources/facebook_ads/__init__.py +45 -0
- mage_integrations/sources/facebook_ads/tap_facebook/__init__.py +1040 -0
- mage_integrations/sources/facebook_ads/tap_facebook/process_output.py +114 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/adcreative.json +1440 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads.json +859 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights.json +339 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_age_and_gender.json +352 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_country.json +345 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_dma.json +183 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_hourly_advertiser.json +311 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_platform_and_device.json +363 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/ads_insights_region.json +345 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/adsets.json +200 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/campaigns.json +98 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/leads.json +65 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/ads_action_stats.json +74 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/ads_histogram_stats.json +32 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/ads_image_crops.json +134 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/geo_locations.json +270 -0
- mage_integrations/sources/facebook_ads/tap_facebook/schemas/shared/targeting.json +401 -0
- mage_integrations/sources/facebook_ads/templates/config.json +5 -0
- mage_integrations/sources/facebook_ads/tests/base.py +396 -0
- mage_integrations/sources/facebook_ads/tests/facebook_ads/adcreative/output/00000000000000000000 +8 -0
- mage_integrations/sources/facebook_ads/tests/facebook_ads/ads/output/00000000000000000000 +10 -0
- mage_integrations/sources/facebook_ads/tests/facebook_ads/adsets/output/00000000000000000000 +11 -0
- mage_integrations/sources/facebook_ads/tests/facebook_ads/campaigns/output/00000000000000000000 +14 -0
- mage_integrations/sources/facebook_ads/tests/test_facebook_archived_data.py +115 -0
- mage_integrations/sources/facebook_ads/tests/test_facebook_attribution_window.py +104 -0
- mage_integrations/sources/facebook_ads/tests/test_facebook_automatic_fields.py +85 -0
- mage_integrations/sources/facebook_ads/tests/test_facebook_bookmarks.py +256 -0
- mage_integrations/sources/facebook_ads/tests/test_facebook_discovery.py +122 -0
- mage_integrations/sources/facebook_ads/tests/test_facebook_field_selection.py +118 -0
- mage_integrations/sources/facebook_ads/tests/test_facebook_invalid_attribution_window.py +65 -0
- mage_integrations/sources/facebook_ads/tests/test_facebook_start_date.py +145 -0
- mage_integrations/sources/facebook_ads/tests/unittests/test_attribute_error_retry.py +193 -0
- mage_integrations/sources/facebook_ads/tests/unittests/test_attribution_window.py +29 -0
- mage_integrations/sources/facebook_ads/tests/unittests/test_request_timeout.py +504 -0
- mage_integrations/sources/facebook_ads/tests/unittests/test_retry_logic.py +261 -0
- mage_integrations/sources/facebook_ads/tests/unittests/test_sync_batches_retry.py +154 -0
- mage_integrations/sources/facebook_ads/tests/unittests/test_tap_facebook.py +160 -0
- mage_integrations/sources/freshdesk/README.md +24 -0
- mage_integrations/sources/freshdesk/__init__.py +25 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/__init__.py +325 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/agents.json +85 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/companies.json +45 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/contacts.json +165 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/conversations.json +178 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/groups.json +40 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/roles.json +25 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/satisfaction_ratings.json +75 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/tickets.json +332 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/schemas/time_entries.json +72 -0
- mage_integrations/sources/freshdesk/tap_freshdesk/utils.py +93 -0
- mage_integrations/sources/freshdesk/templates/config.json +5 -0
- mage_integrations/sources/freshdesk/tests/base.py +262 -0
- mage_integrations/sources/freshdesk/tests/test_freshdesk_bookmarks.py +250 -0
- mage_integrations/sources/freshdesk/tests/test_freshdesk_check.py +29 -0
- mage_integrations/sources/freshdesk/tests/test_freshdesk_pagination.py +58 -0
- mage_integrations/sources/freshdesk/tests/test_freshdesk_start_date.py +181 -0
- mage_integrations/sources/front/README.md +25 -0
- mage_integrations/sources/front/__init__.py +40 -0
- mage_integrations/sources/front/client.py +76 -0
- mage_integrations/sources/front/context.py +62 -0
- mage_integrations/sources/front/schemas/accounts.json +37 -0
- mage_integrations/sources/front/schemas/analytics.json +71 -0
- mage_integrations/sources/front/schemas/channels.json +28 -0
- mage_integrations/sources/front/schemas/contact_groups.json +15 -0
- mage_integrations/sources/front/schemas/contacts.json +49 -0
- mage_integrations/sources/front/schemas/conversations.json +40 -0
- mage_integrations/sources/front/schemas/custom_fields.json +18 -0
- mage_integrations/sources/front/schemas/events.json +27 -0
- mage_integrations/sources/front/schemas/rules.json +21 -0
- mage_integrations/sources/front/schemas/tags.json +27 -0
- mage_integrations/sources/front/schemas/teammates.json +30 -0
- mage_integrations/sources/front/schemas/teams.json +12 -0
- mage_integrations/sources/front/schemas.py +43 -0
- mage_integrations/sources/front/streams/__init__.py +0 -0
- mage_integrations/sources/front/streams/accounts.py +7 -0
- mage_integrations/sources/front/streams/analytics.py +97 -0
- mage_integrations/sources/front/streams/base.py +29 -0
- mage_integrations/sources/front/streams/channels.py +7 -0
- mage_integrations/sources/front/streams/contact_groups.py +7 -0
- mage_integrations/sources/front/streams/contacts.py +7 -0
- mage_integrations/sources/front/streams/conversations.py +7 -0
- mage_integrations/sources/front/streams/custom_fields.py +7 -0
- mage_integrations/sources/front/streams/events.py +7 -0
- mage_integrations/sources/front/streams/rules.py +7 -0
- mage_integrations/sources/front/streams/tags.py +7 -0
- mage_integrations/sources/front/streams/teammates.py +7 -0
- mage_integrations/sources/front/streams/teams.py +7 -0
- mage_integrations/sources/front/templates/config.json +6 -0
- mage_integrations/sources/github/README.md +55 -0
- mage_integrations/sources/github/__init__.py +48 -0
- mage_integrations/sources/github/tap_github/__init__.py +47 -0
- mage_integrations/sources/github/tap_github/client.py +430 -0
- mage_integrations/sources/github/tap_github/discover.py +41 -0
- mage_integrations/sources/github/tap_github/schema.py +88 -0
- mage_integrations/sources/github/tap_github/schemas/assignees.json +72 -0
- mage_integrations/sources/github/tap_github/schemas/collaborators.json +75 -0
- mage_integrations/sources/github/tap_github/schemas/comments.json +120 -0
- mage_integrations/sources/github/tap_github/schemas/commit_comments.json +114 -0
- mage_integrations/sources/github/tap_github/schemas/commits.json +278 -0
- mage_integrations/sources/github/tap_github/schemas/events.json +1055 -0
- mage_integrations/sources/github/tap_github/schemas/issue_events.json +963 -0
- mage_integrations/sources/github/tap_github/schemas/issue_labels.json +29 -0
- mage_integrations/sources/github/tap_github/schemas/issue_milestones.json +125 -0
- mage_integrations/sources/github/tap_github/schemas/issues.json +276 -0
- mage_integrations/sources/github/tap_github/schemas/pr_commits.json +323 -0
- mage_integrations/sources/github/tap_github/schemas/project_cards.json +120 -0
- mage_integrations/sources/github/tap_github/schemas/project_columns.json +34 -0
- mage_integrations/sources/github/tap_github/schemas/projects.json +117 -0
- mage_integrations/sources/github/tap_github/schemas/pull_requests.json +1646 -0
- mage_integrations/sources/github/tap_github/schemas/releases.json +192 -0
- mage_integrations/sources/github/tap_github/schemas/review_comments.json +178 -0
- mage_integrations/sources/github/tap_github/schemas/reviews.json +70 -0
- mage_integrations/sources/github/tap_github/schemas/shared/issue_permissions.json +20 -0
- mage_integrations/sources/github/tap_github/schemas/shared/performed_via_github_app.json +61 -0
- mage_integrations/sources/github/tap_github/schemas/shared/pull_permissions.json +20 -0
- mage_integrations/sources/github/tap_github/schemas/shared/reactions.json +35 -0
- mage_integrations/sources/github/tap_github/schemas/shared/user.json +68 -0
- mage_integrations/sources/github/tap_github/schemas/stargazers.json +19 -0
- mage_integrations/sources/github/tap_github/schemas/team_members.json +74 -0
- mage_integrations/sources/github/tap_github/schemas/team_memberships.json +20 -0
- mage_integrations/sources/github/tap_github/schemas/teams.json +47 -0
- mage_integrations/sources/github/tap_github/streams.py +952 -0
- mage_integrations/sources/github/tap_github/sync.py +306 -0
- mage_integrations/sources/github/templates/config.json +7 -0
- mage_integrations/sources/github/tests/__init__.py +0 -0
- mage_integrations/sources/github/tests/base.py +445 -0
- mage_integrations/sources/google_ads/README.md +28 -0
- mage_integrations/sources/google_ads/__init__.py +41 -0
- mage_integrations/sources/google_ads/tap_google_ads/__init__.py +57 -0
- mage_integrations/sources/google_ads/tap_google_ads/client.py +17 -0
- mage_integrations/sources/google_ads/tap_google_ads/discover.py +268 -0
- mage_integrations/sources/google_ads/tap_google_ads/report_definitions.py +1877 -0
- mage_integrations/sources/google_ads/tap_google_ads/schemas/accounts.json +171 -0
- mage_integrations/sources/google_ads/tap_google_ads/schemas/ad_groups.json +268 -0
- mage_integrations/sources/google_ads/tap_google_ads/schemas/ads.json +1759 -0
- mage_integrations/sources/google_ads/tap_google_ads/schemas/campaigns.json +858 -0
- mage_integrations/sources/google_ads/tap_google_ads/streams.py +1170 -0
- mage_integrations/sources/google_ads/tap_google_ads/sync.py +144 -0
- mage_integrations/sources/google_ads/tap_google_ads/tests/base.py +434 -0
- mage_integrations/sources/google_ads/templates/config.json +13 -0
- mage_integrations/sources/google_analytics/README.md +31 -0
- mage_integrations/sources/google_analytics/__init__.py +128 -0
- mage_integrations/sources/google_analytics/templates/config.json +6 -0
- mage_integrations/sources/google_cloud_storage/README.md +40 -0
- mage_integrations/sources/google_cloud_storage/__init__.py +166 -0
- mage_integrations/sources/google_cloud_storage/templates/config.json +7 -0
- mage_integrations/sources/google_search_console/README.md +20 -0
- mage_integrations/sources/google_search_console/__init__.py +99 -0
- mage_integrations/sources/google_search_console/schemas/performance_report_country.json +31 -0
- mage_integrations/sources/google_search_console/schemas/performance_report_custom.json +40 -0
- mage_integrations/sources/google_search_console/schemas/performance_report_date.json +28 -0
- mage_integrations/sources/google_search_console/schemas/performance_report_device.json +31 -0
- mage_integrations/sources/google_search_console/schemas/performance_report_page.json +31 -0
- mage_integrations/sources/google_search_console/schemas/performance_report_query.json +31 -0
- mage_integrations/sources/google_search_console/streams.py +118 -0
- mage_integrations/sources/google_search_console/templates/config.json +6 -0
- mage_integrations/sources/google_sheets/README.md +24 -0
- mage_integrations/sources/google_sheets/__init__.py +460 -0
- mage_integrations/sources/google_sheets/templates/config.json +5 -0
- mage_integrations/sources/google_sheets/transform.py +297 -0
- mage_integrations/sources/http/__init__.py +0 -0
- mage_integrations/sources/http/client.py +179 -0
- mage_integrations/sources/hubspot/README.md +48 -0
- mage_integrations/sources/hubspot/__init__.py +41 -0
- mage_integrations/sources/hubspot/bin/run-a-test.sh +5 -0
- mage_integrations/sources/hubspot/bin/run-all-tests.sh +1 -0
- mage_integrations/sources/hubspot/tap_hubspot/__init__.py +1548 -0
- mage_integrations/sources/hubspot/tap_hubspot/constants.py +13 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/campaigns.json +91 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/companies.json +11 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/contact_lists.json +97 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/contacts.json +201 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/contacts_by_company.json +12 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/deal_pipelines.json +46 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/deals.json +37 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/email_events.json +118 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/engagements.json +179 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/forms.json +229 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/owners.json +72 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/subscription_changes.json +54 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/versions.json +30 -0
- mage_integrations/sources/hubspot/tap_hubspot/schemas/workflows.json +48 -0
- mage_integrations/sources/hubspot/tap_hubspot/tests/__init__.py +0 -0
- mage_integrations/sources/hubspot/tap_hubspot/tests/test_bookmarks.py +62 -0
- mage_integrations/sources/hubspot/tap_hubspot/tests/test_deals.py +32 -0
- mage_integrations/sources/hubspot/tap_hubspot/tests/test_get_streams_to_sync.py +44 -0
- mage_integrations/sources/hubspot/tap_hubspot/tests/test_offsets.py +57 -0
- mage_integrations/sources/hubspot/tap_hubspot/tests/unittests/test_get_start.py +94 -0
- mage_integrations/sources/hubspot/tap_hubspot/tests/unittests/test_request_timeout.py +121 -0
- mage_integrations/sources/hubspot/tap_hubspot/tests/utils.py +80 -0
- mage_integrations/sources/hubspot/templates/config.json +6 -0
- mage_integrations/sources/hubspot/tests/base.py +383 -0
- mage_integrations/sources/hubspot/tests/client.py +1583 -0
- mage_integrations/sources/hubspot/tests/client_tester.py +280 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_all_fields.py +323 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_automatic_fields.py +109 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_bookmarks.py +236 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_bookmarks_static.py +127 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_child_stream_only.py +88 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_discovery.py +131 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_interrupted_sync.py +137 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_interrupted_sync_offset.py +135 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_pagination.py +140 -0
- mage_integrations/sources/hubspot/tests/test_hubspot_start_date.py +179 -0
- mage_integrations/sources/hubspot/tests/unittests/test_deals.py +101 -0
- mage_integrations/sources/intercom/README.md +19 -0
- mage_integrations/sources/intercom/__init__.py +54 -0
- mage_integrations/sources/intercom/client.py +246 -0
- mage_integrations/sources/intercom/schema.py +57 -0
- mage_integrations/sources/intercom/schemas/admins.json +65 -0
- mage_integrations/sources/intercom/schemas/companies.json +106 -0
- mage_integrations/sources/intercom/schemas/company_attributes.json +63 -0
- mage_integrations/sources/intercom/schemas/company_segments.json +26 -0
- mage_integrations/sources/intercom/schemas/contact_attributes.json +104 -0
- mage_integrations/sources/intercom/schemas/contacts.json +534 -0
- mage_integrations/sources/intercom/schemas/conversation_parts.json +180 -0
- mage_integrations/sources/intercom/schemas/conversations.json +797 -0
- mage_integrations/sources/intercom/schemas/segments.json +26 -0
- mage_integrations/sources/intercom/schemas/tags.json +15 -0
- mage_integrations/sources/intercom/schemas/teams.json +28 -0
- mage_integrations/sources/intercom/streams.py +739 -0
- mage_integrations/sources/intercom/templates/config.json +4 -0
- mage_integrations/sources/intercom/transform.py +134 -0
- mage_integrations/sources/knowi/README.md +20 -0
- mage_integrations/sources/knowi/__init__.py +68 -0
- mage_integrations/sources/knowi/client.py +249 -0
- mage_integrations/sources/knowi/schema.py +60 -0
- mage_integrations/sources/knowi/schemas/dashboards.json +150 -0
- mage_integrations/sources/knowi/schemas/widgets.json +688 -0
- mage_integrations/sources/knowi/streams.py +190 -0
- mage_integrations/sources/knowi/templates/config.json +6 -0
- mage_integrations/sources/linkedin_ads/README.md +34 -0
- mage_integrations/sources/linkedin_ads/__init__.py +66 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/__init__.py +65 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/client.py +335 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/discover.py +30 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schema.py +91 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/account_users.json +91 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/accounts.json +190 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/ad_analytics_by_campaign.json +501 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/ad_analytics_by_creative.json +501 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/campaign_groups.json +133 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/campaigns.json +469 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/creatives.json +182 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/schemas/video_ads.json +115 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/sync.py +868 -0
- mage_integrations/sources/linkedin_ads/tap_linkedin_ads/transform.py +323 -0
- mage_integrations/sources/linkedin_ads/templates/config.json +9 -0
- mage_integrations/sources/linkedin_ads/tests/base.py +305 -0
- mage_integrations/sources/linkedin_ads/tests/test_all_fields.py +94 -0
- mage_integrations/sources/linkedin_ads/tests/test_discovery.py +95 -0
- mage_integrations/sources/linkedin_ads/tests/test_pagination.py +53 -0
- mage_integrations/sources/linkedin_ads/tests/test_start_date.py +130 -0
- mage_integrations/sources/linkedin_ads/tests/test_sync_canary.py +31 -0
- mage_integrations/sources/linkedin_ads/tests/test_sync_without_refrence_organization_id.py +31 -0
- mage_integrations/sources/linkedin_ads/tests/test_sync_without_refresh_token.py +131 -0
- mage_integrations/sources/linkedin_ads/tests/unittests/test_account_number.py +81 -0
- mage_integrations/sources/linkedin_ads/tests/unittests/test_adCampaignGroup_4XX.py +97 -0
- mage_integrations/sources/linkedin_ads/tests/unittests/test_client.py +94 -0
- mage_integrations/sources/linkedin_ads/tests/unittests/test_exception_handling.py +351 -0
- mage_integrations/sources/linkedin_ads/tests/unittests/test_fetch_access_token.py +36 -0
- mage_integrations/sources/linkedin_ads/tests/unittests/test_sync.py +197 -0
- mage_integrations/sources/linkedin_ads/tests/unittests/test_sync_endpoint.py +42 -0
- mage_integrations/sources/linkedin_ads/tests/unittests/test_timeout.py +279 -0
- mage_integrations/sources/messages.py +138 -0
- mage_integrations/sources/mode/README.md +21 -0
- mage_integrations/sources/mode/__init__.py +58 -0
- mage_integrations/sources/mode/client.py +251 -0
- mage_integrations/sources/mode/schema.py +57 -0
- mage_integrations/sources/mode/schemas/charts.json +116 -0
- mage_integrations/sources/mode/schemas/queries.json +41 -0
- mage_integrations/sources/mode/schemas/reports.json +128 -0
- mage_integrations/sources/mode/schemas/spaces.json +36 -0
- mage_integrations/sources/mode/streams.py +310 -0
- mage_integrations/sources/mode/templates/config.json +7 -0
- mage_integrations/sources/monday/README.md +24 -0
- mage_integrations/sources/monday/__init__.py +39 -0
- mage_integrations/sources/monday/client.py +35 -0
- mage_integrations/sources/monday/schemas/board_views.json +18 -0
- mage_integrations/sources/monday/schemas/boards.json +32 -0
- mage_integrations/sources/monday/schemas/columns.json +27 -0
- mage_integrations/sources/monday/schemas/groups.json +21 -0
- mage_integrations/sources/monday/schemas/workspaces.json +18 -0
- mage_integrations/sources/monday/streams.py +260 -0
- mage_integrations/sources/monday/templates/config.json +5 -0
- mage_integrations/sources/mongodb/README.md +33 -0
- mage_integrations/sources/mongodb/__init__.py +194 -0
- mage_integrations/sources/mongodb/schema.py +78 -0
- mage_integrations/sources/mongodb/spikes/atlas_setup.md +47 -0
- mage_integrations/sources/mongodb/spikes/dbreps_and_hackathon_review.md +46 -0
- mage_integrations/sources/mongodb/spikes/local_mongo_setup.md +92 -0
- mage_integrations/sources/mongodb/spikes/pymongo_spike.py +115 -0
- mage_integrations/sources/mongodb/spikes/supported_versions_spike.md +58 -0
- mage_integrations/sources/mongodb/tap_mongodb/__init__.py +465 -0
- mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/common.py +354 -0
- mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/full_table.py +162 -0
- mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/incremental.py +125 -0
- mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/oplog.py +271 -0
- mage_integrations/sources/mongodb/tap_mongodb/sync_strategies/utils.py +39 -0
- mage_integrations/sources/mongodb/templates/config.json +7 -0
- mage_integrations/sources/mongodb/tests/__init__.py +0 -0
- mage_integrations/sources/mongodb/tests/mongodb_common.py +37 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_cname_restrictions.py +252 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_configurable_properties.py +195 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_datatype.py +246 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_discovery.py +272 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_fname_restrictions.py +302 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_full_table.py +288 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_full_table_id.py +227 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_full_table_interruptible.py +232 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_id_pk_variations.py +273 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_incremental.py +480 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_incremental_open_transactions.py +312 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_index.py +162 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_log_based_interruptible.py +328 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_namespace_restrictions.py +258 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_oplog.py +260 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_oplog_aged_out.py +181 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_oplog_bookmarks.py +245 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_projection.py +271 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_table_reset_inc.py +300 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_table_reset_log.py +209 -0
- mage_integrations/sources/mongodb/tests/test_mongodb_views.py +159 -0
- mage_integrations/sources/mongodb/tests/unittests/test_common.py +436 -0
- mage_integrations/sources/mssql/README.md +28 -0
- mage_integrations/sources/mssql/__init__.py +88 -0
- mage_integrations/sources/mssql/templates/config.json +9 -0
- mage_integrations/sources/mysql/README.md +32 -0
- mage_integrations/sources/mysql/__init__.py +70 -0
- mage_integrations/sources/mysql/templates/config.json +13 -0
- mage_integrations/sources/oracledb/README.md +22 -0
- mage_integrations/sources/oracledb/__init__.py +152 -0
- mage_integrations/sources/oracledb/templates/config.json +8 -0
- mage_integrations/sources/outreach/README.md +68 -0
- mage_integrations/sources/outreach/__init__.py +47 -0
- mage_integrations/sources/outreach/tap_outreach/__init__.py +50 -0
- mage_integrations/sources/outreach/tap_outreach/client.py +131 -0
- mage_integrations/sources/outreach/tap_outreach/discover.py +87 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/accounts.json +356 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/call_dispositions.json +49 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/call_purposes.json +43 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/calls.json +179 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/content_categories.json +55 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/duties.json +23 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/events.json +97 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/mailboxes.json +306 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/mailings.json +283 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/opportunities.json +724 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/personas.json +37 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/prospects.json +906 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/sequence_states.json +161 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/sequence_steps.json +152 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/sequence_templates.json +122 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/sequences.json +275 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/stages.json +55 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/tasks.json +186 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/teams.json +30 -0
- mage_integrations/sources/outreach/tap_outreach/schemas/users.json +361 -0
- mage_integrations/sources/outreach/tap_outreach/sync.py +378 -0
- mage_integrations/sources/outreach/templates/config.json +7 -0
- mage_integrations/sources/paystack/README.md +15 -0
- mage_integrations/sources/paystack/__init__.py +44 -0
- mage_integrations/sources/paystack/client.py +14 -0
- mage_integrations/sources/paystack/schemas/customers.json +45 -0
- mage_integrations/sources/paystack/schemas/transactions.json +170 -0
- mage_integrations/sources/paystack/streams/__init__.py +8 -0
- mage_integrations/sources/paystack/streams/base.py +122 -0
- mage_integrations/sources/paystack/streams/customers.py +18 -0
- mage_integrations/sources/paystack/streams/transactions.py +18 -0
- mage_integrations/sources/paystack/templates/config.json +5 -0
- mage_integrations/sources/pipedrive/README.md +14 -0
- mage_integrations/sources/pipedrive/__init__.py +38 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/__init__.py +1 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/cli.py +32 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/config.py +5 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/exceptions.py +46 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/activity_types.json +37 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/currency.json +26 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/deal_products.json +125 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/dealflow.json +45 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/filters.json +37 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/pipelines.json +31 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/activities.json +112 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/deals.json +197 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/notes.json +90 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/organizations.json +156 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/persons.json +174 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/dynamic_typing/products.json +81 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/files.json +97 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/recents/users.json +75 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/schemas/stages.json +40 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/stream.py +195 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/__init__.py +22 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/activity_types.py +9 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/currencies.py +7 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/deal_products.py +17 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/dealflow.py +24 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/filters.py +9 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/notes.py +8 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/pipelines.py +9 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/__init__.py +36 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/__init__.py +86 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/activities.py +16 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/deals.py +22 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/notes.py +14 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/organizations.py +22 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/persons.py +21 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/dynamic_typing/products.py +13 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/files.py +10 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/recents/users.py +21 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/streams/stages.py +9 -0
- mage_integrations/sources/pipedrive/tap_pipedrive/tap.py +426 -0
- mage_integrations/sources/pipedrive/templates/config.json +4 -0
- mage_integrations/sources/postgresql/README.md +34 -0
- mage_integrations/sources/postgresql/__init__.py +499 -0
- mage_integrations/sources/postgresql/decoders.py +396 -0
- mage_integrations/sources/postgresql/templates/config.json +10 -0
- mage_integrations/sources/postmark/README.md +20 -0
- mage_integrations/sources/postmark/__init__.py +43 -0
- mage_integrations/sources/postmark/tap_postmark/__init__.py +4 -0
- mage_integrations/sources/postmark/tap_postmark/cleaners.py +331 -0
- mage_integrations/sources/postmark/tap_postmark/discover.py +55 -0
- mage_integrations/sources/postmark/tap_postmark/postmark.py +552 -0
- mage_integrations/sources/postmark/tap_postmark/schema.py +40 -0
- mage_integrations/sources/postmark/tap_postmark/schemas/messages_opens.json +134 -0
- mage_integrations/sources/postmark/tap_postmark/schemas/messages_outbound.json +93 -0
- mage_integrations/sources/postmark/tap_postmark/schemas/stats_outbound_bounces.json +81 -0
- mage_integrations/sources/postmark/tap_postmark/schemas/stats_outbound_clients.json +19 -0
- mage_integrations/sources/postmark/tap_postmark/schemas/stats_outbound_overview.json +88 -0
- mage_integrations/sources/postmark/tap_postmark/schemas/stats_outbound_platform.json +46 -0
- mage_integrations/sources/postmark/tap_postmark/streams.py +535 -0
- mage_integrations/sources/postmark/tap_postmark/sync.py +124 -0
- mage_integrations/sources/postmark/tap_postmark/tap.py +51 -0
- mage_integrations/sources/postmark/tap_postmark/tools.py +87 -0
- mage_integrations/sources/postmark/templates/config.json +4 -0
- mage_integrations/sources/powerbi/README.md +20 -0
- mage_integrations/sources/powerbi/__init__.py +68 -0
- mage_integrations/sources/powerbi/client.py +249 -0
- mage_integrations/sources/powerbi/schema.py +60 -0
- mage_integrations/sources/powerbi/schemas/apps.json +22 -0
- mage_integrations/sources/powerbi/schemas/dashboards.json +36 -0
- mage_integrations/sources/powerbi/schemas/datasets.json +31 -0
- mage_integrations/sources/powerbi/schemas/groups.json +34 -0
- mage_integrations/sources/powerbi/schemas/reports.json +25 -0
- mage_integrations/sources/powerbi/schemas/tiles.json +31 -0
- mage_integrations/sources/powerbi/streams.py +365 -0
- mage_integrations/sources/powerbi/templates/config.json +6 -0
- mage_integrations/sources/query.py +23 -0
- mage_integrations/sources/redshift/README.md +36 -0
- mage_integrations/sources/redshift/__init__.py +143 -0
- mage_integrations/sources/redshift/constants.py +57 -0
- mage_integrations/sources/redshift/templates/config.json +9 -0
- mage_integrations/sources/redshift/utils.py +26 -0
- mage_integrations/sources/salesforce/README.md +149 -0
- mage_integrations/sources/salesforce/__init__.py +77 -0
- mage_integrations/sources/salesforce/client/LICENSE +620 -0
- mage_integrations/sources/salesforce/client/__init__.py +0 -0
- mage_integrations/sources/salesforce/client/tap_salesforce/__init__.py +616 -0
- mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/__init__.py +400 -0
- mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/bulk.py +353 -0
- mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/credentials.py +112 -0
- mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/exceptions.py +8 -0
- mage_integrations/sources/salesforce/client/tap_salesforce/salesforce/rest.py +109 -0
- mage_integrations/sources/salesforce/client/tap_salesforce/sync.py +221 -0
- mage_integrations/sources/salesforce/templates/config.json +10 -0
- mage_integrations/sources/sftp/LICENSE +620 -0
- mage_integrations/sources/sftp/README.md +47 -0
- mage_integrations/sources/sftp/__init__.py +39 -0
- mage_integrations/sources/sftp/tap_sftp/__init__.py +0 -0
- mage_integrations/sources/sftp/tap_sftp/aws_ssm.py +24 -0
- mage_integrations/sources/sftp/tap_sftp/client.py +217 -0
- mage_integrations/sources/sftp/tap_sftp/decrypt.py +24 -0
- mage_integrations/sources/sftp/tap_sftp/discover.py +32 -0
- mage_integrations/sources/sftp/tap_sftp/singer_encodings/__init__.py +0 -0
- mage_integrations/sources/sftp/tap_sftp/singer_encodings/compression.py +20 -0
- mage_integrations/sources/sftp/tap_sftp/singer_encodings/csv_handler.py +58 -0
- mage_integrations/sources/sftp/tap_sftp/singer_encodings/json_schema.py +204 -0
- mage_integrations/sources/sftp/tap_sftp/stats.py +44 -0
- mage_integrations/sources/sftp/tap_sftp/sync.py +122 -0
- mage_integrations/sources/sftp/tap_sftp/tap.py +97 -0
- mage_integrations/sources/sftp/templates/config.json +22 -0
- mage_integrations/sources/snowflake/README.md +36 -0
- mage_integrations/sources/snowflake/__init__.py +63 -0
- mage_integrations/sources/snowflake/constants.py +0 -0
- mage_integrations/sources/snowflake/templates/config.json +11 -0
- mage_integrations/sources/sql/__init__.py +0 -0
- mage_integrations/sources/sql/base.py +464 -0
- mage_integrations/sources/sql/constants.py +10 -0
- mage_integrations/sources/sql/utils.py +77 -0
- mage_integrations/sources/stripe/README.md +43 -0
- mage_integrations/sources/stripe/__init__.py +1297 -0
- mage_integrations/sources/stripe/schemas/balance_transactions.json +145 -0
- mage_integrations/sources/stripe/schemas/charges.json +1 -0
- mage_integrations/sources/stripe/schemas/coupons.json +120 -0
- mage_integrations/sources/stripe/schemas/customers.json +501 -0
- mage_integrations/sources/stripe/schemas/disputes.json +210 -0
- mage_integrations/sources/stripe/schemas/events.json +68 -0
- mage_integrations/sources/stripe/schemas/invoice_items.json +251 -0
- mage_integrations/sources/stripe/schemas/invoice_line_items.json +504 -0
- mage_integrations/sources/stripe/schemas/invoices.json +966 -0
- mage_integrations/sources/stripe/schemas/payment_intents.json +1101 -0
- mage_integrations/sources/stripe/schemas/payout_transactions.json +20 -0
- mage_integrations/sources/stripe/schemas/payouts.json +280 -0
- mage_integrations/sources/stripe/schemas/plans.json +1 -0
- mage_integrations/sources/stripe/schemas/products.json +181 -0
- mage_integrations/sources/stripe/schemas/shared/charge.json +1896 -0
- mage_integrations/sources/stripe/schemas/shared/discount.json +177 -0
- mage_integrations/sources/stripe/schemas/shared/plan.json +190 -0
- mage_integrations/sources/stripe/schemas/shared/source.json +573 -0
- mage_integrations/sources/stripe/schemas/shared/tax_ids.json +84 -0
- mage_integrations/sources/stripe/schemas/subscription_items.json +456 -0
- mage_integrations/sources/stripe/schemas/subscriptions.json +494 -0
- mage_integrations/sources/stripe/schemas/transfers.json +170 -0
- mage_integrations/sources/stripe/templates/config.json +5 -0
- mage_integrations/sources/tableau/README.md +22 -0
- mage_integrations/sources/tableau/__init__.py +71 -0
- mage_integrations/sources/tableau/client.py +251 -0
- mage_integrations/sources/tableau/schema.py +60 -0
- mage_integrations/sources/tableau/schemas/views.json +50 -0
- mage_integrations/sources/tableau/schemas/workbooks.json +250 -0
- mage_integrations/sources/tableau/streams.py +193 -0
- mage_integrations/sources/tableau/templates/config.json +7 -0
- mage_integrations/sources/teradata/README.md +24 -0
- mage_integrations/sources/teradata/__init__.py +255 -0
- mage_integrations/sources/teradata/templates/config.json +7 -0
- mage_integrations/sources/titanic/README.md +0 -0
- mage_integrations/sources/titanic/__init__.py +34 -0
- mage_integrations/sources/titanic/schemas/passengers.json +81 -0
- mage_integrations/sources/titanic/templates/config.json +4 -0
- mage_integrations/sources/twitter_ads/README.md +29 -0
- mage_integrations/sources/twitter_ads/__init__.py +56 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/__init__.py +132 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/client.py +108 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/discover.py +31 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schema.py +223 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/account_media.json +74 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/accounts.json +45 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/advertiser_business_categories.json +25 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/campaigns.json +69 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/cards.json +37 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/cards_image_conversation.json +56 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/cards_poll.json +73 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/cards_video_conversation.json +62 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/content_categories.json +25 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/funding_instruments.json +71 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/iab_categories.json +15 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/line_item_apps.json +32 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/line_items.json +127 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/media_creatives.json +38 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/preroll_call_to_actions.json +32 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/promotable_users.json +26 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/promoted_accounts.json +35 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/promoted_tweets.json +35 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/scheduled_promoted_tweets.json +32 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/billing.json +12 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/dimensions.json +87 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/engagement_all.json +39 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/engagement_basic.json +24 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/media.json +12 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/mobile_conversion.json +60 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/mobile_conversion_obj.json +21 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_account.json +23 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_funding_instrument.json +26 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_mobile_conversion.json +23 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_organic_tweet.json +26 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_other.json +38 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/report_web_conversion.json +23 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/video.json +36 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/web_conversion.json +21 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/shared/web_conversion_obj.json +36 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/tailored_audiences.json +70 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_app_store_categories.json +18 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_conversations.json +18 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_criteria.json +44 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_devices.json +21 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_events.json +123 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_interests.json +15 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_languages.json +15 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_locations.json +21 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_network_operators.json +18 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_platform_versions.json +21 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_platforms.json +15 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_tv_markets.json +15 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/targeting_tv_shows.json +37 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/tracking_tags.json +30 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/schemas/tweets.json +920 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/streams.py +1875 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/sync.py +176 -0
- mage_integrations/sources/twitter_ads/tap_twitter_ads/transform.py +165 -0
- mage_integrations/sources/twitter_ads/templates/config.json +27 -0
- mage_integrations/sources/utils.py +318 -0
- mage_integrations/sources/zendesk/README.md +64 -0
- mage_integrations/sources/zendesk/__init__.py +45 -0
- mage_integrations/sources/zendesk/spikes/ticket_events.py +138 -0
- mage_integrations/sources/zendesk/tap_zendesk/__init__.py +253 -0
- mage_integrations/sources/zendesk/tap_zendesk/discover.py +80 -0
- mage_integrations/sources/zendesk/tap_zendesk/http.py +253 -0
- mage_integrations/sources/zendesk/tap_zendesk/metrics.py +102 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/group_memberships.json +52 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/groups.json +46 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/macros.json +116 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/organizations.json +114 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/satisfaction_ratings.json +49 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/shared/attachments.json +148 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/shared/metadata.json +145 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/shared/via.json +122 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/sla_policies.json +128 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/tags.json +20 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_audits.json +789 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_comments.json +72 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_fields.json +199 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_forms.json +113 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/ticket_metrics.json +277 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/tickets.json +393 -0
- mage_integrations/sources/zendesk/tap_zendesk/schemas/users.json +382 -0
- mage_integrations/sources/zendesk/tap_zendesk/streams.py +657 -0
- mage_integrations/sources/zendesk/tap_zendesk/sync.py +61 -0
- mage_integrations/sources/zendesk/templates/config.json +6 -0
- mage_integrations/sources/zendesk/test/__init__.py +0 -0
- mage_integrations/sources/zendesk/test/base.py +400 -0
- mage_integrations/sources/zendesk/test/test_all_fields.py +83 -0
- mage_integrations/sources/zendesk/test/test_all_streams.py +150 -0
- mage_integrations/sources/zendesk/test/test_automatic_fields.py +71 -0
- mage_integrations/sources/zendesk/test/test_bookmarks.py +160 -0
- mage_integrations/sources/zendesk/test/test_custom_fields_discover.py +43 -0
- mage_integrations/sources/zendesk/test/test_discovery.py +129 -0
- mage_integrations/sources/zendesk/test/test_minimal_selection.py +67 -0
- mage_integrations/sources/zendesk/test/test_pagination.py +74 -0
- mage_integrations/sources/zendesk/test/test_standard_bookmark.py +197 -0
- mage_integrations/sources/zendesk/test/test_start_date.py +165 -0
- mage_integrations/sources/zendesk/test/unittests/test_discovery_mode.py +308 -0
- mage_integrations/sources/zendesk/test/unittests/test_exception.py +55 -0
- mage_integrations/sources/zendesk/test/unittests/test_http.py +481 -0
- mage_integrations/sources/zendesk/test/unittests/test_init.py +23 -0
- mage_integrations/sources/zendesk/test/unittests/test_request_timeout.py +628 -0
- mage_integrations/sources/zendesk/test/unittests/test_tickets_child_stream_skip_404_error.py +82 -0
- mage_integrations/sources/zendesk/test/unittests/test_yield_records.py +193 -0
- mage_integrations/tests/__init__.py +0 -0
- mage_integrations/tests/connections/__init__.py +0 -0
- mage_integrations/tests/destinations/__init__.py +0 -0
- mage_integrations/tests/destinations/amplitude/__init__.py +0 -0
- mage_integrations/tests/destinations/amplitude/test_amplitude.py +117 -0
- mage_integrations/tests/destinations/bigquery/__init__.py +0 -0
- mage_integrations/tests/destinations/bigquery/test_bigquery.py +54 -0
- mage_integrations/tests/destinations/doris/__init__.py +0 -0
- mage_integrations/tests/destinations/doris/test_doris.py +64 -0
- mage_integrations/tests/destinations/mongodb/__init__.py +0 -0
- mage_integrations/tests/destinations/mongodb/test_mongodb.py +67 -0
- mage_integrations/tests/destinations/mssql/__init__.py +0 -0
- mage_integrations/tests/destinations/mssql/test_mssql.py +64 -0
- mage_integrations/tests/destinations/mysql/__init__.py +0 -0
- mage_integrations/tests/destinations/mysql/test_mysql.py +116 -0
- mage_integrations/tests/destinations/oracledb/__init__.py +0 -0
- mage_integrations/tests/destinations/oracledb/test_oracledb.py +63 -0
- mage_integrations/tests/destinations/postgresql/__init__.py +0 -0
- mage_integrations/tests/destinations/postgresql/test_postgres.py +60 -0
- mage_integrations/tests/destinations/redshift/__init__.py +0 -0
- mage_integrations/tests/destinations/redshift/test_redshift.py +68 -0
- mage_integrations/tests/destinations/search/__init__.py +0 -0
- mage_integrations/tests/destinations/search/test_sinks.py +71 -0
- mage_integrations/tests/destinations/snowflake/__init__.py +0 -0
- mage_integrations/tests/destinations/snowflake/test_snowflake.py +113 -0
- mage_integrations/tests/destinations/sql/__init__.py +0 -0
- mage_integrations/tests/destinations/sql/mixins.py +48 -0
- mage_integrations/tests/destinations/sql/test_truncate.py +94 -0
- mage_integrations/tests/destinations/test_base.py +557 -0
- mage_integrations/tests/sources/__init__.py +0 -0
- mage_integrations/tests/sources/amplitude/__init__.py +0 -0
- mage_integrations/tests/sources/amplitude/test_amplitude.py +232 -0
- mage_integrations/tests/sources/api/__init__.py +0 -0
- mage_integrations/tests/sources/api/test_api.py +377 -0
- mage_integrations/tests/sources/bigquery/__init__.py +0 -0
- mage_integrations/tests/sources/bigquery/test_bigquery.py +232 -0
- mage_integrations/tests/sources/couchbase/__init__.py +0 -0
- mage_integrations/tests/sources/couchbase/test_couchbase.py +379 -0
- mage_integrations/tests/sources/doris/__init__.py +0 -0
- mage_integrations/tests/sources/doris/test_doris.py +118 -0
- mage_integrations/tests/sources/mongodb/__init__.py +0 -0
- mage_integrations/tests/sources/mongodb/test_common.py +73 -0
- mage_integrations/tests/sources/mongodb/test_schema.py +91 -0
- mage_integrations/tests/sources/mysql/__init__.py +0 -0
- mage_integrations/tests/sources/mysql/test_mysql.py +114 -0
- mage_integrations/tests/sources/postgresql/__init__.py +0 -0
- mage_integrations/tests/sources/postgresql/test_postgresql.py +46 -0
- mage_integrations/tests/sources/sql/__init__.py +0 -0
- mage_integrations/tests/sources/sql/test_base.py +215 -0
- mage_integrations/tests/sources/test_base.py +404 -0
- mage_integrations/tests/test_dependency_contracts.py +28 -0
- mage_integrations/tests/utils/__init__.py +0 -0
- mage_integrations/tests/utils/test_frames.py +122 -0
- mage_integrations/transformers/__init__.py +0 -0
- mage_integrations/transformers/base.py +183 -0
- mage_integrations/transformers/utils.py +39 -0
- mage_integrations/utils/__init__.py +0 -0
- mage_integrations/utils/array.py +40 -0
- mage_integrations/utils/dates.py +45 -0
- mage_integrations/utils/dictionary.py +108 -0
- mage_integrations/utils/files.py +5 -0
- mage_integrations/utils/frames.py +123 -0
- mage_integrations/utils/logger/__init__.py +103 -0
- mage_integrations/utils/logger/constants.py +11 -0
- mage_integrations/utils/parsers.py +56 -0
- mage_integrations/utils/schema_helpers.py +37 -0
- mage_integrations/utils/strings.py +6 -0
- mage_integrations-0.2.1.dist-info/METADATA +304 -0
- mage_integrations-0.2.1.dist-info/RECORD +1016 -0
- mage_integrations-0.2.1.dist-info/WHEEL +5 -0
- mage_integrations-0.2.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from mage_integrations.connections.sql.base import Connection
|
|
2
|
+
from redshift_connector import connect
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Redshift(Connection):
|
|
6
|
+
def __init__(
|
|
7
|
+
self,
|
|
8
|
+
access_key_id: str = None,
|
|
9
|
+
cluster_identifier: str = None,
|
|
10
|
+
database: str = None,
|
|
11
|
+
db_user: str = None,
|
|
12
|
+
host: str = None,
|
|
13
|
+
password: str = None,
|
|
14
|
+
port: int = None,
|
|
15
|
+
region: str = None,
|
|
16
|
+
secret_access_key: str = None,
|
|
17
|
+
user: str = None,
|
|
18
|
+
**kwargs,
|
|
19
|
+
):
|
|
20
|
+
super().__init__(**kwargs)
|
|
21
|
+
self.access_key_id = access_key_id
|
|
22
|
+
self.cluster_identifier = cluster_identifier
|
|
23
|
+
self.database = database
|
|
24
|
+
self.db_user = db_user
|
|
25
|
+
self.host = host
|
|
26
|
+
self.password = password
|
|
27
|
+
self.port = port or 5439
|
|
28
|
+
self.region = region
|
|
29
|
+
self.secret_access_key = secret_access_key
|
|
30
|
+
self.user = user
|
|
31
|
+
|
|
32
|
+
def build_connection(self):
|
|
33
|
+
# https://github.com/aws/amazon-redshift-python-driver#connection-parameters
|
|
34
|
+
return connect(
|
|
35
|
+
access_key_id=self.access_key_id,
|
|
36
|
+
cluster_identifier=self.cluster_identifier,
|
|
37
|
+
database=self.database,
|
|
38
|
+
db_user=self.db_user,
|
|
39
|
+
host=self.host,
|
|
40
|
+
password=self.password,
|
|
41
|
+
port=self.port,
|
|
42
|
+
region=self.region,
|
|
43
|
+
secret_access_key=self.secret_access_key,
|
|
44
|
+
user=self.user,
|
|
45
|
+
)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
from snowflake.connector import connect
|
|
2
|
+
|
|
3
|
+
from mage_integrations.connections.sql.base import Connection
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Snowflake(Connection):
|
|
7
|
+
def __init__(
|
|
8
|
+
self,
|
|
9
|
+
account: str,
|
|
10
|
+
database: str,
|
|
11
|
+
schema: str,
|
|
12
|
+
username: str,
|
|
13
|
+
warehouse: str,
|
|
14
|
+
password: str = None,
|
|
15
|
+
private_key_file: str = None,
|
|
16
|
+
private_key_file_pwd: str = None,
|
|
17
|
+
role: str = None,
|
|
18
|
+
):
|
|
19
|
+
super().__init__()
|
|
20
|
+
self.account = account
|
|
21
|
+
self.database = database
|
|
22
|
+
self.schema = schema
|
|
23
|
+
self.username = username
|
|
24
|
+
self.warehouse = warehouse
|
|
25
|
+
|
|
26
|
+
self.password = password
|
|
27
|
+
self.private_key_file = private_key_file
|
|
28
|
+
self.private_key_file_pwd = private_key_file_pwd
|
|
29
|
+
self.role = role
|
|
30
|
+
|
|
31
|
+
def build_connection(self):
|
|
32
|
+
connect_kwargs = dict(
|
|
33
|
+
account=self.account,
|
|
34
|
+
database=self.database,
|
|
35
|
+
schema=self.schema,
|
|
36
|
+
user=self.username,
|
|
37
|
+
warehouse=self.warehouse,
|
|
38
|
+
)
|
|
39
|
+
if self.password:
|
|
40
|
+
connect_kwargs['password'] = self.password
|
|
41
|
+
if self.private_key_file:
|
|
42
|
+
connect_kwargs['private_key_file'] = self.private_key_file
|
|
43
|
+
if self.private_key_file_pwd:
|
|
44
|
+
connect_kwargs['private_key_file_pwd'] = self.private_key_file_pwd.encode()
|
|
45
|
+
if self.role:
|
|
46
|
+
connect_kwargs['role'] = self.role
|
|
47
|
+
return connect(**connect_kwargs)
|
|
File without changes
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import re
|
|
2
|
+
from typing import List, Tuple
|
|
3
|
+
|
|
4
|
+
from mage_integrations.connections.base import Connection as BaseConnection
|
|
5
|
+
from mage_integrations.connections.utils.sql import clean_query
|
|
6
|
+
from mage_integrations.utils.dates import utc_now
|
|
7
|
+
from mage_integrations.utils.dictionary import merge_dict
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Connection(BaseConnection):
|
|
11
|
+
def close_connection(self, connection):
|
|
12
|
+
connection.close()
|
|
13
|
+
|
|
14
|
+
def execute_with_connection(
|
|
15
|
+
self,
|
|
16
|
+
connection,
|
|
17
|
+
query_strings: List[str],
|
|
18
|
+
log_exception: bool = True,
|
|
19
|
+
) -> List[Tuple]:
|
|
20
|
+
with connection.cursor() as cursor:
|
|
21
|
+
return self.get_data_from_query_strings(
|
|
22
|
+
cursor,
|
|
23
|
+
query_strings,
|
|
24
|
+
log_exception=log_exception,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
def execute(
|
|
28
|
+
self,
|
|
29
|
+
query_strings: List[str],
|
|
30
|
+
commit=False,
|
|
31
|
+
connection=None,
|
|
32
|
+
log_exception: bool = True,
|
|
33
|
+
) -> List[List[tuple]]:
|
|
34
|
+
"""
|
|
35
|
+
Execute the provided SQL queries using the given connection, or create a new one if not
|
|
36
|
+
provided. If a new connection is created, it'll be closed automatically at the end.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
query_strings (List[str]): List of SQL queries to execute.
|
|
40
|
+
commit (bool, optional): Whether to commit the transaction. Defaults to False.
|
|
41
|
+
connection (Optional[Any], optional): An existing connection to use. If None, a new
|
|
42
|
+
connection will be created. Defaults to None.
|
|
43
|
+
|
|
44
|
+
Returns:
|
|
45
|
+
List[List[Tuple]]: A list of result sets for each query executed. Each result set is
|
|
46
|
+
represented as a list of tuples.
|
|
47
|
+
|
|
48
|
+
Raises:
|
|
49
|
+
Any exceptions raised during the execution process may propagate upward.
|
|
50
|
+
"""
|
|
51
|
+
new_connection_created = False
|
|
52
|
+
if connection is None:
|
|
53
|
+
connection = self.build_connection()
|
|
54
|
+
new_connection_created = True
|
|
55
|
+
|
|
56
|
+
data = self.execute_with_connection(
|
|
57
|
+
connection,
|
|
58
|
+
query_strings,
|
|
59
|
+
log_exception=log_exception,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
if commit:
|
|
63
|
+
connection.commit()
|
|
64
|
+
|
|
65
|
+
if new_connection_created:
|
|
66
|
+
self.close_connection(connection)
|
|
67
|
+
|
|
68
|
+
return data
|
|
69
|
+
|
|
70
|
+
def get_data_from_query_strings(
|
|
71
|
+
self,
|
|
72
|
+
cursor,
|
|
73
|
+
query_strings,
|
|
74
|
+
log_exception: bool = True,
|
|
75
|
+
):
|
|
76
|
+
data = []
|
|
77
|
+
|
|
78
|
+
for query_string in query_strings:
|
|
79
|
+
qs = query_string.strip().upper()
|
|
80
|
+
message = 'Execute generic command'
|
|
81
|
+
if re.match('^CREATE[ ]+TABLE', qs):
|
|
82
|
+
message = 'Execute create table command'
|
|
83
|
+
elif re.match('^CREATE[ ]+SCHEMA', qs):
|
|
84
|
+
message = 'Execute create schema command'
|
|
85
|
+
elif re.match('^INSERT', qs):
|
|
86
|
+
message = 'Execute insert command'
|
|
87
|
+
elif re.match('^ALTER[ ]+TABLE', qs):
|
|
88
|
+
message = 'Execute alter table command'
|
|
89
|
+
|
|
90
|
+
self.logger.info(f'{message} started.')
|
|
91
|
+
now1 = utc_now().timestamp()
|
|
92
|
+
|
|
93
|
+
try:
|
|
94
|
+
cursor.execute(clean_query(query_string))
|
|
95
|
+
description = cursor.description
|
|
96
|
+
if description:
|
|
97
|
+
data.append(cursor.fetchall())
|
|
98
|
+
except Exception as err:
|
|
99
|
+
error_message = (
|
|
100
|
+
f'Error while executing query: {str(err)}. '
|
|
101
|
+
f'Query string: {query_string[:1000]}'
|
|
102
|
+
)
|
|
103
|
+
if log_exception:
|
|
104
|
+
self.logger.error(error_message)
|
|
105
|
+
else:
|
|
106
|
+
self.logger.info(error_message)
|
|
107
|
+
raise err
|
|
108
|
+
|
|
109
|
+
now2 = utc_now().timestamp()
|
|
110
|
+
self.logger.info(f'{message} completed.', tags=dict(
|
|
111
|
+
time=now2 - now1,
|
|
112
|
+
))
|
|
113
|
+
|
|
114
|
+
return data
|
|
115
|
+
|
|
116
|
+
def load(self, query_string: str) -> List[List[tuple]]:
|
|
117
|
+
tags = merge_dict(self.build_tags(), dict(query=query_string))
|
|
118
|
+
self.info('Load started.', tags=tags)
|
|
119
|
+
data = self.execute([
|
|
120
|
+
query_string,
|
|
121
|
+
])
|
|
122
|
+
self.info('Load completed.', tags=merge_dict(tags, dict(count=len(data))))
|
|
123
|
+
|
|
124
|
+
return data[0]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
from teradatasql import connect
|
|
2
|
+
|
|
3
|
+
from mage_integrations.connections.sql.base import Connection
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Teradata(Connection):
|
|
7
|
+
"""
|
|
8
|
+
Use teradatasql library: https://github.com/Teradata/python-driver
|
|
9
|
+
"""
|
|
10
|
+
def __init__(
|
|
11
|
+
self,
|
|
12
|
+
database: str = None,
|
|
13
|
+
host: str = None,
|
|
14
|
+
password: str = None,
|
|
15
|
+
port: int = 1025,
|
|
16
|
+
username: str = None,
|
|
17
|
+
**kwargs,
|
|
18
|
+
):
|
|
19
|
+
super().__init__(**kwargs)
|
|
20
|
+
self.database = database
|
|
21
|
+
self.host = host
|
|
22
|
+
self.password = password
|
|
23
|
+
self.port = port or 1025
|
|
24
|
+
self.username = username
|
|
25
|
+
|
|
26
|
+
def build_connection(self):
|
|
27
|
+
return connect(
|
|
28
|
+
database=self.database,
|
|
29
|
+
dbs_port=self.port,
|
|
30
|
+
host=self.host,
|
|
31
|
+
password=self.password,
|
|
32
|
+
user=self.username,
|
|
33
|
+
)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from mage_integrations.connections.sql.base import Connection
|
|
2
|
+
from mage_integrations.connections.trino.connection_wrapper import ConnectionWrapper
|
|
3
|
+
from trino.auth import BasicAuthentication
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Trino(Connection):
|
|
7
|
+
def __init__(
|
|
8
|
+
self,
|
|
9
|
+
catalog: str,
|
|
10
|
+
host: str,
|
|
11
|
+
username: str,
|
|
12
|
+
password: str = None,
|
|
13
|
+
port: int = None,
|
|
14
|
+
schema: str = None,
|
|
15
|
+
verify: bool = False,
|
|
16
|
+
):
|
|
17
|
+
super().__init__()
|
|
18
|
+
self.catalog = catalog
|
|
19
|
+
self.host = host
|
|
20
|
+
self.password = password
|
|
21
|
+
self.port = port or 8080
|
|
22
|
+
self.schema = schema
|
|
23
|
+
self.username = username
|
|
24
|
+
self.verify = verify
|
|
25
|
+
|
|
26
|
+
def build_connection(self):
|
|
27
|
+
connect_kwargs = dict(
|
|
28
|
+
catalog=self.catalog,
|
|
29
|
+
host=self.host,
|
|
30
|
+
port=self.port,
|
|
31
|
+
schema=self.schema,
|
|
32
|
+
user=self.username,
|
|
33
|
+
verify=self.verify,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
if self.password:
|
|
37
|
+
connect_kwargs['auth'] = BasicAuthentication(self.username, self.password)
|
|
38
|
+
connect_kwargs['http_scheme'] = 'https'
|
|
39
|
+
|
|
40
|
+
return ConnectionWrapper(**connect_kwargs)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from trino.dbapi import Connection, Cursor as CursorParent
|
|
2
|
+
from trino.transaction import IsolationLevel
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Cursor(CursorParent):
|
|
6
|
+
def __enter__(self):
|
|
7
|
+
return self
|
|
8
|
+
|
|
9
|
+
def __exit__(self, *args, **kwargs):
|
|
10
|
+
pass
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ConnectionWrapper(Connection):
|
|
14
|
+
def cursor(self, legacy_primitive_types: bool = None):
|
|
15
|
+
"""Return a new :py:class:`Cursor` object using the connection."""
|
|
16
|
+
if self.isolation_level != IsolationLevel.AUTOCOMMIT:
|
|
17
|
+
if self.transaction is None:
|
|
18
|
+
self.start_transaction()
|
|
19
|
+
if self.transaction is not None:
|
|
20
|
+
request = self.transaction.request
|
|
21
|
+
else:
|
|
22
|
+
request = self._create_request()
|
|
23
|
+
return Cursor(
|
|
24
|
+
self,
|
|
25
|
+
request,
|
|
26
|
+
# if legacy_primitive_types is not explicitly set in Cursor, take from Connection
|
|
27
|
+
legacy_primitive_types if legacy_primitive_types is not None else self.legacy_primitive_types
|
|
28
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from typing_extensions import TypedDict
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class CredentialsInfoType(TypedDict):
|
|
5
|
+
auth_provider_x509_cert_url: str
|
|
6
|
+
auth_uri: str
|
|
7
|
+
client_email: str
|
|
8
|
+
client_id: str
|
|
9
|
+
client_x509_cert_url: str
|
|
10
|
+
private_key: str
|
|
11
|
+
private_key_id: str
|
|
12
|
+
project_id: str
|
|
13
|
+
token_uri: str
|
|
14
|
+
type: str
|
|
File without changes
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Airtable
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
<br />
|
|
6
|
+
|
|
7
|
+
## Config
|
|
8
|
+
|
|
9
|
+
You must supply the following parameters to use this tap:
|
|
10
|
+
|
|
11
|
+
| Key | Description | Sample value | Required |
|
|
12
|
+
|--------------|--------------------------------------------------------------------------------|--------------|----------|
|
|
13
|
+
| `token` | An Airtable access token containing credentials to access your desired tables. | `pat...` | ✅ |
|
|
14
|
+
| `base_id` | The ID of the specified application inside airtable workspace | `app...` | ✅ |
|
|
15
|
+
|
|
16
|
+
<br />
|
|
17
|
+
|
|
18
|
+
## Generating credentials
|
|
19
|
+
|
|
20
|
+
See [this guide](https://airtable.com/developers/web/guides/personal-access-tokens) for generating a Personal access token.
|
|
21
|
+
|
|
22
|
+
## Scopes
|
|
23
|
+
|
|
24
|
+
Your access token should support the following scopes:
|
|
25
|
+
|
|
26
|
+
- schema.bases:write
|
|
27
|
+
- data.records:write
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import sys
|
|
3
|
+
from typing import Dict, List
|
|
4
|
+
|
|
5
|
+
from mage_ai.io.utils import map_json_to_airtable
|
|
6
|
+
from mage_integrations.connections.airtable import Airtable as AirtableConnection
|
|
7
|
+
from mage_integrations.destinations.base import Destination
|
|
8
|
+
from mage_integrations.destinations.utils import update_record_with_internal_columns
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Airtable(Destination):
|
|
12
|
+
"""
|
|
13
|
+
Airtable Destination for syncing data to Airtable
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def base_id(self):
|
|
18
|
+
return self.config.get('base_id')
|
|
19
|
+
|
|
20
|
+
def build_client(self):
|
|
21
|
+
"""
|
|
22
|
+
Build and return the Airtable API connection using the provided credentials.
|
|
23
|
+
|
|
24
|
+
:return: AirtableConnection object.
|
|
25
|
+
"""
|
|
26
|
+
self.logger.info(f"Building Airtable connection for base ID: {self.base_id}")
|
|
27
|
+
connection = AirtableConnection(self.config['token'], self.base_id)
|
|
28
|
+
return connection.build_connection()
|
|
29
|
+
|
|
30
|
+
def test_connection(self) -> None:
|
|
31
|
+
"""
|
|
32
|
+
Test the Airtable connection.
|
|
33
|
+
|
|
34
|
+
:raises Exception: If unable to connect or retrieve tables.
|
|
35
|
+
"""
|
|
36
|
+
client = self.build_client()
|
|
37
|
+
try:
|
|
38
|
+
client.tables()
|
|
39
|
+
self.logger.info("Airtable connection test successful.")
|
|
40
|
+
except Exception as e:
|
|
41
|
+
self.logger.error(f"Failed to test Airtable connection: {e}")
|
|
42
|
+
raise
|
|
43
|
+
|
|
44
|
+
def export_batch_data(self, record_data: List[Dict], stream: str, tags: Dict = None) -> None:
|
|
45
|
+
"""
|
|
46
|
+
Export batch data to Airtable
|
|
47
|
+
"""
|
|
48
|
+
client = self.build_client()
|
|
49
|
+
|
|
50
|
+
tags = dict(
|
|
51
|
+
records=len(record_data),
|
|
52
|
+
stream=stream
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
self.logger.info(f"Creating Airtable table {stream}")
|
|
56
|
+
|
|
57
|
+
fields = [
|
|
58
|
+
{
|
|
59
|
+
'name': column,
|
|
60
|
+
'type': map_json_to_airtable(info['type']),
|
|
61
|
+
**({'options': {'precision': 2}}
|
|
62
|
+
if map_json_to_airtable(info['type']) == 'number' else {})
|
|
63
|
+
}
|
|
64
|
+
for column, info in self.schemas[stream]['properties'].items()
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
table = client.create_table(stream, fields)
|
|
68
|
+
|
|
69
|
+
self.logger.info(f"Successfully created table {table.name}")
|
|
70
|
+
|
|
71
|
+
self.logger.info('Export data started', tags=tags)
|
|
72
|
+
|
|
73
|
+
# Add _mage_created_at and _mage_updated_at columns
|
|
74
|
+
for r in record_data:
|
|
75
|
+
r['record'] = update_record_with_internal_columns(r['record'])
|
|
76
|
+
|
|
77
|
+
records = [item['record'] for item in record_data]
|
|
78
|
+
table.batch_create(records)
|
|
79
|
+
|
|
80
|
+
tags.update(
|
|
81
|
+
records_inserted=len(record_data),
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
self.logger.info('Export data completed.', tags=tags)
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
if __name__ == '__main__':
|
|
88
|
+
destination = Airtable(
|
|
89
|
+
argument_parser=argparse.ArgumentParser(),
|
|
90
|
+
batch_processing=True,
|
|
91
|
+
)
|
|
92
|
+
destination.process(sys.stdin.buffer)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Amazon S3
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
<br />
|
|
6
|
+
|
|
7
|
+
## Config
|
|
8
|
+
|
|
9
|
+
You must enter the following credentials when configuring this source:
|
|
10
|
+
|
|
11
|
+
| Key | Description | Sample value
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| `aws_access_key_id` | AWS access key ID. | `abc123` |
|
|
14
|
+
| `aws_region` | Region where the bucket is located. | `us-west-2` (default value) |
|
|
15
|
+
| `aws_secret_access_key` | AWS secret access key. | `xyz456` |
|
|
16
|
+
| `role_arn` | (Optional) The ARN of the IAM role that can be assumed to get access to S3 bucket. | `arn:aws:iam::111111:role/example-role` |
|
|
17
|
+
| `bucket` | Name of the AWS S3 bucket to save data in. | `user_generated_content` |
|
|
18
|
+
| `file_type` | The type of S3 files. Supported file type values: `parquet`, `csv`. | `parquet` or `csv` |
|
|
19
|
+
| `object_key_path` | The path of the location where you have files. Don’t include the `s3`, the bucket name, or the table name in this path value. | `users/ds/20221225` |
|
|
20
|
+
| `column_header_format` | (Optional) Select format option for the column headers. Will be applied to the column headers before writing to S3. Defaults to `null` (None). | `upper`, `lower` |
|
|
21
|
+
| `date_partition_format` | (Optional) The datetime format of the partition. If it's null, files will not be saved into paratitions. | `null`, `%Y%m%d`, `%Y%m%dT%H` |
|
|
22
|
+
| `aws_endpoint` | (Optional) Allow for MinIO support | `https://play.min.io` |
|
|
23
|
+
|
|
24
|
+
<br />
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
from datetime import datetime, timezone
|
|
5
|
+
from io import BytesIO
|
|
6
|
+
from typing import Dict, List
|
|
7
|
+
|
|
8
|
+
import boto3
|
|
9
|
+
import pandas as pd
|
|
10
|
+
from botocore.config import Config
|
|
11
|
+
|
|
12
|
+
from mage_integrations.destinations.base import Destination
|
|
13
|
+
from mage_integrations.destinations.constants import COLUMN_FORMAT_DATETIME
|
|
14
|
+
from mage_integrations.destinations.utils import update_record_with_internal_columns
|
|
15
|
+
from mage_integrations.utils.frames import (
|
|
16
|
+
batch_file_name,
|
|
17
|
+
frame_from_records,
|
|
18
|
+
nested_values_as_json,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class AmazonS3(Destination):
|
|
23
|
+
@property
|
|
24
|
+
def bucket(self) -> str:
|
|
25
|
+
return self.config['bucket']
|
|
26
|
+
|
|
27
|
+
@property
|
|
28
|
+
def file_type(self) -> str:
|
|
29
|
+
return self.config.get('file_type')
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def object_key_path(self) -> str:
|
|
33
|
+
return self.config['object_key_path']
|
|
34
|
+
|
|
35
|
+
@property
|
|
36
|
+
def region(self) -> str:
|
|
37
|
+
return self.config.get('aws_region', 'us-west-2')
|
|
38
|
+
|
|
39
|
+
@property
|
|
40
|
+
def endpoint(self) -> str:
|
|
41
|
+
return self.config.get("aws_endpoint")
|
|
42
|
+
|
|
43
|
+
def build_client(self):
|
|
44
|
+
config = Config(
|
|
45
|
+
retries={
|
|
46
|
+
'max_attempts': 10,
|
|
47
|
+
'mode': 'standard',
|
|
48
|
+
},
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
if (
|
|
52
|
+
not self.config.get('aws_access_key_id') and
|
|
53
|
+
not self.config.get('aws_secret_access_key') and
|
|
54
|
+
self.config.get('role_arn')
|
|
55
|
+
):
|
|
56
|
+
# Assume IAM role and get credentials
|
|
57
|
+
role_session_name = self.config.get('role_session_name', 'mage-data-integration')
|
|
58
|
+
sts_session = boto3.Session()
|
|
59
|
+
sts_connection = sts_session.client('sts')
|
|
60
|
+
assume_role_object = sts_connection.assume_role(
|
|
61
|
+
RoleArn=self.config.get('role_arn'),
|
|
62
|
+
RoleSessionName=role_session_name,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
session = boto3.Session(
|
|
66
|
+
aws_access_key_id=assume_role_object['Credentials']['AccessKeyId'],
|
|
67
|
+
aws_secret_access_key=assume_role_object['Credentials']['SecretAccessKey'],
|
|
68
|
+
aws_session_token=assume_role_object['Credentials']['SessionToken'],
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
return session.client(
|
|
72
|
+
's3',
|
|
73
|
+
config=config,
|
|
74
|
+
region_name=self.region,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
return boto3.client(
|
|
78
|
+
's3',
|
|
79
|
+
aws_access_key_id=self.config.get('aws_access_key_id'),
|
|
80
|
+
aws_secret_access_key=self.config.get('aws_secret_access_key'),
|
|
81
|
+
config=config,
|
|
82
|
+
region_name=self.region,
|
|
83
|
+
endpoint_url=self.endpoint,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
def export_batch_data(self, record_data: List[Dict], stream: str, tags: Dict = None) -> None:
|
|
87
|
+
client = self.build_client()
|
|
88
|
+
|
|
89
|
+
table_name = self.config.get('table')
|
|
90
|
+
|
|
91
|
+
tags = dict(
|
|
92
|
+
records=len(record_data),
|
|
93
|
+
stream=stream,
|
|
94
|
+
table_name=table_name,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
self.logger.info('Export data started', tags=tags)
|
|
98
|
+
|
|
99
|
+
# Add _mage_created_at and _mage_updated_at columns
|
|
100
|
+
for r in record_data:
|
|
101
|
+
r['record'] = update_record_with_internal_columns(r['record'])
|
|
102
|
+
|
|
103
|
+
df = frame_from_records(
|
|
104
|
+
[d['record'] for d in record_data],
|
|
105
|
+
(self.schemas or {}).get(stream, {}).get('properties'),
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
# Convert data types
|
|
109
|
+
schema = self.schemas[stream]
|
|
110
|
+
for column, column_settings in schema['properties'].items():
|
|
111
|
+
if COLUMN_FORMAT_DATETIME == column_settings.get('format'):
|
|
112
|
+
try:
|
|
113
|
+
df[column] = pd.to_datetime(df[column])
|
|
114
|
+
except Exception:
|
|
115
|
+
df[column] = pd.to_datetime(df[column], format='mixed')
|
|
116
|
+
|
|
117
|
+
column_header_format = self.config.get('column_header_format')
|
|
118
|
+
if column_header_format:
|
|
119
|
+
column_mapping = None
|
|
120
|
+
if column_header_format == 'lower':
|
|
121
|
+
column_mapping = {col: col.lower() for col in df.columns}
|
|
122
|
+
elif column_header_format == 'upper':
|
|
123
|
+
column_mapping = {col: col.upper() for col in df.columns}
|
|
124
|
+
if column_mapping:
|
|
125
|
+
df = df.rename(columns=column_mapping)
|
|
126
|
+
|
|
127
|
+
buffer = BytesIO()
|
|
128
|
+
if self.file_type == 'parquet':
|
|
129
|
+
# Microseconds keep what pandas stores; milliseconds dropped them.
|
|
130
|
+
df.to_parquet(
|
|
131
|
+
buffer,
|
|
132
|
+
coerce_timestamps='us',
|
|
133
|
+
allow_truncated_timestamps=True,
|
|
134
|
+
)
|
|
135
|
+
elif self.file_type == 'csv':
|
|
136
|
+
nested_values_as_json(df).to_csv(buffer, index=False)
|
|
137
|
+
else:
|
|
138
|
+
raise Exception(f'File type {self.file_type} is not supported.')
|
|
139
|
+
|
|
140
|
+
buffer.seek(0)
|
|
141
|
+
|
|
142
|
+
curr_time = datetime.now(timezone.utc)
|
|
143
|
+
|
|
144
|
+
filename = batch_file_name(curr_time, self.file_type)
|
|
145
|
+
|
|
146
|
+
object_key = os.path.join(self.object_key_path, table_name)
|
|
147
|
+
|
|
148
|
+
date_partition_format = self.config.get('date_partition_format')
|
|
149
|
+
if date_partition_format:
|
|
150
|
+
object_key = os.path.join(object_key, curr_time.strftime(date_partition_format))
|
|
151
|
+
|
|
152
|
+
object_key = os.path.join(object_key, filename)
|
|
153
|
+
|
|
154
|
+
client.put_object(Body=buffer, Bucket=self.bucket, Key=object_key)
|
|
155
|
+
|
|
156
|
+
tags.update(
|
|
157
|
+
records_inserted=len(record_data),
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
self.logger.info('Export data completed.', tags=tags)
|
|
161
|
+
|
|
162
|
+
def test_connection(self) -> None:
|
|
163
|
+
client = self.build_client()
|
|
164
|
+
client.head_bucket(Bucket=self.bucket)
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
if __name__ == '__main__':
|
|
168
|
+
destination = AmazonS3(
|
|
169
|
+
argument_parser=argparse.ArgumentParser(),
|
|
170
|
+
batch_processing=True,
|
|
171
|
+
)
|
|
172
|
+
destination.process(sys.stdin.buffer)
|