AdRiley
Posts: 17
Joined: Wed Oct 26, 2011 9:27 pm

gpsd documentation

Tue Aug 07, 2012 3:07 am

Anyone know where I can find the documentation for the gpsd python client drivers?
www.raspberrypiblog.com

User avatar
accuser
Posts: 8
Joined: Fri Jul 20, 2012 4:33 am
Location: Cornwall, UK
Contact: Website

Re: gpsd documentation

Tue Aug 07, 2012 5:34 am


AdRiley
Posts: 17
Joined: Wed Oct 26, 2011 9:27 pm

Re: gpsd documentation

Tue Aug 07, 2012 2:02 pm

Well actually I've already been there and I have a couple of problems with that page:

1. This (http://www.catb.org/gpsd/client-howto.h ... n_examples) is actually the latest version of that page (it seems gpsd have moved their website, but not redirected the old one).
2. So table 1 seems to be the kind of thing I am after: lists of methods which I can call. But then you get down to the python example and it doesn't seem to use any of the methods listed in the table, but does use a few which are not.

All I really want to know at this point in time is what type of object does the next() method return on this line "report = session.next()" and what methods and members that object has. Other open source libraries I have used in the past have had documentation which details the classes and their members at least, but so far I am struggling to find that for gpsd.

I guess if it doesn't exist I will have to download the source code and do it from there, but as a consumer of the library I feel like I shouldn't need to do that...
www.raspberrypiblog.com

timhoffman
Posts: 85
Joined: Sat Nov 05, 2011 11:31 pm

Re: gpsd documentation

Wed Aug 08, 2012 1:30 am

The next() call is to support iterating so you can do

Code: Select all

  
session = gps(**opts)
session.stream(WATCH_ENABLE|WATCH_NEWSTYLE)
for report in session:
        print report
You wouldn't normally call next your self.

The level of documentation projects have is very much up to the project members and this is opensource, every one can muck in. Many/most projects are there to scratch an itch. At least with open source you can "use the source luke" ;-) and that is often far more informative than a lot of docs.
Unfortunately this is one of the really bad ones re: docs ;-( So it's going to be the source.

Though this link might be helpful http://blog.perrygeo.net/2007/05/27/pyt ... -bindings/

Cheers

BlackJack
Posts: 288
Joined: Sat Aug 04, 2012 8:28 am
Contact: Website

Re: gpsd documentation

Wed Aug 08, 2012 12:09 pm

@AdRiley: You can use `type()` and `dir()` to find out which type and attributes an object has. Interactively playing with code in Python shells like IPython might also be handy. It has tab completion for objects and an easy way to look at the source code of whole modules or smaller parts like classes, functions, or methods.

Code: Select all

while not self.asleep():
    sheep += 1

danmandle
Posts: 3
Joined: Thu Sep 06, 2012 6:36 am

Re: gpsd documentation

Thu Sep 06, 2012 6:37 am

Hey Guys,

I was wondering the same thing. So I did some research and did a write-up: http://www.danmandle.com/blog/getting-g ... th-python/

Feedback appreciated.

Return to “Python”