Skip to main content

vhd

介绍

vhd 是一个用于创建和读取固定大小 VHD (Virtual Hard Disk) 文件的 Python 库。

安装

你可以通过以下命令安装 vhd:

pip install vhd

代码例程

创建VHD文件

import vhd
if vhd.create("example.vhd", 512):
    print(f"VHD 文件已创建")

读取 VHD 文件信息

import vhd
filename = "example.vhd"
vhd_info = vhd.read(filename)
print("VHD 文件信息:")
print(f"Cookie: {vhd_info['cookie']}")
print(f"特性: {vhd_info['features']}")
print(f"文件格式版本: {vhd_info['file_format_version']}")
print(f"数据偏移量: {vhd_info['data_offset']}")
print(f"时间戳: {format_timestamp(vhd_info['timestamp'])}")
print(f"创建者应用程序: {vhd_info['creator_application']}")
print(f"创建者版本: {vhd_info['creator_version']}")
print(f"创建者主机操作系统: {vhd_info['creator_host_os']}")
print(f"原始大小: {vhd_info['original_size']} 字节 ({vhd_info['original_size'] / (1024 * 1024):.2f} MB)")
print(f"当前大小: {vhd_info['current_size']} 字节 ({vhd_info['current_size'] / (1024 * 1024):.2f} MB)")
print(f"柱面数: {vhd_info['cylinders']}")
print(f"磁头数: {vhd_info['heads']}")
print(f"每磁道扇区数: {vhd_info['sectors_per_track']}")
print(f"磁盘类型: {vhd_info['disk_type']}")
print(f"校验和: {vhd_info['checksum']}")

Metadata

Release files for vhd 1.0.7

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

Source distribution (sdist)

Source distribution for vhd 1.0.7
File Size Uploaded Provenance
vhd-1.0.7.tar.gz 3.6 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 9.7 kB

Release files / vhd-1.0.7.tar.gz

Download URL vhd-1.0.7.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3d4e9894b134ecf21d70023634a7e8fc79d86eb6bd6e1e6919df8d9a27d40efb
BLAKE2b-256 checksum
How to use checksums
3e10c1695816fa79ba5017a2eaa4a68d005f18cfa12be67ba4312514529278fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Release files / vhd-1.0.7-py3-none-any.whl

Download URL vhd-1.0.7-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16b8043a792ada2d3efed474f26cf31abbd026281a6c278a181e420f4de48cef
BLAKE2b-256 checksum
How to use checksums
7d89aabb21529302a70e085fae2c266f01ee8cd95d5ca26fce0eabff5b2d8101
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.7

Security for vhd 1.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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