Conversion of HPXML to OSM with Python
Hi,
I found an HPXML file and I would like to know how can I convert it into an OSM file using Python. I found this repo https://github.com/NREL/OpenStudio-HP....
However, it seems that the code is in ruby. Is there a Python wrapper or a specific method to access this functionality?
Thanks.




Can you say where your HPXML file came from? There are lots of different flavors of HPXML files (some specifically used for energy modeling, some not).
Hi,
The HPXML file comes from the ResStock dataset, specifically from this location: https://data.openei.org/s3_viewer?buc...
There is a new release (2025) of ResStock building energy models. I only have the .xml file, which is actually an HPXML file. I noticed that there are some tools that can convert this into an .osm file, and I was wondering if there are any Python tools for this conversion.
Thank you !
There is some description of how to do this for an earlier ResStock dataset, but I imagine most of it applies. See here
Thank you ! I will try that and I'll come back.
Thanks again !
Hi, I managed to generate some .osm files by downloading the new resstock datasource and running this :
openstudio path/to/openstudio.exe /path/to/run_analysis.rb -y -u upgrade_name
This generates and executes EnergyPlus runs for all the buildings. However, I am only interested in the .osm building models, the in.schedules.csv files, and the associated TMY/AMY weather files. Is there a way to skip all the simulations and only generate these files? And sort by states ?
Or Should I do it from scratch ?
Sorry for the question if it is too obvious...
Thanks for the help
You can use the
-mor--measures_onlyflag to skip the simulations. If you use--help, you can see all of the run_analysis.rb options available.Thank you ! That worked perfectly. I have a last question. When I generate the model and then run energyplus simulation I got a surprising evolution of the parameter "Zone People Occupant Count" in the conditionned space. Here is the evolution for the first 16 timesteps (15min) :
[2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 1.466, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.466, 0.0, 0.534]
I have some doubts on the in.schedules.csv file (generated with run_analysis.rb) because it has :
[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.733, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.233, 0.0, 0.267]
for 2 people. Can you help ? Thanks
Can you ask that in a new Unmet Hours question? That is a ResStock/stochastic occupancy model question and not related to converting HPXML to OSM.
Sorry, I'll do that. Thanks for your help.