npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

portfolio-manager

v1.6.0

Published

Unofficial CLI Tool and SDK for Energy Star Portfolio Manager

Downloads

23

Readme

Unofficial Energy Star Portfolio Manager SDK and CLI Tool

1.x is unstable and will have breaking changes as the architecture stabilizes. 2.x will signal the beginning of proper semantic releases.

Portfolio Manager is an important benchmarking tool to support measure and verification of energy efficiency projects. It support a number of federal incentive programs, federal decision making, and Energy Star building certifications. It is primarily used by large companies.

A core aim of this project is to make Portfolio Manager more accessible to smaller consulants, engineering firms, property managers, utilities like rural coops, and building owners.

The CLI tool enables automation of data flows using shell scripts popular with general IT personell and systems administrators.

The Node.JS SDK make the platform more accessible to javascript developers and is a popular technology among start ups and web developers.

Contributing

I'm actively looking for contributors and sponsors to further develop this project. My goal is to build open-source tooling that supports the operations of companies working in the energy efficiency space.

CLI

npm install portfolio-manager

# You'll need to create a portfolio manager account with live data access to make use of this cli tool.
# none of the create features for the CLI are implemented yet, so the

export PM_USERNAME="UserName"
# I strongly recomment you set the password in the environment rather than passing it on the
# cli. This will preven your password from being in `ps` lists on multiuser machines.
# It's still not super secure as it will be in /proc/env so you should only use the cli tool
# on secured machines at this juncture. I'd love help from someone who knows the best way to
# securely pass a password to commander.js.
export PM_PASSWORD="Password"

# export PM_ENDPOINT="https://portfoliomanager.energystar.gov/wstest/"
# you can set the endpoint to the testing environment, unfortunately there is no
# data there by default and there are no create functions implemented in the cli
# yet. So there isn't much you can do with it.

npx run portfolio-manager --help

SDK

There isn't a docs framework yet, prioritize reading the source code over any documentation here.

The interfaces are not yet complete, I'm actively looking for contributors and sponsors to help complete the project.

quickstart

const endpoint = "https://portfoliomanager.energystar.gov/wstest/"
const username = "<UserName>"
const password = "<Password>"


async function main() {
    const api = new PortfolioManagerApi(endpoint, username, password)
    const pm = new PortfolioManager(api)
    const properties = await pm.getProperties()
    console.log(properties)
}
main()

Interfaces

class PortfolioManager {
    // Developer Friendly Facade to the Portfolio Manager API
    constructor(api: PortfolioManagerApi) {}

    async getAccount(): Promise<IAccount>
    async getAccountId(): Promise<number>
    async getMeter(meterId: number): Promise<IMeter>
    async getMeterConsumption(meterId: number, startDate?: Date, endDate?: Date): Promise<(IMeterDelivery | IMeterConsumption)[]>
    async getMeterLinks(propertyId: number, myAccessOnly?: boolean): Promise<ILink[]>
    async getMeters(propertyId: number): Promise<IMeter[]>
    async getAssociatedMeters(propertyId: number): Promise<IMeterPropertyAssociationList>
    async getProperty(propertyId: number): Promise<IClientProperty>
    async getPropertyLinks(accountId?: number): Promise<ILink[]>
    async getProperties(accountId?: number): Promise<IClientProperty[]>
}



class PortfolioManagerApi {
    // Typed Gateway to the Portfolio Manager API
    constructor(endpoint: string, username: string, password: string)

    async getAccount(): Promise<IGetAccountResponse>
    async postAccount(account: IAccount): Promise<IPostAccountResponse>
    async getMeter(meterId: number): Promise<IGetMeterResponse>
    async getProperty(propertyId: number): Promise<IGetPropertyResponse>
    async postProperty(property: IProperty, accountId: number): Promise<IPostPropertyResponse>
    async getPropertyList(accountId: number): Promise<IGetPropertyListResponse>
    async postPropertyMeter(propertyId: number, meter: IMeter): Promise<IPostPropertyMeterResponse>
    async getPropertyMeterAssociationList(propertyId: number): Promise<IGetPropertyMeterAssociationListResponse>
    async getPropertyMeterList(propertyId: number, myAccessOnly = false): Promise<IGetPropertyMeterListResponse>
    async getMeterConsumptionData(meterId: number, page?: number, startDate?: Date, endDate?: Date): Promise<IGetMeterConsumptionResponse>
}

Energy Star Portfolio Manager Upstream API Documentation

Sponsors

Ross Energy Consulting

Ross Energy Consulting initially sponsored the work on this project to support their Strategic Energy Management service.

Ross Energy is dedicated to helping our clients achieve energy security for their buildings and communities. We will help your building become more comfortable and efficient, as well as more resilient to extreme weather events. Our staff has experience in over fifty million square feet of buildings, including clients such as the United States Environmental Protection Agency (EPA), Department of Defense (DoD), the Guggenheim Museum and well over 50 real estate developers and property management firms. We proudly focus our services on the greater New York, New Jersey and Pennsylvania Tri-state area, and we are actively growing. Our expertise lies in multifamily and commercial properties.