GithubHelp home page GithubHelp logo

pa-0 / chargepoint-scraper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nicholasrobinson/chargepoint-scraper

1.0 0.0 0.0 10 KB

ChargePoint Station Occupancy Scraper with Boxcar and OS X Notification Center support

License: MIT License

Python 100.00%

chargepoint-scraper's Introduction

ChargePoint Station Occupancy Scraper with Boxcar and OS X Notification Center support

by Nicholas Robinson

Overview

This software allows for convenient monitoring of ChargePoint station occupancy via a text-based user interface. Additionally, it supports OS X Notification Center and Boxcar notifications, which are triggered whenever a new charging spot becomes available. This gives you a much needed advantage in an office charging environment where contention for charging spots is high!

Requirements

  • Python 2.7+
  • Virtualenv
  • OS X 10.8+ (for Notification Center)
  • Boxcar account + compatible device (for Boxcar notifications)

Installation

$ git clone git://github.com/nicholasrobinson/ChargePoint-Scraper.git
$ cd ChargePoint-Scraper/
$ virtualenv v_env
$ source v_env/bin/activate
$ pip install -r requirements.txt
$ vim main.py 
(replace BOXCAR_ACCESS_TOKEN with your Boxcar access token)
$ vim chargepoint_scraper.py
(replace DEFAULT_LATITUDE and DEFAULT_LONGITUDE definitions with <YOUR_LATITUDE> and <YOUR_LONGITUDE>)

Execution

$ ./main.py
(enter your ChargePoint username and password when prompted)

Sample Output

                        SC-8#1  SC-8#2  SC-8#3  SC-8#4  SC-8#5  SC-8#6  SC-8#7  SC-8#8  SC-8#9  SC-8#10 SC-8#11 SC-10#1 SC-10#2 SC-10#3 SC-10#4 TA-7A#1 TA-7A#2 TA-7B#1 TA-7B#2
2015/06/06 17:32:43      2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   1 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2 
2015/06/06 17:33:43      2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   1 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2 
2015/06/06 17:34:44      2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   1 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2 
2015/06/06 17:35:45      2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   1 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2 
2015/06/06 17:36:45      2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   1 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2 
2015/06/06 17:37:46      2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   1 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2 
2015/06/06 17:38:46      2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   1 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2 
2015/06/06 17:39:47      2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   1 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2 
2015/06/06 17:40:48      2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   1 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2 
2015/06/06 17:41:48      2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   1 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2   2 / 2 

Sample Output Explanation

The above output shows 19 ChargePoint stations (indicated by the column headings) and their availability every minute (indicated by the row headings). The x/y entries in each cell indicate that x spots out of y total spots are currently unoccupied.

References

Notes

In main.py the

poll_chargepoint_stations(s)

can be replaced with

poll_chargepoint_stations(s, stations_of_interest=stations, stations_to_ignore=ignore)

where stations_of_interest and stations_to_ignore kwargs allow you to specify stations you are interested in and/or would like to exclude.

Please let me know if you find this useful or come up with any novel implementations.

Enjoy!

Nicholas Robinson

[email protected]

chargepoint-scraper's People

Stargazers

Peter Abbasi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.