Skip to main content

No project description provided

Project description

BigQuery Email Extractor is a Python library designed to extract data from a Google BigQuery table and send it as a CSV attachment via email. This library simplifies the process of exporting data from BigQuery and distributing it through email.

Features

  1. Extracts data from a specified BigQuery table.
  2. Converts the extracted data to a CSV format.
  3. Sends the CSV data as an email attachment.
  4. Configurable email settings for SMTP server, port, and credentials.

Requirements

  1. Python 3.x
  2. Google Cloud BigQuery client library
  3. pandas library
  4. smtplib for sending emails

Installation Install the package via pip:

pip install bigquery-email-extractor

Dependencies

Make sure to have these installed using:

pip install google-cloud-bigquery pandas

Example Usage:

from bigquery_email_extractor import bigquery_email_extractor

bigquery_email_extractor(
    BQ_PROJECT_ID='your-project-id',
    BQ_DATASET_ID='your-dataset-id',
    BQ_TABLE_ID='your-table-id',
    RECIPIENT_EMAIL='recipient@example.com',
    SMTP_SERVER='smtp.example.com',
    SMTP_PORT=587,
    SMTP_USER='your-smtp-user',
    SMTP_PASSWORD='your-smtp-password',
    EMAIL_SUBJECT='BigQuery Data',
    EMAIL_BODY='Please find the attached BigQuery data.',
    ATTACHMENT_FILENAME='data.csv'
)

Parameters:

  1. BQ_PROJECT_ID (str): The BigQuery project ID.
  2. BQ_DATASET_ID (str): The BigQuery dataset ID.
  3. BQ_TABLE_ID (str): The BigQuery table ID.
  4. RECIPIENT_EMAIL (str): The recipient email address.
  5. SMTP_SERVER (str): The SMTP server for sending emails.
  6. SMTP_PORT (int): The port for the SMTP server.
  7. SMTP_USER (str): The SMTP server user.
  8. SMTP_PASSWORD (str): The SMTP server password.
  9. EMAIL_SUBJECT (str): The subject of the email.
  10. EMAIL_BODY (str): The body of the email.
  11. ATTACHMENT_FILENAME (str): The filename for the CSV attachment.

Acknowledgements

  1. Google Cloud BigQuery Python Client Library
  2. pandas for data manipulation
  3. smtplib for email handling

For any issues or questions, please open an issue in this repository.

Project details


Release history Release notifications | RSS feed

This version

0.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Bigquery_Email_extractor-0.0.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

Bigquery_Email_extractor-0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file Bigquery_Email_extractor-0.0.tar.gz.

File metadata

File hashes

Hashes for Bigquery_Email_extractor-0.0.tar.gz
Algorithm Hash digest
SHA256 dad9e13bd2f555c3b076ca76399afff5ac6f7329277708aaf7cb103795506f24
MD5 04afe3bc07a72ca097f7e4934c8d5742
BLAKE2b-256 daba619525e98f2c4872ca8b62ec2a7e4a0bf41f66da81dedbe4fbb63fe9be27

See more details on using hashes here.

File details

Details for the file Bigquery_Email_extractor-0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for Bigquery_Email_extractor-0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f4912c54a9cc0e3a77e6681589e905d048b09faa405cf65499f759c75a28adc
MD5 c9c5e27efd4e45e7be0bea0a1929ffd1
BLAKE2b-256 024ac33c0eecc13d4cfcae539a165692a0669617e7e92666b18a3263001fbb33

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page