{"id":13634509,"url":"https://github.com/siddhantgoel/streaming-form-data","last_synced_at":"2025-04-04T12:09:19.176Z","repository":{"id":19444841,"uuid":"81488128","full_name":"siddhantgoel/streaming-form-data","owner":"siddhantgoel","description":"Streaming (and fast!) parser for multipart/form-data written in Cython","archived":false,"fork":false,"pushed_at":"2024-04-21T19:00:51.000Z","size":13026,"stargazers_count":151,"open_issues_count":4,"forks_count":32,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-05-02T02:15:31.754Z","etag":null,"topics":["cython","form-data","forms","http","multipart-formdata","python","python3","web"],"latest_commit_sha":null,"homepage":"https://streaming-form-data.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/siddhantgoel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"siddhantgoel"}},"created_at":"2017-02-09T19:43:21.000Z","updated_at":"2024-05-12T17:38:17.605Z","dependencies_parsed_at":"2023-01-13T20:22:29.640Z","dependency_job_id":"e41221ac-931c-43d2-993a-d7ec272dd5e1","html_url":"https://github.com/siddhantgoel/streaming-form-data","commit_stats":{"total_commits":471,"total_committers":16,"mean_commits":29.4375,"dds":0.5498938428874734,"last_synced_commit":"4399bfaa2e9973f1663276250cc726e1fe0e1c1d"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddhantgoel%2Fstreaming-form-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddhantgoel%2Fstreaming-form-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddhantgoel%2Fstreaming-form-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siddhantgoel%2Fstreaming-form-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siddhantgoel","download_url":"https://codeload.github.com/siddhantgoel/streaming-form-data/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247174454,"owners_count":20896078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cython","form-data","forms","http","multipart-formdata","python","python3","web"],"created_at":"2024-08-01T23:01:06.593Z","updated_at":"2025-04-04T12:09:19.145Z","avatar_url":"https://github.com/siddhantgoel.png","language":"Python","funding_links":["https://github.com/sponsors/siddhantgoel"],"categories":["Python","Others"],"sub_categories":[],"readme":"# Streaming multipart/form-data parser\n\n[![image](https://img.shields.io/pypi/v/streaming-form-data.svg)](https://pypi.python.org/pypi/streaming-form-data)\n[![image](https://img.shields.io/pypi/pyversions/streaming-form-data.svg)](https://pypi.python.org/pypi/streaming-form-data)\n[![Downloads](https://static.pepy.tech/badge/streaming-form-data)](https://pepy.tech/project/streaming-form-data)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n\n`streaming_form_data` provides a Python parser for parsing `multipart/form-data`\ninput chunks (the encoding used when submitting data over HTTP through HTML\nforms).\n\n## Testimonials\n\n\u003e [_this speeds up file uploads to my Flask app by **more than factor 10**_](https://github.com/pallets/werkzeug/issues/875#issuecomment-429287766)\n\n\u003e [_Thanks a lot for your fix with streaming-form-data. I can finally upload gigabyte sized files at good speed and without memory filling up!_](https://github.com/pallets/werkzeug/issues/875#issuecomment-530020990)\n\n\u003e [_huge thanks to @siddhantgoel with his \"streaming-form-data\" that saves me from the slow file reads I get with @FastAPI!_](https://twitter.com/bebenzrr/status/1654952147132248064)\n\n## Installation\n\n```bash\n$ pip install streaming-form-data\n```\n\nIn case you prefer cloning the Github repository and installing manually, please\nnote that `main` is the development branch, so `stable` is what you should be\nworking with.\n\n## Usage\n\n```python\n\u003e\u003e\u003e from streaming_form_data import StreamingFormDataParser\n\u003e\u003e\u003e from streaming_form_data.targets import FileTarget, NullTarget, GCSTarget, S3Target, ValueTarget\n\u003e\u003e\u003e\n\u003e\u003e\u003e headers = {\"Content-Type\": \"multipart/form-data; boundary=boundary\"}\n\u003e\u003e\u003e\n\u003e\u003e\u003e parser = StreamingFormDataParser(headers=headers)\n\u003e\u003e\u003e\n\u003e\u003e\u003e parser.register(\"name\", ValueTarget())\n\u003e\u003e\u003e parser.register(\"file-local\", FileTarget(\"/path/to/file.txt\"))\n\u003e\u003e\u003e parser.register(\"file-s3\", S3Target(\"s3://bucket/path/to/key\"))\n\u003e\u003e\u003e parser.register(\"file-gcs\", GCSTarget(\"gs://bucket/path/to/key\"))\n\u003e\u003e\u003e parser.register(\"discard-me\", NullTarget())\n\u003e\u003e\u003e\n\u003e\u003e\u003e for chunk in request.body:\n...     parser.data_received(chunk)\n...\n\u003e\u003e\u003e\n```\n\n## Documentation\n\nUp-to-date documentation is available on [Read the Docs].\n\n## Development\n\nPlease make sure you have Python 3.9+, [uv], and [task] installed.\n\nSince this package includes a C extension, please make sure you have a working C\ncompiler available. On Debian-based distros this usually means installing the\n`build-essentials` package.\n\n1. Git clone the repository:\n   `git clone https://github.com/siddhantgoel/streaming-form-data`\n\n2. Install the packages required for development: `uv sync`\n\n4. That's basically it. You should now be able to run the test suite: `task test`\n\nNote that if you make any changes to Cython files (`.pyx, .pxd, .pxi`), you'll need to\nre-compile (`task compile`) and re-install `streaming_form_data` before you can test\nyour changes.\n\n[Read the Docs]: https://streaming-form-data.readthedocs.io\n[task]: https://taskfile.dev\n[uv]: https://docs.astral.sh/uv/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiddhantgoel%2Fstreaming-form-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiddhantgoel%2Fstreaming-form-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiddhantgoel%2Fstreaming-form-data/lists"}