Getting Started With ZIP Files
00:00 Getting Started With ZIP Files. ZIP files are a well-known and popular tool in today’s digital world. These files are widely used for cross-platform data exchange over computer networks, including the Internet.
00:13
You can use ZIP files for bundling regular files together into a single archive, compressing your data to save some disk space, distributing your digital products, and more. In this course, you’ll learn how to manipulate ZIP files using Python’s zipfile
module.
00:29 Because the terminology around ZIP files can be confusing at times, this course will stick to the following conventions regarding terminology: ZIP file, ZIP archive, or archive will refer to a physical file that uses the ZIP file format.
00:44 File refers to a regular computer file. And member file refers to a file which is part of an existing zip file. Having these terms clear in your mind will help you avoid confusion while you follow this course.
00:59
You’ve probably already encountered and worked with ZIP files, and files with the .zip
file extension are everywhere. ZIP files, also known as ZIP archives, are files that use the ZIP file format.
01:12 PKWARE is the company that created and first implemented the file format. They put together and maintain the current format specification, which is publicly available and allows the creation of products, programs, and processes that read and write files using the ZIP file format.
01:29 The ZIP file format is a cross-platform interoperable file storage and transfer format. It combines lossless data compression, file management, and data encryption.
01:41 Data compression isn’t a requirement for an archive to be considered a ZIP file, so you can have compressed or uncompressed member files in your ZIP archives.
01:51 The ZIP file format supports several compression algorithms, although Deflate is the most common. The format also supports integrity checks with CRC32.
02:03 Even though there are other similar archiving formats, such as RAR and TAR files, the ZIP file format has become a common standard for efficient data storage and for data exchange over computer networks.
02:15 ZIP files are present in places where you may not realize. For example, office suites such as Microsoft Office and Libre Office rely on the ZIP file format as their document container file.
02:26
This means that the .docx
, .xlsx
, .pptx
, .odt
, .ods
, and .odp
files are actually ZIP archives containing several files and folders that make up each document.
02:38
Other common files that use the ZIP format include .jar
, .war
, and .epub
files. You may be familiar with GitHub, which provides web hosting for software development and version control using Git.
02:52 GitHub uses ZIP files to package software projects when you download them to your local computer. For example, you can download the exercise solutions for Python Basics as a ZIP file.
03:04 Knowing how to create, read, write, and extract ZIP files can be a useful skill for developers and professionals who work with computers and digital information. Among other benefits, ZIP files allow you to reduce the size of files and their storage requirements without losing information, improve transfer speed over the network due to reduced size and single-file transfer, pack several related files together into a single archive for efficient management, bundle your code into a single archive for distribution purposes, secure your data by using encryption, which is a common requirement nowadays, and guarantee the integrity of your information to avoid accidental and malicious changes to your data.
03:46 These features make ZIP files a useful addition to your Python toolbox if you’re looking for a flexible, portable, and reliable way to archive your digital files.
03:57
Python has several tools that allow you to manipulate ZIP files. Some of these tools are available in the Python standard library, and these include low-level libraries for compressing and decompressing data using specific compression algorithms, such as zlib
, bz2
, lzma
, and others. Python also provides a high-level module called zipfile
, specifically designed to create, read, write, extract, and list the contents of ZIP files. In this course, you’ll learn about Python zipfile
and how to use it effectively, starting in the next section by taking a look at manipulating existing ZIP files.
Become a Member to join the conversation.