First time using an API...

Terry Reedy tjreedy at
Thu Feb 17 12:53:10 EST 2011

On 2/17/2011 10:17 AM, andrea crotti wrote:
> 2011/2/17 Matty Sarro <msarro at <mailto:msarro at>>
>     This may be kind of a stupid question, so please be gentle.
>     I've only ever used most programming in the past when shell scripting
>     couldn't handle what I needed done. So, I rarely dabble with things
>     like API's, or even python-isms. I just program to get things done.
>     Well, that's about to change :)
>     I am in charge of deploying a platform to allow people across my
>     company to access a variety of crunched metrics using splunk. I need
>     to allow access into the data using Splunk's RESTful API, which is
>     implemented in both java and python. The thing is, I have no idea how
>     to do that. I've looked through some of the documentation, and it has
>     me start a pydoc server on the system but when i navigate to the page
>     it just shows listings of functions. The descriptions would be great,
>     except they don't really tell me a lot. For instance, nothing really
>     seems to say "fetchRecord(user_name) fetches all records matching a
>     particular user name". Further, how do I actually use the API?
>     I appreciate any of the pointers you can offer. Its a big part of this
>     project, but my minor knowledge in programming isn't helping me much
>     here.
>     -Matty
>     --
> Well things are not always (almost never) documented as you would like.
> A suggestion I can give is to use ipython and play with the modules.
> Pass something in and see what you get.
> And better yet write some unit tests to see if the functions do what you
> expect they do.
> If the API is not completely dumb you should understand quickly how to
> use it.
> Also some other code that uses that library might be useful.

What would also help is a toy database small enough so you can calculate 
by hand what answers you expect to get.

Terry Jan Reedy

More information about the Python-list mailing list