From d23dfa708179a35cb2d9d7621d5d8d5d09304020 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 12 Apr 2023 02:18:02 +0000 Subject: automatic import of python-streaming-form-data --- python-streaming-form-data.spec | 302 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 302 insertions(+) create mode 100644 python-streaming-form-data.spec (limited to 'python-streaming-form-data.spec') diff --git a/python-streaming-form-data.spec b/python-streaming-form-data.spec new file mode 100644 index 0000000..9ca35f6 --- /dev/null +++ b/python-streaming-form-data.spec @@ -0,0 +1,302 @@ +%global _empty_manifest_terminate_build 0 +Name: python-streaming-form-data +Version: 1.11.0 +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/2c/6c/a6666cadf14b7bcb27f214a2325b9c72a35a0f3f34fbcda3890e53488468/streaming-form-data-1.11.0.tar.gz + + +%description +# Streaming multipart/form-data parser + +[![image](https://github.com/siddhantgoel/streaming-form-data/workflows/streaming-form-data/badge.svg)](https://github.com/siddhantgoel/streaming-form-data/workflows/streaming-form-data/badge.svg) + +[![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 `master` 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.6+ 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. That's basically it. You should now be able to run the test suite: + `make test`. + +[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/workflows/streaming-form-data/badge.svg)](https://github.com/siddhantgoel/streaming-form-data/workflows/streaming-form-data/badge.svg) + +[![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 `master` 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.6+ 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. That's basically it. You should now be able to run the test suite: + `make test`. + +[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/workflows/streaming-form-data/badge.svg)](https://github.com/siddhantgoel/streaming-form-data/workflows/streaming-form-data/badge.svg) + +[![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 `master` 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.6+ 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. That's basically it. You should now be able to run the test suite: + `make test`. + +[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.0 + +%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 +* Wed Apr 12 2023 Python_Bot - 1.11.0-1 +- Package Spec generated -- cgit v1.2.3