Giter VIP home page Giter VIP logo

psinsights's Introduction

`psinsights` is a set of python bindings for Google's PageSpeed Insights API.
The PageSpeed Insights API helps "developers optimize their web pages by
applying web performance best practices" to their web pages.  You can find out
more about the PageSpeed Insights API here:

    https://developers.google.com/speed/docs/insights/

`psinsights` was written by the software engineers at FastSoft.  You can find
more information about FastSoft here:

    http://www.fastsoft.com/

psinsights's People

Contributors

paulcronk avatar sparklemousse avatar surfacepatterns avatar

psinsights's Issues

Accessing rule.score raises key error

What steps will reproduce the problem?

1. Try access rule.score property
an = service.analyze("http://code.google.com/")
for rule in analysis.results.rules.itervalues():
  print rule.localized_name, rule.score, rule.impact


What is the expected output? 
valid numbers, like: 
Minify HTML 96 0.0483

What do you see instead?
Exception:
Minify HTMLTraceback (most recent call last):
  File "/usr/share/eclipse/dropins/pydev/eclipse/plugins/org.python.pydev_2.8.2.2013090511/pysrc/pydevd_comm.py", line 773, in doIt
    result = pydevd_vars.evaluateExpression(self.thread_id, self.frame_id, self.expression, self.doExec)
  File "/usr/share/eclipse/dropins/pydev/eclipse/plugins/org.python.pydev_2.8.2.2013090511/pysrc/pydevd_vars.py", line 374, in evaluateExpression
    Exec(expression, updated_globals, frame.f_locals)
  File "/usr/share/eclipse/dropins/pydev/eclipse/plugins/org.python.pydev_2.8.2.2013090511/pysrc/pydevd_exec.py", line 2, in Exec
    exec exp in global_vars, local_vars
  File "<string>", line 2, in <module>
  File "/usr/lib/python2.7/site-packages/psinsights/rule.py", line 41, in score
    return self.__data["ruleScore"]
KeyError: 'ruleScore'


What version of the product are you using? On what operating system?
$ pip freeze| grep psinsights
psinsights==0.1
$ uname -a; cat /etc/fedora-release 
Linux mulder 3.11.4-201.fc19.x86_64 #1 SMP Thu Oct 10 14:11:18 UTC 2013 x86_64 
x86_64 x86_64 GNU/Linux
Fedora release 19 (Schrödinger’s Cat)

Please provide any additional information below.
The Score key has disappeared from the properties: 

rule._Rule__data.keys()
[u'localizedRuleName', u'urlBlocks', u'ruleImpact']

Original issue reported on code.google.com by [email protected] on 21 Nov 2013 at 3:20

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.