Skip to main content

Sqlite databases as Grain datasets.

Project description

🌾 SQL Grain

SQLite databases as Grain data sources.

sql-grain lets you prototype ML data pipelines using SQL queries before committing to a production data format. Define your training examples with expressive SQL—joins, window functions, filtering—and iterate quickly without preprocessing. When you're ready to scale, convert to ArrayRecord or similar formats; sql-grain is not designed for large-scale training.

from sqlgrain import Sqlite3DataSource
import grain

source = Sqlite3DataSource(
    "data.db",
    key_query="SELECT id FROM users",
    record_query="SELECT item FROM purchases WHERE user_id = :id ORDER BY timestamp",
)
dataset = grain.MapDataset.source(source).shuffle().batch(32)

Project details


Download files

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

Source Distribution

sql_grain-0.1.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sql_grain-0.1.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file sql_grain-0.1.1.tar.gz.

File metadata

  • Download URL: sql_grain-0.1.1.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sql_grain-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a199a70d08cad8cd56af72b2a6b11a33706a28db8d5ff4ba507b7537c0de5a2f
MD5 6833594b3a9023cf7f52cb5b896aeb66
BLAKE2b-256 47443395b157032d8ed9f848d36cf670ab2fc5e0529cafc39ce110143355860b

See more details on using hashes here.

Provenance

The following attestation bundles were made for sql_grain-0.1.1.tar.gz:

Publisher: ci.yml on tillahoffmann/sql-grain

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sql_grain-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sql_grain-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sql_grain-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1f4229a8ed4455c0802e87e9668b8f51ce22d5632e50c63988905235511c5159
MD5 47add6cfef2f7b1db3ee2d93ed880b6b
BLAKE2b-256 aeb291e4799db0f18f54347e5eda17b89ea1f55dbc28f7637e50bc47f8089adb

See more details on using hashes here.

Provenance

The following attestation bundles were made for sql_grain-0.1.1-py3-none-any.whl:

Publisher: ci.yml on tillahoffmann/sql-grain

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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