Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python/stathat.py improvements (onboarding instructions broken) #15

Open
dkuebric opened this issue Feb 23, 2016 · 1 comment
Open

python/stathat.py improvements (onboarding instructions broken) #15

dkuebric opened this issue Feb 23, 2016 · 1 comment

Comments

@dkuebric
Copy link

In your example you provide the following sample:

from stathat import StatHat
stathat.ez_post_value('some@email', 'sign in - age of user', 27.0)

If followed faithfully, this example fails for two reasons:

  1. StatHat class is capitalized, and module not imported -- the second line doesn't resolve symbol properly
  2. If I assume I ought to have capitalized the class in 2nd line (that's what I imported), I'd find that non-instance class members should be decorated with @classmethod or @staticmethod in python -- calling ex_post_value on the class directly rather than an instance of the class will fail

I'd recommend wrapping these in a class that you can initialize with an API key so you don't have to pass the API key to every method call, and amending the instructions to instantiate the class. Or you could use static/class methods, or skip the class entirely.

Additionally, I noticed you provide a ruby gem. It's easy to do similar packaging with pypi for python: https://packaging.python.org/en/latest/distributing/#uploading-your-project-to-pypi

@dkuebric
Copy link
Author

Ah, found https://github.com/kennethreitz/stathat.py -- you guys should point at that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant