Ladybug Tools Core SDK Documentation

The Ladybug Tools core SDK contains fundamental Python objects and methods used throughout all CAD plugins and interfaces. The core SDK can be run in both cPython (>=3.7) and IronPython (2.7).


Documentation

Ladybug Libraries

Libraries for the Ladybug plugin, including geometry, data manipulation and visualization.
ladybug_geometry - Core geometry library used throughout Ladybug Tools core libraries
ladybug - Core ladybug library for weather data analysis and visualization
ladybug_comfort - Ladybug extension for thermal comfort
ladybug_radiance - Ladybug extension for radiation and sun studies using Radiance
ladybug_display - Assigns display attributes to ladybug-geometry (color, line weight, line type, etc.)

Honeybee Libraries

Libraries for the Honeybee plugin, including building geometry and simulation engine properties.
honeybee - Core honeybee library containing building geometry objects
honeybee_energy - Honeybee extension for simulation with EnergyPlus/OpenStudio
honeybee_radiance - Honeybee extension for simulation with Radiance
honeybee_display - Adds methods to translate honeybee objects to ladybug-display objects

Dragonfly Libraries

Libraries for the Dragonfly plugin, including building geometry and simulation engine properties.
dragonfly - Core dragonfly library containing building geometry objects
dragonfly_energy - Dragonfly extension for simulation with EnergyPlus/OpenStudio/URBANopt
dragonfly_radiance - Dragonfly extension for simulation with Radiance
dragonfly_uwg - Dragonfly extension for simulation with the Urban Weather Generator
dragonfly_display - Adds methods to translate dragonfly objects to ladybug-display objects

Utility Libraries

Packages containing utilities used by other libraries.
ladybug_geometry_polyskel - Straight skeleton and offset methods using ladybug-geometry
honeybee_radiance_folder - Read, write and validate honeybee-radiance folders
honeybee_radiance_command - Wrapper around Radiance commands, used by honeybee-radiance
honeybee_radiance_postprocess - Postprocess multi-state Radiance results
ladybug_vtk - Translates Ladybug geometry and display objects to VTK format

Schema Libraries

Libraries for documenting and validating object (JSON) schemas.
honeybee_schema - Specification for the Honeybee model schema
dragonfly_schema - Specification for the Dragonfly model schema
ladybug_display_schema - Specification for the Ladybug display schema

Recipe Libraries

Libraries containing recipes.
lbt_recipes - Collection of recipes that ship with Ladybug Tools plugins

Rhino/Grasshopper Libraries

Libraries for interfacing with Rhino/Grasshopper.
ladybug_rhino - Communication methods between Ladybug Tools core libraries and Rhino CAD
lbt_grasshopper - Grasshopper components for the Ladybug Tools plugin


Structure

The relationship between the various core libraries is as follows.

Colors indicate aggregated packages, which can be used to install sets of libraries together, including all of their dependencies.


Installation

cPython (>=3.7)

Each of the core libraries can be installed individually via the Python Package manager, pip. The following shortcut can be used to install all of the core library packages and command line interfaces together with one command:

pip install lbt-dragonfly -U

If you also want to be able to be able to run recipes from command line, you will need to install the lbt-recipes package with the following

pip install lbt-recipes -U

IronPython (Grasshopper)

The core library packages are installed automatically within GHPython whenever the Grasshopper plugin is installed via the instructions here. The core libraries can be accessed by typing import statements for a given package within a native GHPython component. For example, the following will output the altitude and azimuth for a specific location and datetime:

from ladybug.location import Location
from ladybug.sunpath import Sunpath

# Create location. You can also extract location data from an epw file.
syd = Location('Sydney', latitude=-33.87, longitude=151.22, time_zone=10)

# Initiate sun path and print altitude and azimuth
sp = Sunpath.from_location(syd)
sun = sp.calculate_sun(month=11, day=15, hour=11.0)
print('altitude: {}, azimuth: {}'.format(sun.altitude, sun.azimuth))
7 Likes

A post was split to a new topic: SDK Documentation Search is Broken