Skip to main content

Package a directory to a file, with fast file access and compression support

Project description

PyPI PyPI - Python Version Build Status Documentation Status codecov Codacy Badge


Package a directory to a file, with fast file access and compression support

import fast_package_file

# Package a directory into a file'a_directory', 'a_package.file')

# Prepare a package file
data_package = fast_package_file.PackagedDataFile('a_package.file')

# Load a file from the packed directory and save it
with open('any.file', 'wb') as any_file:

# Or just get the raw binary data
from PIL import Image
i ='image.png')))

# Some other useful functions
data_package.load_bulk(prefix='audio\\sfx\\', postfix='.wav')
fast_package_file.oneshot('a_package.file', 'path\\to\\any.file')
fast_package_file.oneshot_bulk('a_package.file', prefix='audio\\sfx\\', postfix='.wav')


From PyPI:

pip install fast-package-file

Or from Github:

pip install git+git://


More details will be available at


  • Is fast because only the data needed is loaded from the package file, total package size is irrelevant
  • Obfuscates files from (most) users
  • Like a .zip file, but doesn't decompress the entire thing when reading just one file
  • Includes the entire directory and subdirectories, not just surface-level files
  • Files are compressed with Gzip, but only if compression improves file size (per file) and is enabled (per package file)
  • Pretty good error handling when loading package files, just catch fast_package_file.PackageDataError
  • Inspired by video game packaging, such as UE4's .pak or GTA V's .rpf formats
  • Cross-platform, has CI for Linux, MacOS, and Windows



The project is licensed under the MIT license.

Project details

Download files

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

Source Distribution

fast_package_file-1.1.tar.gz (5.9 kB view hashes)

Uploaded source

Built Distribution

fast_package_file-1.1-py3-none-any.whl (7.1 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page