django-zip-stream | Django extension to assemble ZIP | Runtime Evironment library

 by   travcunn Python Version: 0.7.0 License: MIT

kandi X-RAY | django-zip-stream Summary

kandi X-RAY | django-zip-stream Summary

django-zip-stream is a Python library typically used in Server, Runtime Evironment, Nginx applications. django-zip-stream has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.

Django extension to assemble ZIP archives dynamically using Nginx.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              django-zip-stream has a low active ecosystem.
              It has 11 star(s) with 2 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 7 open issues and 3 have been closed. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of django-zip-stream is 0.7.0

            kandi-Quality Quality

              django-zip-stream has 0 bugs and 0 code smells.

            kandi-Security Security

              django-zip-stream has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              django-zip-stream code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              django-zip-stream is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              django-zip-stream releases are available to install and integrate.
              Build file is available. You can build the component from source.
              It has 93 lines of code, 4 functions and 7 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed django-zip-stream and discovered the below as its top functions. This is intended to give you an instant insight into django-zip-stream implemented functionality, and help decide if they suit your requirements.
            • Initialize a transfer response .
            • Build file content .
            • Finalize options .
            • Runs the tests .
            Get all kandi verified functions for this library.

            django-zip-stream Key Features

            No Key Features are available at this moment for django-zip-stream.

            django-zip-stream Examples and Code Snippets

            No Code Snippets are available at this moment for django-zip-stream.

            Community Discussions

            Trending Discussions on django-zip-stream

            QUESTION

            Streaming zip in Django for large non-local files possible?
            Asked 2020-Dec-11 at 23:35

            I've got a proxy written in Django which receives requests for certain files. After deciding whether the user is allowed to see the file the proxy gets the file from a remote service and serves it to the user. There's a bit more to it but this is the gist.

            This setup works great for single files, but there is a new requirement that the users want to download multiple files together as a zip. The files are sometimes small, but can also become really large (100MB plus) and it can be anywhere from 2 up to 1000 files simultaneously. This can become really large, and a burden to first get all those files, zip them and then serve them in the same request.

            I read about the possibility to create "streaming zips"; a way to open a zip and then start sending the files in that zip until you close it. I found a couple php examples and in Python the django-zip-stream extension. They all assume locally stored files and the django extension also assumes the usages of nginx.

            There are a couple things I wonder about in my situation:

            1. I don't have the files locally stored. I can get them with an async/await structure and serve them simultaneously. That would mean I always have two files in memory (the one I'm currently serving, and the next one I'm getting from the source server).
            2. Unfortunately I don't have control over the web servers which will serve this. I can of course put an nginx container in front of it, but I don't think nginx could serve from files I store in Python vars because I get them from the source server.
            3. Whether I'm doing this in Python or let it be zipped in nginx, I presume the needed CPU cycles for this would be substantial.

            Does anybody know whether streaming zips are a good idea with my setup of very large remote files? I'm a bit afraid that many requests will easily DOS our servers because of CPU or memory limits.

            I can also build a queue which zips the files and sends an email to the user, but if possible I'd like to keep the application as stateless as possible.

            All tips are welcome!

            ...

            ANSWER

            Answered 2020-Dec-11 at 00:43

            Ok this is tough one!

            1. After the first request you could create and save the zipped file on the file servers. So the File Servers always deliver zipped files at the end. First time request will take longer because of creating the zip file but next times it will always deliver the zipped file as long as it will not be deleted.

            2. a) You could deliver a single stream which could be at the end a tape archive aka tar file which includes all the zipped files.

            -- or --

            1. b) HTTP/2 "One of the key advantages of the protocol is that it is multiplexed, meaning that multiple files can be transferred on a single connection." (sitepoint.com) There should not be any problems with the browsers (caniuse.com)

            In case of an DOS Attack you could limit the amount of requests for file downloads. So if there are too many requests at the same time they will be bounced back and they have to try it later on.

            Source https://stackoverflow.com/questions/65183940

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install django-zip-stream

            You can download it from GitHub.
            You can use django-zip-stream like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/travcunn/django-zip-stream.git

          • CLI

            gh repo clone travcunn/django-zip-stream

          • sshUrl

            git@github.com:travcunn/django-zip-stream.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link