PKG-INFO 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. Metadata-Version: 2.1
  2. Name: zipfly
  3. Version: 6.0.4
  4. Summary: ZipFly
  5. Home-page: http://github.com/buzonIO/zipfly
  6. Author: Buzon
  7. Author-email: support@buzon.io
  8. License: UNKNOWN
  9. Download-URL: https://github.com/BuzonIO/zipfly/archive/v6.0.4.tar.gz
  10. Keywords: zipfly,buzon
  11. Platform: UNKNOWN
  12. Classifier: Development Status :: 5 - Production/Stable
  13. Classifier: Intended Audience :: Developers
  14. Classifier: Topic :: Software Development :: Build Tools
  15. Classifier: License :: OSI Approved :: MIT License
  16. Classifier: Programming Language :: Python :: 3.6
  17. Classifier: Programming Language :: Python :: 3.7
  18. Classifier: Programming Language :: Python :: 3.8
  19. Classifier: Programming Language :: Python :: 3.9
  20. Description-Content-Type: text/markdown
  21. License-File: LICENSE
  22. [![Build Status](https://img.shields.io/circleci/build/github/sandes/zipfly/master)](https://app.circleci.com/pipelines/github/sandes/zipfly)
  23. ![GitHub release (latest by date)](https://img.shields.io/github/v/release/buzonio/zipfly)
  24. [![Downloads](https://pepy.tech/badge/zipfly)](https://pepy.tech/project/zipfly)
  25. # ZipFly
  26. ZipFly is a zip archive generator based on zipfile.py.
  27. It was created to generate very large ZIP archives for immediate sending out to clients, or for writing large ZIP archives without memory inflation.
  28. # Requirements
  29. Python 3.6+ Added <a href="https://docs.python.org/3/library/zipfile.html#zipfile-objects" target="blank">support</a> for writing to unseekable streams.
  30. # Install
  31. pip3 install zipfly
  32. # Basic usage, compress on-the-fly during writes
  33. Using this library will save you from having to write the Zip to disk. Some data will be buffered by the zipfile deflater, but memory inflation is going to be very constrained. Data will be written to destination by default at regular 32KB intervals.
  34. `ZipFly` defaults attributes:<br>
  35. - <b>paths:</b> [ ] <br/>
  36. - <b>mode:</b> (write) w <br/>
  37. - <b>chunksize:</b> (bytes) 32768 <br/>
  38. - <b>compression:</b> Stored <br/>
  39. - <b>allowZip64:</b> True <br/>
  40. - <b>compresslevel:</b> None <br/>
  41. - <b>storesize:</b> (bytes) 0 <br/>
  42. - <b>encode:</b> utf-8 <br/>
  43. <br/>
  44. `paths` <b>list of dictionaries:</b>
  45. | |.
  46. |---------------- |-------------------------------
  47. |**fs** |Should be the path to a file on the filesystem
  48. |**n** *(Optional)* |Is the name which it will have within the archive <br> (by default, this will be the same as **fs**)
  49. <br>
  50. ```python
  51. import zipfly
  52. paths = [
  53. {
  54. 'fs': '/path/to/large/file'
  55. },
  56. ]
  57. zfly = zipfly.ZipFly(paths = paths)
  58. generator = zfly.generator()
  59. print (generator)
  60. # <generator object ZipFly.generator at 0x7f74d52bcc50>
  61. with open("large.zip", "wb") as f:
  62. for i in generator:
  63. f.write(i)
  64. ```
  65. # Examples
  66. > <b>Streaming multiple files in a zip with <a href="https://github.com/sandes/zipfly/blob/master/examples/streaming_django.py" target="_blank">Django</a> or <a href="https://github.com/sandes/zipfly/blob/master/examples/streaming_flask.py" target="_blank">Flask</a></b>
  67. Send forth large files to clients with the most popular frameworks
  68. > <b>Create paths</b>
  69. Easy way to create the array `paths` from a parent folder.
  70. > <b>Predict the size of the zip file before creating it</b>
  71. Use the `BufferPredictionSize` to compute the correct size of the resulting archive before creating it.
  72. > <b>Streaming a large file</b>
  73. Efficient way to read a single very large binary file in python
  74. > <b>Set a comment</b>
  75. Your own comment in the zip file