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.0.tar.gz (5.1 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.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sql_grain-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 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.0.tar.gz
Algorithm Hash digest
SHA256 2bc362f14c22dbe0264b18386130f03bf6792689f121f1183cac6ec70743c900
MD5 4a0de5bc7fb4ffc7f186090f817d5b9a
BLAKE2b-256 4b9ddcbc9212f691ea939285571e416e2cd4e9b661c53bc42d290b327578873f

See more details on using hashes here.

Provenance

The following attestation bundles were made for sql_grain-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: sql_grain-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 389f58ab69a8bc488fda9b11ddce7b429cfbe5d8e86c027dc8c727ee6f06fa43
MD5 ee02794ad65f62d6ac243765bc20efbf
BLAKE2b-256 517006cba69a02c87dc1f5ca672e9c17f86ee78de7a73f9673688b383dbf3db2

See more details on using hashes here.

Provenance

The following attestation bundles were made for sql_grain-0.1.0-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