Skip to main content

GPT Image

Create GUID Partition Table disk images on local disks. Written in pure Python gpt-image allows GPT disk images to be built on a local filesystem and exported to a destination device.

This is useful for creating a disk image on SD Cards or embedded devices.

Quick Start

import gpt_image

# create a new, 8 MB disk, size is in bytes
disk = gpt_image.disk.Disk("disk-image.raw", 8 * 1024 * 1024, fresh_disk=True)

# create a 2MB partition, default is a Linux partition
partition = gpt_image.partition.Partition("partition1", 2 * 1024 * 1024, uuid.uuid4())

# add the partition to disk
disk.table.partitions.add(partition)
disk.update_table()

# write data to disk, data must be in bytes
with open("binary_data.bin", "r+b") as f:
    data = f.read()
    disk.write_data(data, partition)

MIT License

Copyright (c) 2021 Scott Wysocki

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Download files

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

Source Distribution

gpt-image-0.2.2.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gpt_image-0.2.2-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file gpt-image-0.2.2.tar.gz.

File metadata

  • Download URL: gpt-image-0.2.2.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12

File hashes

Hashes for gpt-image-0.2.2.tar.gz
Algorithm Hash digest
SHA256 450a917f7aeea1e160ccd44ccf4a48805bd57a8689c42f426074a4cee27d4968
MD5 9911758bc9f2d35e013cc4e72970a474
BLAKE2b-256 4de647c920f86893cdacc055dda47fb08971bb2752640320a69c326c2790997f

See more details on using hashes here.

File details

Details for the file gpt_image-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: gpt_image-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.12

File hashes

Hashes for gpt_image-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dc2bb40048d5742bd1b346533c8ea66a678fdfd0da0e1e14a545280de0767ccb
MD5 5394cd91033c16a90321123cab3ac20e
BLAKE2b-256 7c5eb25e3fd3b02d81976c54c426d01dd9857a8a13a81c4a8f253217578c278e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page