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.30.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bqseine-4.30.0.tar.gz | 29.3 kB | Without provenance | Details for bqseine-4.30.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bqseine-4.30.0-py3-none-any.whl | Python 3 | none | any | Details for bqseine-4.30.0-py3-none-any.whl |
Total release size: 70.8 kB
Release files / bqseine-4.30.0.tar.gz
| Download URL | bqseine-4.30.0.tar.gz |
|---|---|
| Size | 29.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8f0e30c668cc29e1a7d800737679d22583dbf5f19f9dd1890940c0ae95f8fbb7
|
|
BLAKE2b-256 checksum How to use checksums |
2574f2e6928d1e7d9ac3317dad9cdddfbe3178bb8de65300cfee81ec4b110be3
|
| 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.30.0-py3-none-any.whl
| Download URL | bqseine-4.30.0-py3-none-any.whl |
|---|---|
| Size | 41.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1f0e6c4bbaca98ffed167e49d18bf7e8af70e75385c9e0b533d87176b907ed79
|
|
BLAKE2b-256 checksum How to use checksums |
e81ba7069c2e7ee051142b65a3b3d846c35f5874309c31c4129035d5b0b93b27
|
| 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.30.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.