Skip to main content

BQSeine

Bigquery AI agent and data loader

Seine is a data loader that pushes data in a dictionary to BigQuery in relational normalized form. Seine also has functionality to use Gemini to get data insights from Bigquery.

Usage

AI insights

from bqseine.agent import chat
answer, history = chat([question, context], history, temperature, mode, model, thinking)

Arguments:

  • history of type list[types.Content] (types from google.genai)
  • context argument explains to the LLM how the tables in Bigquery and their fields refer to each other and what they mean
  • temperature (set by default to 0.4) is how creative the model is allowed to get with 2 being max
  • mode (set by default to "AUTO") is the tool mode
  • model (set by default to "gemini-2.5-pro") is the AI model to be used
  • thinking (set by default to 1024) how much 'thinking' is the model allowed to do

Return:

  • answer of type str
  • history of type list[types.Content] (types from google.genai)

To run, you will need the following environment variables:

  • GOOGLE_API_KEY, storing your Google AI Studio API key
  • GOOGLE_CLOUD_PROJECT, storing your Google Cloud Project name
  • GOOGLE_APPLICATION_CREDENTIALS, that points to a credential with which you can access Bigquery

Data loading

from bqseine.polyp import sync
sourceData = [
	{
		'item': 'Juice',
		'price': 20.0,
		'stock': [
			{
				'batch': '2025-01-20',
				'qty': 300
			},
			{
				'batch': '2025-02-02',
				'qty': 50
			}
		]
	},
	{
		'item': 'Burger',
		'price': 30.0,
		'stock': [
			{
				'batch': '2025-02-10',
				'qty': 200
			}
		]
	}
]
sync('someGoogleProject', sourceData, 'catalog', 'US')
### The arguments above are:
### sync(<Google project name>, <dict>, <main table name>, <BigQuery region>)*

The above example will generate the following tables in BigQuery:

catalog

seine_id seine_parent_id item price injected
1 0 'Juice' 20.0 now()
2 0 'Burger' 30.0 now()

catalog_stock

seine_id seine_parent_id batch qty injected
1 1 '2025-01-20' 300 now()
2 1 '2025-02-02' 50 now()
3 2 '2025-02-10' 200 now()

Metadata

Release files for bqseine 4.50.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bqseine 4.50.0
File Size Uploaded Provenance Actions
bqseine-4.50.0.tar.gz 29.4 kB Without provenance Details for bqseine-4.50.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bqseine 4.50.0
File Interpreter ABI Platform Actions
bqseine-4.50.0-py3-none-any.whl Python 3 none any Details for bqseine-4.50.0-py3-none-any.whl

Total release size: 70.9 kB

Release files / bqseine-4.50.0.tar.gz

Download URL bqseine-4.50.0.tar.gz
Size 29.4 kB
Tags Source
SHA-256 checksum
How to use checksums
55821e13f5ad219ca80d96d9335c87d6d23ed3436b45607f79ea23b8dc7ab687
BLAKE2b-256 checksum
How to use checksums
6ed21abda0cbd9fc84c5bd4b99cf44eb07deafa69e66fc086bbd1cc9c7cdb296
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Release files / bqseine-4.50.0-py3-none-any.whl

Download URL bqseine-4.50.0-py3-none-any.whl
Size 41.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b10f4df5455c93fb2a9fe0ea8bdd2b5efc9c1bf55007015e5fd89ce5e4379579
BLAKE2b-256 checksum
How to use checksums
095764e334f9aafcc065ca035183fa177b1e70f447e091dc957bc9594a8f6258
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.12

Security for bqseine 4.50.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

4.50.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page