Skip to main content

PyFAT12

PyFAT12 is a Python 3 library that allows handling FAT12 file systems. FAT12, or original FAT, is a file system designed by Microsoft that was used primarily on 5.25-inch and 3.5-inch floppy disks.

Currently PyFAT12 supports 3.5-inch high density (1.44 MB) floppy disk images and handling any FAT12 file systems on them. It is also possible to format a new FAT12 volume. Files can be opened, overwritten, created, renamed, deleted and so on; subdirectory and volume label support is also present.

This library has not been tested extensively, but basic functionality appears to work. There might still be bugs.

Installation

PyFAT12 has been tested on recent Python 3 versions and does not require any libraries beyond the standard library Python comes with.

pip install pyfat12

Documentation

The library comes with docstrings which can be viewed with help. Currently no documentation exists other than this README and the docstrings, but there are plans to improve the situation.

Examples

The following example creates a new 3.5-inch high density (1.44 MB) floppy image called DISK1.IMG in the current directory. The image contains a blank, formatted FAT12 file system:

from pyfat12 import FloppyImage, FAT12
floppy = FloppyImage()
fs = FAT12.format(floppy, "Disk label")
floppy.save("DISK1.IMG")

Opening up an existing image and lists all files from its root directory:

from pyfat12 import FloppyImage, FAT12
floppy = FloppyImage.open("DISK1.IMG")
fs = FAT12(floppy)
fileCount = 0

for file in fs.listfiles("/"):
    fileCount += 1
    print(file.name, file.size)

print(fileCount, "files in total")

Opening up an existing image, adding a new file (or overwriting an existing one) and saving:

from pyfat12 import FloppyImage, FAT12
floppy = FloppyImage.open("DISK1.IMG")
fs = FAT12(floppy)
fs.write_file("/HELLO.TXT", b"Hello World!\r\n")
floppy.save("DISK1.IMG")

License

MIT License. See LICENSE.

Release files for PyFAT12 0.8.post2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyFAT12 0.8.post2
File Size Uploaded
pyfat12-0.8.post2.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyFAT12 0.8.post2
File Interpreter ABI Platform
PyFAT12-0.8.post2-py3-none-any.whl Python 3 none any Details

Total release size: 6.8 kB

Release files / pyfat12-0.8.post2.tar.gz

Download URL pyfat12-0.8.post2.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
17f0bc641584d95cb89b7fcb3adeda701a08a6e6006af577ea9da9498a025084
BLAKE2b-256 checksum
How to use checksums
fd06458a50ae13444ae68b06b6ba96ce3aac0fb655deb86e5180bea08de85255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Release files / PyFAT12-0.8.post2-py3-none-any.whl

Download URL PyFAT12-0.8.post2-py3-none-any.whl
Size 3.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a8aed9b190960a5cbfa887f1267b244d09b2960508d891fa66b98044cc5de30
BLAKE2b-256 checksum
How to use checksums
af37fa8b3fd8dde0598d41f97cb1daf317d27ea1561780d299ff13303680706f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.8.post2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page