News for hackers. Stuff that matters.
Re:Facebook quietly deprecated their Python/Ruby libraries f... by derefr on Friday April 08, 2016 @07:33PM (#11458982)
I'm surprised this hasn't been trivialized/automated away yet (or has it?) Some sort of language-neutral REST-protocol description language, that could be used to code-generate client libraries and also generate a test spec and documentation. Or maybe just a standard for media-types in HATEOS response types in specifying REST API "roots", to make them machine-discoverable, in a way where the result could be "cached into" a client-library.
Re:Facebook quietly deprecated their Python/Ruby libraries f... by haikuginger on Friday April 08, 2016 @10:01PM (#11459535)
This is a shameless plug, so I'll take my beating if it's appropriate. For the last few months, I've been working on a Python library, beekeeper, that's all about that. It essentially consumes a JSON description file that gives all the specs for an API, as well as information about its object structure, and then provides an intuitive, native-Python interface, typically with little to no additional code required.

You can check it out on GitHub at https://github.com/haikuginger/beekeeper, read more at http://beekeeper.rtfd.org, or just install it with pip.

I'm biased, but I think it's pretty cool.

Re:Facebook quietly deprecated their Python/Ruby libraries f... by bluk on Friday April 08, 2016 @07:51PM (#11459056)
I believe the current most popular flavor is Swagger ( http://swagger.io ) at the moment.
Re:Facebook quietly deprecated their Python/Ruby libraries f... by bpicolo on Friday April 08, 2016 @10:03PM (#11459545)
Despite having such quirks as: no Null support =|
Re:Facebook quietly deprecated their Python/Ruby libraries f... by encoderer on Friday April 08, 2016 @11:14PM (#11459709)
IME, especially building APIs for mobile apps: nulls suck anyway!
Re:Facebook quietly deprecated their Python/Ruby libraries f... by bpicolo on Saturday April 09, 2016 @11:41AM (#11461721)
Yeah, but nonetheless, are sometimes necessary. The suggested way is to just remove the field entirely, which is really a different sort of null.

Also, generic mapping types are second class citizens, id est just wanting to specify string -> string

Re:Facebook quietly deprecated their Python/Ruby libraries f... by encoderer on Saturday April 09, 2016 @07:59PM (#11464058)
I appreciate your point of view, but mine is different. For example, at Trulia, with a dozen different apps with millions of users and rich data in the app, there is a "no nulls" policy. It's just a convention: build sparse data structures instead of passing nulls.
Re:Facebook quietly deprecated their Python/Ruby libraries f... by brianwawok on Friday April 08, 2016 @08:27PM (#11459211)
So messing around with Python and rest APIs... Often a wrapper library for an API exists on github.. But why use it? If I use 6 APIs in my project I now just added 6 libraries that all do things like auth, connection pooling, error handling a little bit different. Meh. The actual work of code to json to API to json to code is simple (1 line usually), I would rather just learn the API and do it myself. You still need to learn the API to use the wrapper library...
Re:Facebook quietly deprecated their Python/Ruby libraries f... by cptn_brittish on Saturday April 09, 2016 @01:29AM (#11460078)
Sounds like the soap protocol. I've had to deal with it recently at work and paired with the suds python library auto generates the api for you
Re:Facebook quietly deprecated their Python/Ruby libraries f... by JonnieCache on Friday April 08, 2016 @09:19PM (#11459395)
Sounds suspiciously like SOAP to me.
Re:Facebook quietly deprecated their Python/Ruby libraries f... by pbreit on Friday April 08, 2016 @08:51PM (#11459314)
I could maybe see something like http://unirest.io or, to a lesser extent, http://swagger.io making sense.
Re:Facebook quietly deprecated their Python/Ruby libraries f... by wing328hk on Sunday April 10, 2016 @12:19AM (#11464874)
Have you tried using Swagger-Codegen (https://github.com/swagger-api/swagger-codegen) to generate API clients, documentation (markdown) and test spec?

Disclosure: I'm a top contributor to Swagger-Codegen

Re:Facebook quietly deprecated their Python/Ruby libraries f... by madeofpalk on Friday April 08, 2016 @08:47PM (#11459301)
I believe this is what AWS does to create all their libraries in the bazillion languages they support.
Re:Facebook quietly deprecated their Python/Ruby libraries f... by tomc1985 on Saturday April 09, 2016 @12:02AM (#11459838)
Honestly, unless the API is complex, why bother?

I feel like abstracting APIs into objects (essentially RPC calls?) creates too much of a dependency on the network. The friction of writing the calls and their handlers helps minimize their use :)

Re:Facebook quietly deprecated their Python/Ruby libraries f... by derefr on Saturday April 09, 2016 @04:13AM (#11460458)
Mainly because I code microservices in at least five languages, and want to be able to touch all the same third-parties from any given one of them.