Skip to main content

NormQtyPact

通过调用 FEMA P-58 附带的非结构构件标准数量 Excel 文件,根据建筑各层的平面面积输出非结构构件数量文件。生成的文件可以直接导入 PACT 或 Pelicun 中使用。

注意: 本包依赖 Windows COM 接口调用 Excel,仅支持 Windows 平台且需要安装 Microsoft Excel。

输出文件

  • PactComponentDirectory.csv:可直接导入 PACT 的非结构构件数量文件。
  • PelucunComponentDirectory.csv / PelucunComponentDirectory.json:可作为 Pelicun 的非结构构件数量输入文件。

安装

从 PyPI 安装(发布后)

pip install normqtypact

依赖

  • Python >= 3.7
  • Windows 操作系统 + Microsoft Excel
  • pypiwin32
  • 构建工具:hatch(仅开发/打包时需要)

使用

命令行

安装后可直接使用 normqtypact 命令:

normqtypact --NumOfStories 3 --FloorAreaList "1,1,1" --Occupancy1Type "APARTMENT,APARTMENT,APARTMENT" --Occupancy2Type "none,none,none" --Occupancy3Type "none,none,none" --Occupancy1Area "1,1,1" --Occupancy2Area "0,0,0" --Occupancy3Area "0,0,0"

参数说明:

参数 类型 说明 示例
--NumOfStories int 楼层数 3
--FloorAreaList str 各层楼面面积(平方英尺),逗号分隔 "1000,1000,1000"
--Occupancy1Type str 各层主要使用类型,逗号分隔 "APARTMENT,APARTMENT,APARTMENT"
--Occupancy2Type str 各层次要使用类型,逗号分隔 "none,none,none"
--Occupancy3Type str 各层第三使用类型,逗号分隔 "none,none,none"
--Occupancy1Area str 主要使用类型面积占比,逗号分隔 "1,1,1"
--Occupancy2Area str 次要使用类型面积占比,逗号分隔 "0,0,0"
--Occupancy3Area str 第三使用类型面积占比,逗号分隔 "0,0,0"

Python API

from normqtypact import NormQtyPact

obj = NormQtyPact(
    NumOfStories=3,
    FloorAreaList=[1000, 1000, 1000],
    Occupancy1Type=["APARTMENT", "APARTMENT", "APARTMENT"],
    Occupancy2Type=["none", "none", "none"],
    Occupancy3Type=["none", "none", "none"],
    Occupancy1Area=[1, 1, 1],
    Occupancy2Area=[0, 0, 0],
    Occupancy3Area=[0, 0, 0],
)

# 生成 PACT 格式输出
obj.Output_PactComponentDirectory("PactComponentDirectory.csv")

# 生成 Pelicun 格式输出
obj.Output_PelicunComponentDirectory(
    json_path="PelucunComponentDirectory.json",
    csv_path="PelucunComponentDirectory.csv",
)

示例

examples/ 目录包含可直接运行的示例脚本:

文件 说明
basic_usage.py 3 层公寓建筑(单一使用类型)
mixed_occupancy.py 5 层混合使用建筑(零售 + 办公)
PactComponentDirectory.csv PACT 格式示例输出
PelucunComponentDirectory.csv Pelicun CSV 格式示例输出
PelucunComponentDirectory.json Pelicun JSON 格式示例输出

运行示例:

cd examples
python basic_usage.py

Metadata

Release files for normqtypact 0.2.0

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

Source distribution (sdist)

Source distribution for normqtypact 0.2.0
File Size Uploaded Provenance Actions
normqtypact-0.2.0.tar.gz 866.0 kB Without provenance Details for normqtypact-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.7 MB

Release files / normqtypact-0.2.0.tar.gz

Download URL normqtypact-0.2.0.tar.gz
Size 866.0 kB
Tags Source
SHA-256 checksum
How to use checksums
abeeba85e2ea254d84c74835977b97fba60f15fe06d1c0e331668e7e66b7122c
BLAKE2b-256 checksum
How to use checksums
daae1a4d9abc28cb771d1beaf0f77e3ae6b7a2fb91e51a523b996f57b9e6bbab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / normqtypact-0.2.0-py3-none-any.whl

Download URL normqtypact-0.2.0-py3-none-any.whl
Size 865.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b6caf0caa144c659e48502d66b5e041b624a9467b7b7c55b6ab44dc8dacf5c0
BLAKE2b-256 checksum
How to use checksums
8c1a565ce5c8b3bbfb3c629e46e1e937ad4ed764f3191344f96729ed2b669e4f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for normqtypact 0.2.0

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