[Geoserver-devel] Proposal of Python examples for GeoServer REST API Documentation

Greetings.

I started to write a proposal[1] for the python section of REST
examples[2]. Almost textually based on the cURL examples[3]. I aim to
do all the examples.

I could change the idea and do a more creative work with another
examples, but first i would like to know if it is of your liking.

[1] https://gist.github.com/jgomo3/73f38cc5a91d85146ccf
[2] http://docs.geoserver.org/stable/en/user/rest/examples/python.html
[3] http://docs.geoserver.org/stable/en/user/rest/examples/curl.html

Yay! This is a great idea

Only comments are that I’d strongly suggest using requests in all the examples and just say “you can use the builtin http/urllib modules to achieve the same thing if for some reason you can’t use requests”. It is so much nicer, especially around error handling, auth, data encoding, …

Personally I’d also suggest using JSON rather than XML, and if you still want to use XML then construct/parse it using a proper library that escapes values correctly, rather than using string substitutions.

My 2c, feel free to ignore though

Rob :slight_smile:

···

Koordinates
PO Box 1604, Shortland St, Auckland 1140, New Zealand
Phone +64-9-966 0433 koordinates.com

This appears to be examples of using python "in the raw" to use REST (which is a fine thing) but not examples of how to use gsconfig.py?
(which is what I was expecting)

Notice: This email and any attachments are confidential.
If received in error please destroy and immediately notify us.
Do not copy or disclose the contents.

2014-11-13 15:22 GMT-04:30 Robert Coup <robert.coup@anonymised.com>:

On Fri, Nov 14, 2014 at 8:24 AM, Jesús Gómez <jgomo3@anonymised.com> wrote:

I started to write a proposal[1] for the python section of REST
examples[2]. Almost textually based on the cURL examples[3]. I aim to
do all the examples.

I could change the idea and do a more creative work with another
examples, but first i would like to know if it is of your liking.

Yay! This is a great idea

Only comments are that I'd strongly suggest using requests in all the
examples and just say "you can use the builtin http/urllib modules to
achieve the same thing if for some reason you can't use requests". It is so
much nicer, especially around error handling, auth, data encoding, ...

Personally I'd also suggest using JSON rather than XML, and if you still
want to use XML then construct/parse it using a proper library that escapes
values correctly, rather than using string substitutions.

My 2c, feel free to ignore though

Thank you for your feedback. Maybe the gain on legibility is worth the
"effort" of installing "requests". Ok, i'll do it with requests, maybe
JSON and evaluate the gsconfig.py

Rob :slight_smile:
--
Koordinates
PO Box 1604, Shortland St, Auckland 1140, New Zealand
Phone +64-9-966 0433 koordinates.com

2014-11-13 15:37 GMT-04:30 Phil Scadden <p.scadden@anonymised.com>:

This appears to be examples of using python "in the raw" to use REST
(which is a fine thing) but not examples of how to use gsconfig.py?
(which is what I was expecting)

I overview the `gsconfig`. If i play with it, it will flawlessly hide
all the REST concepts. Am I right?.

It seems that the examples in the Geoserver Documentation
REST section are there to ilustrate the interaction with the REST
conecpts. If this is true:

* I'll go with writing the examples using the `requests` library.
* It would be of value to include a `gsconfig` section in the
Geoserver Documentation, independently from the REST section.

Else:

* Definitely `gsconfig`.

Does this make sense to you?.

Notice: This email and any attachments are confidential.
If received in error please destroy and immediately notify us.
Do not copy or disclose the contents.

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

I think documented both is good idea. I like having the curl examples rendered in Python, but it would be also good to have outline of what gsconfig.py can do for you.

Notice: This email and any attachments are confidential.
If received in error please destroy and immediately notify us.
Do not copy or disclose the contents.