Giter Site home page Giter Site logo

pvfree's Introduction

travis

PV Free

A public API for PV modeling parameters and pvlib API for learning about solar.

Announcements

pvfree is moving to Microsoft Azure Cloud b/c Heroku free dyno service will end Nov 28th. Please use https://pvfree.azurewebsites.net/ from now on to get module and inverter parameters for pvlib and to learn about solar energy modeling.

Usage

Browsing to pvfree.azurewebsites.net/api/v1/pvinverter/ will display a JSON string with the first 20 records. The endpoint and query string to obtain the next set api/pvinverter/?limit=20&offset=20 is contained in the next key of the string as are the endpoints for each inverter. Note: the query string ?format=json is only necessary when using the API url directly in a browser to display the response.

The API is generated by the Tastypie django extension. Add the following endpoints to the base URL, https://pvfree.azurewebsites.net/:

  • Get first 20 pvinverters.

      api/pvinverter/
    
  • Get first pvinverter.

      api/pvinverter/1/
    
  • Get pvinverter set containing #'s 2, 3, 5, and 10.

      api/pvinverter/set/2;3;5;10/
    
  • Get 100 pvinverters starting from pvinverter # 500.

      api/pvinverter/?limit=100&offset=500
    
  • Get pvinverter database schema.

      api/pvinverter/schema/
    

Python has several libraries for interacting with URLs. The Requests package is available from PyPI.

>>> import requests
>>> response = requests.get('https://pvfree.azurewebsites.net/api/v1/pvinverter/set/1;3;5/')
>>> response
  <Response [200]>
>>> response.status_code
  200
>>> response.content
  {"objects": [{"C0": -2.48104842861e-05, "C1": -9.0149429405099999e-05, "C2": 0.00066889632690700005, "C3": -0.018880466688599998, "Idcmax": 10.0, "MPPT_hi": 50.0, "MPPT_low": 20.0, "Paco": 250.0, "Pdco": 259.52205054799998, "Pnt": 0.02, "Pso": 1.7716142241299999, "Sandia_ID": 1399, "Tamb_low": -40.0, "Tamb_max": 85.0, "Vaco": 208.0, "Vdcmax": 65.0, "Vdco": 40.242603174599999, "id": 1, "manufacturer": "ABB", "name": "MICRO-0.25-I-OUTD-US-208", "numberMPPTChannels": 1, "resource_uri": "/api/v1/pvinverter/1/", "source": "CEC", "vintage": "2014-01-01", "weight": 1.6499999999999999}, ...]}

pvfree's People

Contributors

cedricleroy avatar dependabot[bot] avatar mikofski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pvfree's Issues

Use bokeh

  • Replace mpld3 in PV modules
  • Add more details to each module like parameters and IV curves

use celery for uploading new SAM dumps

problem:

SAM files, esp. CEC modules are too big, and gunicorn or heroku times out after 30 seconds, files more than 0.5mb are too big, CEC modules is 3.2mb, by comparison inverters is 600kb and Sandia modules is 200kb.

proposals:

  1. use celery
  2. provision heroku redis free add-on (with credit card verification)
  3. create uploads model to record uploads, and make it easier to pass them to tasks by django id,
    • record user id who uploaded SAM file
    • when uploaded
    • upload file itself
    • log of new records uploaded, existing records, defaults used, and/or errors
  4. send upload model primary key (id) to message broker (redis) to retrieve upload file and call model's upload method,
    • can probably consolidate all of those upload methods in one place, using handlers as needed
  5. save log, in uploads table, and users can look at their leisure

other options:

update landing page to include modules, badge, pvlib, etc.

  • the landing page is outdated, it only shows examples for pvinverters
  • it should also show pvmodules examples
  • and eventually cec_modules
  • also should explain the difference between the programmatic interactive web-API pages and the human interactive web-app pages like pvmoduldes/id/
  • also just get rid of the java examples
  • and update the filter examples

update to newer django, remove south migration dependency

This app is using django-1.6.4 which predates Django migrations, so it depends on South. I think I did this originally for a number of reasons, mainly because alwaysdata was limited, but then later because tastypie was. However this is no longer the case, both alwaysdata and heroku can support any version of django, and tastypie as of v0.14.0 can support any LTS version of Django, currently versions 1.8 and 1.11.

I know this will be painful and annoying, but I think it will make changes in the future much easier, especially since South is completely deprecated, their documentation has been taken down, and can only be viewed from the South BitBucket repo.

retire heroku

after nov 28th, 2022, it will be no more

  • remove it from allowed hosts
  • remove announcement

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.