On Sun, May 8, 2016 at 6:07 AM, Hunter Jozwiak <hunter.t....@gmail.com> wrote:
> Hello,
>
>
>
> I am intending to start work on a Python program that will allow me to
> better manage my Digital Ocean droplets

It sounds like you're using the DigitalOcean API described in
https://developers.digitalocean.com/documentation/v2/


> Would it be better to just parse the data that Digital Ocean returns as a
> result of doing such things as a Get command, or would it be better to
> create a Droplet class with functionality specific to Droplets?

If I understand you rightly, then either approach is arguably ok.  It
really depends on what you'll intend to do in the short/medium/long
term, and how much you already understand about the final shape of
things.

The first approach sounds like you'll take the JSON and pull just the
minimal information that you care about.  I think that, in your second
proposal, you're talking about processing everything in the JSON
response, even the stuff that you're not immediately caring about at
this moment.

I believe the question you're asking is essentially: bottom-up, or top-down?

If it's just for your own one-off usage, and no one else has done
much, I'd prefer the first, because it's going to be less work, and
you can make certain simplifying assumptions to make your program
short, since you know exactly what parts of the JSON you can ignore.

Since you are starting off, you may not necessarily know the
appropriate structure of all the classes yet.  Rather than commit to a
particular top-down design, you might want to just do the simplest
thing first, get some exposure, and then build up from that
experience.


By the way, it does look like there are some Python libraries provided
by the DigitalOcean folks: you might want to take a look at them:

    https://developers.digitalocean.com/libraries/

and perhaps you can reuse those libraries.


Good luck to you!
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to