This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!
Project Description

Patches functions [modules]:file+open, and os.path:exists+isfile to enable accessing files inside zip archives using standard file functions.

Install via pip:
pip install zipaccess
Install via easy_install:
easy_install zipaccess
Sources via git:
git clone
Sources via hg-git:
hg clone git://


Use as a class. Do not instantiate it:

class AnyZipAccess(zipaccess.ZipAccess):
    any_zip = True  # custom modifications here


Or use as a module:


Optionally, register zipaccess.ZipAccess as os.zipaccess:


so other modules can easily use:

except AttributeError:

Note on Google App Engine (GAE)

On GAE, the __builtin__ module changes are not reflected, even in the local name space.

To use zip access in any GAE module, you need to enable it for that module locals:

    import zipaccess
except ImportError:

Alternatively, only enable zip access locally, if it was already registered:

except AttributeError:

Or enable it for target modules externally:

# It imports all the modules though, which may be not what you want.
# If you know, how to hook on module import, let me kindly know.

Note, that os.path.isfile and os.path.exists are patched globally. Even on GAE, they apply for all modules of given instance. If some modules do support zip files, they usually first check if regular file exists, and if not, they split the path and check if the zipfile exists. With zip access enabled, the regular file check will succeed, which is ok as long as consequently used file() or open() functions are patched too.


The tipfy.debugger.get_loader() function checks if templates are located in a regular directory or in a zip file (lib/ usually). Then it returns tipfy.template.Loader or tipfy.template.ZipLoader accordingly. With zipaccess enabled, the standard tipfy.template.Loader will be used, and therefore zipaccess.enable('tipfy.template') is needed to make it work.


Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date (9.6 kB) Copy SHA256 Checksum SHA256 Source Jun 20, 2011

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting