Occupant behavior determines a large share of the energy consumption of buildings. Software applications driven by information about occupant behavior provide a mean to optimize this share. However, existing systems for sensing occupancy behavior provide technology-specific APIs statically coupled to the type of computed occupancy information. Software platforms for developing applications for buildings do also not provide abstractions for occupancy behavior. Therefore, technology lock in and lack of proper abstractions wreck the development of occupancy-driven applications. In this paper we present the design, implementation and evaluation of OccuRE, a stream-based Occupancy REasoning platform. OccuRE provides a technology agnostic API for accessing occupancy information to significantly improve portability. The platform uses a component-based computation model with dynamic composition to calculate and reason about occupancy behavior. Together these elements avoid that developers need to deal with technology-specific processing of sensor data to ease application development. Through microbenchmarks we show that OccuRE successfully and efficiently computes occupancy information for technology-heterogeneous building instrumentations. We use the development of three prototype applications to demonstrate that the API of OccuRE (i) enables several types of occupancy-driven applications, (ii) that the applications-by using the interface-achieve portability in regards to occupancy information computation and (iii) that the application code avoids handling sensor data processing.