How to install idfkit¶
idfkit is one library under one name in two ecosystems: idfkit on PyPI and
idfkit on npm. This guide installs it, adds the optional pieces, and points
EnergyPlus at your simulations.
The two ecosystems package the same surface differently, and the difference shows up twice below. Python gates optional features behind extras, which are dependencies rather than files, so weather support and its station index arrive whether or not you asked for them. JavaScript gates them behind separate packages, so weather is a second install and stays off disk until you make it.
The npm side of this page describes the intended install
pip install idfkit works today. The npm commands do not, and not because
npm is empty: @idfkit/core, @idfkit/schemas and @idfkit/weather are
published at 0.1.0. That release predates the renames these pages document,
so installing it gets you an API this site does not describe. It still
exports IDFDocument rather than IdfDocument, and IdfDocument.collection()
is public there and withdrawn here. The shared idfkit name is not published
at all. Read the TypeScript tabs as the destination, and do not pin to 0.1.0
expecting the names on these pages.
Install the library¶
That gives you, in both languages:
- Loading and writing IDF and epJSON files
- O(1) object lookups and reference tracking
- Schema validation for all 17 supported EnergyPlus versions
- Object and field introspection
Beyond that the two diverge, because they run in different places. Python adds
3D geometry, EnergyPlus simulation, weather, and the idfkit command-line tool,
with subcommands check (lint),
migrate (upgrade IDFs), and
tmy (weather data). TypeScript adds nothing to the base
install and ships no CLI; it parses, edits, and writes, in Node, a browser, a
worker, or an edge runtime.
On npm the name idfkit is a facade over three packages, each of which stays
published under its own name: @idfkit/core behind idfkit and idfkit/node,
@idfkit/schemas behind idfkit/schemas, and @idfkit/weather behind
idfkit/weather. The first two are ordinary dependencies and come with the
install. The third does not.
Weather is a separate install in JavaScript¶
pip install idfkit installs weather support and the 1.7 MB station index
unconditionally. npm install idfkit installs neither. @idfkit/weather is
declared as an optional peer dependency of idfkit, so npm leaves it out by
default and nobody who never asks for weather pays for the index.
Import idfkit/weather without installing @idfkit/weather and the failure
names the package to install rather than reporting an unresolved module. A
project that never touches that subpath is unaffected, and a package of your own
that depends on idfkit and needs weather should declare @idfkit/weather
itself.
See How to download weather files for what the two weather surfaces do with what they return.
Optional Python extras¶
Python's optional features are extras on the one package.
DataFrame support¶
Convert simulation results to pandas DataFrames:
Plotting¶
Visualize simulation results with matplotlib or plotly:
Progress bars¶
Show tqdm progress bars during batch simulations:
Cloud storage (S3)¶
Store simulation results in Amazon S3:
Everything at once¶
Generated types in TypeScript¶
The base install is typed, but object types and field names are only as specific as the schema you tell it about. Add the generated type map for the EnergyPlus version you work in to get autocompletion and compile-time checking on both:
Each type map declares @idfkit/core as a peer dependency and carries no code,
so it costs nothing at runtime. There is no Python counterpart: Python resolves
field names against the schema at runtime instead.
EnergyPlus Installation¶
Running simulations needs EnergyPlus itself, installed on the machine that runs them. This applies to Python only; the TypeScript packages do not simulate.
Automatic discovery¶
idfkit discovers EnergyPlus using this priority:
- Explicit path passed to
find_energyplus(path=...) - Environment variable
ENERGYPLUS_DIR - System PATH (looks for the
energyplusexecutable) /opt/eplus(standard install location in Claude Code web sessions)- Platform defaults:
- macOS:
/Applications/EnergyPlus-*/ - Linux:
/usr/local/EnergyPlus-*/ - Windows:
C:\EnergyPlusV*/
- macOS:
Download EnergyPlus¶
Download from the official site: EnergyPlus Downloads.
Verify the install¶
from idfkit.simulation import find_energyplus
config = find_energyplus()
print(f"EnergyPlus {config.version[0]}.{config.version[1]}.{config.version[2]}")
print(f"Executable: {config.executable}")
Requirements¶
| Python | TypeScript | |
|---|---|---|
| Runtime | Python 3.10 or later | Node 20 or later, or any modern browser |
| EnergyPlus | 8.9 or later, for simulation | not used |
Install from source to contribute¶
Next steps¶
- Build your first model, from an empty document to a running simulation
- Common tasks, quick recipes for everyday operations
- Core Tutorial, the in-depth interactive walkthrough
- How to parse in the browser, if TypeScript is where you are headed