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.40.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.40.0
File Size Uploaded Provenance Actions
bqseine-4.40.0.tar.gz 29.4 kB Without provenance Details for bqseine-4.40.0.tar.gz

Built distribution (wheel)

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

Total release size: 70.8 kB

Release files / bqseine-4.40.0.tar.gz

Download URL bqseine-4.40.0.tar.gz
Size 29.4 kB
Tags Source
SHA-256 checksum
How to use checksums
180ac1a98784beb650766616cefdbdca2996a85162026f468e87d01f46f111a5
BLAKE2b-256 checksum
How to use checksums
e0f072ecd1de782df6bc825987cc0ad3c587359476feeab70de2b65ca2b143c6
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.40.0-py3-none-any.whl

Download URL bqseine-4.40.0-py3-none-any.whl
Size 41.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d93344f7b24a55917c0eb0fe837c714b8b2b1b4ad7137ba63654d31f011c3b0
BLAKE2b-256 checksum
How to use checksums
9b3f977b38b60bad61806916fff2a0f73824b1160d259f4e175790932bba6bc9
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.40.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.40.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