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
- Extracts data from a specified BigQuery table.
- Converts the extracted data to a CSV format.
- Sends the CSV data as an email attachment.
- Configurable email settings for SMTP server, port, and credentials.
Requirements
- Python 3.x
- Google Cloud BigQuery client library
- pandas library
- 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:
- BQ_PROJECT_ID (str): The BigQuery project ID.
- BQ_DATASET_ID (str): The BigQuery dataset ID.
- BQ_TABLE_ID (str): The BigQuery table ID.
- RECIPIENT_EMAIL (str): The recipient email address.
- SMTP_SERVER (str): The SMTP server for sending emails.
- SMTP_PORT (int): The port for the SMTP server.
- SMTP_USER (str): The SMTP server user.
- SMTP_PASSWORD (str): The SMTP server password.
- EMAIL_SUBJECT (str): The subject of the email.
- EMAIL_BODY (str): The body of the email.
- ATTACHMENT_FILENAME (str): The filename for the CSV attachment.
Acknowledgements
- Google Cloud BigQuery Python Client Library
- pandas for data manipulation
- smtplib for email handling
For any issues or questions, please open an issue in this repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file Bigquery_Email_extractor-0.0.tar.gz
.
File metadata
- Download URL: Bigquery_Email_extractor-0.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dad9e13bd2f555c3b076ca76399afff5ac6f7329277708aaf7cb103795506f24 |
|
MD5 | 04afe3bc07a72ca097f7e4934c8d5742 |
|
BLAKE2b-256 | daba619525e98f2c4872ca8b62ec2a7e4a0bf41f66da81dedbe4fbb63fe9be27 |
File details
Details for the file Bigquery_Email_extractor-0.0-py3-none-any.whl
.
File metadata
- Download URL: Bigquery_Email_extractor-0.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f4912c54a9cc0e3a77e6681589e905d048b09faa405cf65499f759c75a28adc |
|
MD5 | c9c5e27efd4e45e7be0bea0a1929ffd1 |
|
BLAKE2b-256 | 024ac33c0eecc13d4cfcae539a165692a0669617e7e92666b18a3263001fbb33 |