XImg
XImg is a lightweight, plugin-based, 100% pure Python library and command-line utility for creating and extracting disk and file system images (.img, .iso) without requiring any external system tools or dependencies.
Supported Formats (via Plugins)
- FAT12: Floppy disk image simulation (fully extractable).
- FAT32: Large disk container simulation.
- ISO: ISO9660 optical media image simulation.
- EXT4: Linux EXT4 container structure simulation.
Installation
Clone or download the project repository, navigate to the root directory where pyproject.toml is located, and install it locally in editable mode:
pip install -e .
To install it globally from PyPI (once published):
pip install ximg
Usage
- Creating Images You can specify the target format using the -f or --format flag (fat12, fat32, iso, ext4).
Create a FAT12 image:
ximg create -o img_file_name.img -f fat12 file_name.txt
```s
Create a FAT32 image:
```bash
ximg create -o img_file_name.img -f fat32 file_name.txt
Create an ISO image:
ximg create -o iso_file_name.iso -f iso file_name.txt
Create an EXT4 image:
ximg create -o img_file_name.img -f ext4 file_name.txt
Tip: You can rename files inside the image container using colon syntax:
ximg create -o img_file_name.img local_file.txt:documents/secret.txt
- Extracting Images
To read and extract files from a compatible disk image:
ximg extract img_file_name.img -o output_dir_name
- Using as a Python Library
You can also import XImg directly into your own Python projects:
from ximg import XImg
# Create an image programmatically
XImg.create_image("img_file_name.img", [("file1.txt", "file2.txt")], format_type="fat32")
# Extract files programmatically
XImg.extract_image("img_file_name.img", output_dir="dir_name")
Requirements
Python 3.7+ (Fully compatible with Python 3.14).
Zero external dependencies (Pure Python core).
License Distributed under the MIT License. See LICENSE for more information.
Metadata
Release files for ximg-lib 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ximg_lib-0.1.0.tar.gz | 6.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ximg_lib-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.5 kB
Release files / ximg_lib-0.1.0.tar.gz
| Download URL | ximg_lib-0.1.0.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d811f114c0765a7e91b1eab4e5a2ed65614d87bab076e924a9aa5c4639771ab8
|
|
BLAKE2b-256 checksum How to use checksums |
777d4a84ad84c6929b52b27e6dd95aadd1c848f8888508cb88c6f2b33b4d8cc5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / ximg_lib-0.1.0-py3-none-any.whl
| Download URL | ximg_lib-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5ea031cd28656b773e13d10c3995a1bb4cb1d81184495dbd165f2c6b13f07c3c
|
|
BLAKE2b-256 checksum How to use checksums |
938aee6b290c20548ea7f12e3563802398085b4a89d2485bffac415f0444bb2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|