This article will teach you how to use the package compression, new in Python 3.14. You will learn how to

  • compress and decompress data directly;
  • write and read from compressed files;
  • compress and decompress data incrementally;
  • you’ll also learn what compression algorithms are available to you and which ones are available in Python versions earlier than 3.14.

Compression modules available

The package compression makes five compression modules available to you:

  1. bz2 – comprehensive interface for compressing and decompressing data using the bzip2 compression algorithm;
  2. gzip – adds support for working with gzip files through a simple interface to compress and decompress files like the GNU programs gzip and gunzip would;
  3. lzma – interface for compre…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help