{"id":16183685,"url":"https://github.com/banditml/faucetml","last_synced_at":"2026-02-11T20:02:37.486Z","repository":{"id":57428760,"uuid":"234428977","full_name":"banditml/faucetml","owner":"banditml","description":"High speed mini-batch data reading \u0026 preprocessing from BigQuery.","archived":false,"fork":false,"pushed_at":"2020-01-30T01:51:49.000Z","size":52,"stargazers_count":22,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2026-01-14T11:35:31.095Z","etag":null,"topics":["bigquery","feature-engineering","features","machine-learning","ml","preprocessing","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/banditml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-16T23:06:35.000Z","updated_at":"2024-10-16T17:11:52.000Z","dependencies_parsed_at":"2022-09-02T17:23:24.016Z","dependency_job_id":null,"html_url":"https://github.com/banditml/faucetml","commit_stats":null,"previous_names":["econti/faucetml"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/banditml/faucetml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banditml%2Ffaucetml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banditml%2Ffaucetml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banditml%2Ffaucetml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banditml%2Ffaucetml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/banditml","download_url":"https://codeload.github.com/banditml/faucetml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banditml%2Ffaucetml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29343683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T18:58:20.535Z","status":"ssl_error","status_checked_at":"2026-02-11T18:56:44.814Z","response_time":97,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bigquery","feature-engineering","features","machine-learning","ml","preprocessing","pytorch"],"created_at":"2024-10-10T07:05:54.786Z","updated_at":"2026-02-11T20:02:37.446Z","avatar_url":"https://github.com/banditml.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# Faucet ML\n[![PyPI version](https://badge.fury.io/py/faucetml.svg)](https://badge.fury.io/py/faucetml)\n\nFaucet ML is a Python package that enables high speed mini-batch data reading \u0026 preprocessing from BigQuery for machine learning model training.\n\nFaucet ML is designed for cases where:\n* Datasets are too large to fit into memory\n* Model training requires mini-batches of data (SGD based algorithms)\n\nFeatures:\n* High speed batch data reading from BigQuery\n* Automatic feature identification and preprocessing via. PyTorch\n* Integration with [Feast](https://github.com/gojek/feast) feature store (coming soon)\n\n### Installation\n```\npip install faucetml\n```\n\n### More about Faucet\nMany training datasets are too large to fit in memory, but model training would benefit from using all of the training data. Naively issuing 1 query per mini-batch of data is unnecessarily expensive due round-trip network costs. Faucet is a library that solves these issues by:\n* Fetching large \"chunks\" of data in non-blocking background threads\n\t* where chunks are much larger than mini-batches, but still fit in memory\n* Caching  chunks locally\n* Returning mini-batches from cached chunks in O(1) time\n\n\n### Examples\nSee [examples](https://github.com/econti/faucetml/tree/master/examples) for detailed ipython notebook examples on how to use Faucet.\n\n```\n# initialize the client\nfml = get_client(\n    datastore=\"bigquery\",\n    credential_path=\"bq_creds.json\",\n    table_name=\"my_training_table\",\n    ds=\"2020-01-20\",\n    epochs=2,\n    batch_size=1024\n    chunk_size=1024 * 10000,\n    test_split_percent=20,\n)\n```\n\n```\n# train \u0026 test\nfor epoch in range(2):\n\n    # training loop\n    fml.prep_for_epoch()\n    batch = fml.get_batch()\n    while batch is not None:\n        train(batch)\n        batch = fml.get_batch()\n\n    # evaluation loop\n    fml.prep_for_eval()\n    batch = fml.get_batch(eval=True)\n    while batch is not None:\n        test(batch)\n        batch = fml.get_batch(eval=True)\n```\n\n### Future features\n- [ ] Support more data warehouses (redshift, hive, etc.)\n- [ ] Support reading features \u0026 preprocessing specs from [Feast](https://github.com/gojek/feast)\n\nSuggestions for other features? Open an issue and let us know.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanditml%2Ffaucetml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbanditml%2Ffaucetml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanditml%2Ffaucetml/lists"}