%global _empty_manifest_terminate_build 0 Name: python-streaming-form-data Version: 1.11.1 Release: 1 Summary: Streaming parser for multipart/form-data License: MIT License URL: https://github.com/siddhantgoel/streaming-form-data Source0: https://mirrors.nju.edu.cn/pypi/web/packages/b8/e3/c2edd5fe7eb84bf9a1dbda7527606998daa6b142f8d5c6e081ab4eb26700/streaming-form-data-1.11.1.tar.gz %description # Streaming multipart/form-data parser [![image](https://github.com/siddhantgoel/streaming-form-data/actions/workflows/test.yml/badge.svg)](https://github.com/siddhantgoel/streaming-form-data/actions/workflows/test.yml) [![image](https://github.com/siddhantgoel/streaming-form-data/actions/workflows/build.yml/badge.svg)](https://github.com/siddhantgoel/streaming-form-data/actions/workflows/build.yml) [![image](https://img.shields.io/pypi/v/streaming-form-data.svg)](https://pypi.python.org/pypi/streaming-form-data) [![image](https://img.shields.io/pypi/pyversions/streaming-form-data.svg)](https://pypi.python.org/pypi/streaming-form-data) [![image](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) `streaming_form_data` provides a Python parser for parsing `multipart/form-data` input chunks (the encoding used when submitting data over HTTP through HTML forms). ## Testimonials > "[_this speeds up file uploads to my Flask app by **more than factor 10**_](https://github.com/pallets/werkzeug/issues/875#issuecomment-429287766)" > "[_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)" ## Installation ```bash $ pip install streaming-form-data ``` In case you prefer cloning the Github repository and installing manually, please note that `main` is the development branch, so `stable` is what you should be working with. ## Usage ```python >>> from streaming_form_data import StreamingFormDataParser >>> from streaming_form_data.targets import ValueTarget, FileTarget, NullTarget >>> >>> headers = {'Content-Type': 'multipart/form-data; boundary=boundary'} >>> >>> parser = StreamingFormDataParser(headers=headers) >>> >>> parser.register('name', ValueTarget()) >>> parser.register('file', FileTarget('/tmp/file.txt')) >>> parser.register('discard-me', NullTarget()) >>> >>> for chunk in request.body: ... parser.data_received(chunk) ... >>> ``` ## Documentation Up-to-date documentation is available on [Read the Docs]. ## Development Please make sure you have Python 3.8+ and [pip-tools] installed. Since this package includes a C extension, please make sure you have a working C compiler available. On Debian-based distros this usually means installing the `build-essentials` package. 1. Git clone the repository: `git clone https://github.com/siddhantgoel/streaming-form-data` 2. Install the packages required for development: `make pip-sync` 3. Install `streaming_form_data` itself: `pip install .` 4. That's basically it. You should now be able to run the test suite: `make test` Note that if you make any changes to Cython files (`.pyx, .pxd, .pxi`), you'll need to re-compile (`make compile`) and re-install `streaming_form_data` before you can test your changes. [pip-tools]: https://pypi.org/project/pip-tools/ [Read the Docs]: https://streaming-form-data.readthedocs.io/ %package -n python3-streaming-form-data Summary: Streaming parser for multipart/form-data Provides: python-streaming-form-data BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip BuildRequires: python3-cffi BuildRequires: gcc BuildRequires: gdb %description -n python3-streaming-form-data # Streaming multipart/form-data parser [![image](https://github.com/siddhantgoel/streaming-form-data/actions/workflows/test.yml/badge.svg)](https://github.com/siddhantgoel/streaming-form-data/actions/workflows/test.yml) [![image](https://github.com/siddhantgoel/streaming-form-data/actions/workflows/build.yml/badge.svg)](https://github.com/siddhantgoel/streaming-form-data/actions/workflows/build.yml) [![image](https://img.shields.io/pypi/v/streaming-form-data.svg)](https://pypi.python.org/pypi/streaming-form-data) [![image](https://img.shields.io/pypi/pyversions/streaming-form-data.svg)](https://pypi.python.org/pypi/streaming-form-data) [![image](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) `streaming_form_data` provides a Python parser for parsing `multipart/form-data` input chunks (the encoding used when submitting data over HTTP through HTML forms). ## Testimonials > "[_this speeds up file uploads to my Flask app by **more than factor 10**_](https://github.com/pallets/werkzeug/issues/875#issuecomment-429287766)" > "[_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)" ## Installation ```bash $ pip install streaming-form-data ``` In case you prefer cloning the Github repository and installing manually, please note that `main` is the development branch, so `stable` is what you should be working with. ## Usage ```python >>> from streaming_form_data import StreamingFormDataParser >>> from streaming_form_data.targets import ValueTarget, FileTarget, NullTarget >>> >>> headers = {'Content-Type': 'multipart/form-data; boundary=boundary'} >>> >>> parser = StreamingFormDataParser(headers=headers) >>> >>> parser.register('name', ValueTarget()) >>> parser.register('file', FileTarget('/tmp/file.txt')) >>> parser.register('discard-me', NullTarget()) >>> >>> for chunk in request.body: ... parser.data_received(chunk) ... >>> ``` ## Documentation Up-to-date documentation is available on [Read the Docs]. ## Development Please make sure you have Python 3.8+ and [pip-tools] installed. Since this package includes a C extension, please make sure you have a working C compiler available. On Debian-based distros this usually means installing the `build-essentials` package. 1. Git clone the repository: `git clone https://github.com/siddhantgoel/streaming-form-data` 2. Install the packages required for development: `make pip-sync` 3. Install `streaming_form_data` itself: `pip install .` 4. That's basically it. You should now be able to run the test suite: `make test` Note that if you make any changes to Cython files (`.pyx, .pxd, .pxi`), you'll need to re-compile (`make compile`) and re-install `streaming_form_data` before you can test your changes. [pip-tools]: https://pypi.org/project/pip-tools/ [Read the Docs]: https://streaming-form-data.readthedocs.io/ %package help Summary: Development documents and examples for streaming-form-data Provides: python3-streaming-form-data-doc %description help # Streaming multipart/form-data parser [![image](https://github.com/siddhantgoel/streaming-form-data/actions/workflows/test.yml/badge.svg)](https://github.com/siddhantgoel/streaming-form-data/actions/workflows/test.yml) [![image](https://github.com/siddhantgoel/streaming-form-data/actions/workflows/build.yml/badge.svg)](https://github.com/siddhantgoel/streaming-form-data/actions/workflows/build.yml) [![image](https://img.shields.io/pypi/v/streaming-form-data.svg)](https://pypi.python.org/pypi/streaming-form-data) [![image](https://img.shields.io/pypi/pyversions/streaming-form-data.svg)](https://pypi.python.org/pypi/streaming-form-data) [![image](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) `streaming_form_data` provides a Python parser for parsing `multipart/form-data` input chunks (the encoding used when submitting data over HTTP through HTML forms). ## Testimonials > "[_this speeds up file uploads to my Flask app by **more than factor 10**_](https://github.com/pallets/werkzeug/issues/875#issuecomment-429287766)" > "[_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)" ## Installation ```bash $ pip install streaming-form-data ``` In case you prefer cloning the Github repository and installing manually, please note that `main` is the development branch, so `stable` is what you should be working with. ## Usage ```python >>> from streaming_form_data import StreamingFormDataParser >>> from streaming_form_data.targets import ValueTarget, FileTarget, NullTarget >>> >>> headers = {'Content-Type': 'multipart/form-data; boundary=boundary'} >>> >>> parser = StreamingFormDataParser(headers=headers) >>> >>> parser.register('name', ValueTarget()) >>> parser.register('file', FileTarget('/tmp/file.txt')) >>> parser.register('discard-me', NullTarget()) >>> >>> for chunk in request.body: ... parser.data_received(chunk) ... >>> ``` ## Documentation Up-to-date documentation is available on [Read the Docs]. ## Development Please make sure you have Python 3.8+ and [pip-tools] installed. Since this package includes a C extension, please make sure you have a working C compiler available. On Debian-based distros this usually means installing the `build-essentials` package. 1. Git clone the repository: `git clone https://github.com/siddhantgoel/streaming-form-data` 2. Install the packages required for development: `make pip-sync` 3. Install `streaming_form_data` itself: `pip install .` 4. That's basically it. You should now be able to run the test suite: `make test` Note that if you make any changes to Cython files (`.pyx, .pxd, .pxi`), you'll need to re-compile (`make compile`) and re-install `streaming_form_data` before you can test your changes. [pip-tools]: https://pypi.org/project/pip-tools/ [Read the Docs]: https://streaming-form-data.readthedocs.io/ %prep %autosetup -n streaming-form-data-1.11.1 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-streaming-form-data -f filelist.lst %dir %{python3_sitearch}/* %files help -f doclist.lst %{_docdir}/* %changelog * Tue Apr 25 2023 Python_Bot - 1.11.1-1 - Package Spec generated