Giter VIP home page Giter VIP logo

archiveimporter's Introduction

ArchiveImporter

A Python2/3 module that allows importing files from password protected ZIP files, .tar, .tar.gz or .tar.bz2 archives.

Command line usage

python ArchiveImporter.py [zipfile] [-p=password] [args...]

This loads the given ZIP file that is encrypted with the given password and executes __main__.py within it. Works pretty similar to executing a regular unprotected .pyz archive:

python [zipfile] [args...]

But using the ArchiveImporter.py allows using password protected ZIP/.pyz archives.

Usage within the code

ArchiveImporter.py can also be used to import modules from a password protected ZIP archive from within Python code. See the following example:

# First import the ArchiveImporter module
import ArchiveImporter
# Then add the password encrypted file you want to import from using addZip(zippath, password)
ArchiveImporter.addZip("test.pyz", "password")
# Now import modules from the archive as usual
import testmod

ArchiveImporter.py can also handle ZIP archives without a password. In this case password needs to be None. But that is not necessary, since Python already has this functionality built in:

import sys
sys.path.append("path/to/unencrypted/zipfile.pyz")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.