Add to Watchlist

Eve - REST APIs for Humans™


Citation of segment
Embed Code
Purchasing a DVD Cite video

Formal Metadata

Title Eve - REST APIs for Humans™
Title of Series EuroPython 2014
Part Number 98
Number of Parts 120
Author Larocci, Nicola
License CC Attribution 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
DOI 10.5446/20012
Publisher EuroPython
Release Date 2014
Language English
Production Place Berlin

Content Metadata

Subject Area Computer Science
Abstract Nicola Larocci - Eve - REST APIs for Humans™ Powered by Flask, Redis, MongoDB and good intentions the Eve REST API framework allows to effortlessly build and deploy highly customizable, fully featured RESTful Web Services. The talk will introduce the project and its community, recount why and how it's being developed, and show the road ahead. ----- Nowadays everyone has data stored somewhere and needs to expose it through a Web API, possibly a RESTful one. [Eve] is the BSD-licensed, Flask-powered RESTful application and framework that allows to effortlessly build and deploy highly customizable, fully freatured RESTful Web Services. Eve features a robust, feature rich, REST-centered API implementation. MongoDB support comes out of the box and community-driven efforts to deliver ElasticSearch and SQLAlchemy data layers are ongoing. Eve approach is such that you only need to configure your API settings and behaviour, plug in your datasource, and you’re good to go. Features such as Pagination, Sorting, Conditional Requests, Concurrency Control, Validation, HATEOAS, JSON and XML rendering, Projections, Customisable Endpoints, Rate Limiting are all included. Advanced features such as custom Authentication and Authorisation, Custom Validation, Embedded Resource Serialisation are also easily available. In my talk I will introduce the project and its community, recount why and how it's being developed, show the source code, illustrate key concepts and show the road ahead.
Keywords EuroPython Conference
EP 2014
EuroPython 2014
what moment equal of course talking the rest of you know as we humans fj good morning and thank you so here but for story tool 2 years ago in 2012 it was a dual pricing Florence and there was a talk about giving the rest of the eyes with faster uh that was a kind of a
training event you don't told could and there was a lot of interest about that project and the coordination with but then and people were asking me for that we were
thinking about releasing him that that kind of application as open source projects and they sold even which is the product of which that thing going to show you today is basically the offspring of that will consolidate kind that called for me to be here again you you by some and presenting it uh the results of that even so Western yeah for human so I guess is 100 % of you will know that the user said land from a concise protest which is basically a client side over many buys arrested the and the reason why I am doing this is because basically the beam Badia behind the rest of the i framework is the same as the test of which he is a man so the things as simple as possible and then uh and so here it is in when I will just keep about on these lines and so you
already have from my chair uh speaker and what I do for work for just and the what is
the theory that the philosophy of even basically you have some that are still somewhere so that the and you need the rest of the i to expose your data to some kind of normal by client maybe or whether a website with what have you and what you do is just think installing and in a few of forward hopefully in a few minutes you get uh working at TI uh over for you it is probably by flask as I told you already 1 would you be a way is for if you'll features and a few other things about this and extreme uh guys in town essential so uh analytic quickly quick start this so you get an idea of
what they're working with these a framework that means how many of you are working with classical radio Ivan idea always so if you will uh work we trust you can recognize this core that is basically a quick start from the fast side that the only difference is that the you are you using the you instead of
faster this is because he basically is just a subclass of class so everything you can do with plastic with the and is a probably and Lydia because I see people using the that as a yes is arrested the but also as fast as so they're using blueprints for example for adding new features the and stuff like that uh um then the other thing you need to do use you you
need the to that we just so and you need a satisfied where you basically a design your API and the
baby here is like general our framework you just have a text file and in this case we have a duty new tools and points security eyes people and books as you see we haven't finding anything for these points so we have basically just saying hey I want to end points on my nearest the ice and and points are people I'm books and that is you just announced the API
and your API is up and running generation tools work for you a for a simple you can access the people point that you see that even if we the financing for the end points and that we did you notice we didn't define and the any kind of that connection actually but a the EPA is working anyway what you get here is if you'll need that out there in the years so items which is supposed to be the least of items from the people collection which is on the of course and the links and uses a different from MIT the field and the musical belief in a few maintenance but you can already guess was going on there on the other it so the user uh um aged 18 always here said on or how to speaking english but it basically they have just links to lead the I M points and you can if you want to you can do it bright your client in a way that it can it mitigated is a leading center view that the client the PID and uh but at the client that you eat is based on these links you can at time this feature off if you want to this
OK I'm just giving it seems that blessed them commitment database now a very simple of course and then a why we are here let's also the find some schema for our and point so here what we're doing is a defining a few feel so uh and that we are using a and we have to find some types and some of them evaluation use so over the name field is a stranger has a maximum and that it is unique and you may feel that we can existing of course but we can also set the rejects of evaluation of the of fuel don't use these
events was axing production because it such as a but we just have to leave you with NATO over what you can do and then you OK and that even if you look at the schema key or about the other you can even an analysis of the Chinese with it within the Chinese least within the Chinese and whatever you this and then we can by the
for the and the idea is that we'd only about of course of course you can change that in this case we either has them enabling them in writing to the API and point that we
are also we know uh edit of the items that are replacing the items and the leading the items so you have to do these explicit otherwise the PID point will be read on the use of course for safety reasons and the yep here's if you
more the top was adjusted for you what you can do you can set cash contour on that point in additional caps of other stuff and so we defined our API and point that we we wrote that last 3 that with a
few lines of and what do we get from these for the well 1st of all the wealthiest us for example with you your clients that can query
the points it if they can do that using a Mongol
uh seen gets of sources so here you have an example where we are creating the people in 1 for the last name bill but you can also use their Python is if you prefer this is because maybe if you if you're clients is being right and right brought by you you can use Monge and that is not a big deal about for example if you expose your API war cycle to people actually using media they don't know anything about model maybe you prefer to use a difference in can do that you can
act as I have something on your point that in this case we have something like this and order you can use pagination it is enabled by default so for example here we are asking give me page 2 and the only 20 days after a maximum projection and this is very nice you can do is say you have in your comment we know we've not uh 50 fields of uh you can say don't give me these fears saying these are best but the client because I want to say that we saw on performance for example in this case we are at a turning the API don't send needed pictures for several months and the other because of the need here we have and the quantity on a tiny last name for example which is very handy if you're using the you're writing a mobile application for example you want optimize the traffic and that it did not have been sent on the wire this and analytical feed is embedded resources and so basically what I'm here we will see an example of here we have we are asking to embed also feel that this what doesn't mean
that by default we will get a document you won't get therefore we also feel that use a foreign key for maybe another point this is what you would that by default but if you
will send a request that we the the embedded the keyword that what you get is an embedded by the document with the food
that also uses a gain that to avoid that sending truly tests and therefore the for the data that you need the on you apply by default the URI
PI was supported Boston on an exam and and here you have an example although the resources we do use
only 1 of them well right away all the field names so for me to meet a few of names of all the way be useful you can change whatever you see here discrete your needs and it is
the same resource in exam we
already in the sol hypermedia as the engine of application state of water that's quickly look at here just 11 idea and you get the link to the same item to the power and tied them next the pages of pagination is enabled and the web more pages you get that in the last stages and
even in the last phase of course and in all these features are enabled by default but you can switch them off for a simple you don't want the schools about the exam and switch it off to the wanted it to those you you don't of except you can customize the API however you want the version is something that we just the really that we the added the velocity is 0 and it
is basically a need for documents and if you will allow me and then what you can do you do when you switch is on basically you get measuring Fourier documents uh these people as being contributed by its basics engineering actually sold I am very proud of that and then and now you see here uh and we are asking for regression tree of over 1 document or they give me all the Doppler versions of the documents all you can even ask for the death the least or that between documents maybe this is not something that everybody is not static equal 1 10 5 storage you can install feistily icenses it by default the video is uh supported by monkeys is using mobile we are storing indeed affairs which is basically a optimizes for 5 similarly be common you are using more and more
things about think about using when the feudal OK not with with the number uh we we see
that there is also an RC colostomy brands 4 years later so keep your hopes side and there is here an example of our tool
and start over 5 when you define define your and point of as we saw earlier that you can define the string type but you can also define any and
then I will use the center your data and what you do is just the user a most about the the format it is that the former story in Boston and you send your peak along with the other fields of development of speech and when you get to
that document vector you go to the beach or as a basis for string of uh um
and you can also and all of these are extended media force setting which basically is going to give you will not only be find itself but also the standard the media uh the meat about about this field so for example content type the name of the file size except again you can disable well for starters however wish rate limiting this is
followed by the way this is and what you can do here is set the number of a recursive that a single guy and he is allowed to perform your exceed and pointed but meaning to or at the edge of the system unit but this time we here we have an example where we have a set thing that get the mass of them easily meet at 1 request that amino between the so you can have different a lean meat so that needs over and different time windows as well as for every single point so the 1st that deaths that easily is answer by DAPI and gained header section so you get information about the rate-limiting so you only have worked a you did you the right that is 1 request allowed only the point in the note that you have the or remaining and the next president of the thing we w is at that time point in time the 2nd request within the same you know we get the true too minor to major test is just give you an example of how this what it is possible this is of course a useful if you want if you ever performance issues or if you want to avoid the your API getting hammered by some clients maybe about a client of somebody trying to do some kind of a weird thing or tactile European conditional attested uh um so the client can send a request the using the modified scenes had the and the for sample of the retirement the time needed data and the data from the user point only if he does change of seasons so we don't get back always the summer at the same time that I don't mind people and point example and so you have you a i.e. when I get back to the 1st is a set that this is the the next because they can get back to you data only and are not all the that that of the if matches is similar uh but we're using the text here so this is mostly used on the item and points so not only people employed by only a single person point and for and what it does is the same things basically is mediated by personality in the sense of the standard the results support for about surface uh so you can send multiple documents on the API and pointer with a single
record as here we're sending to retrieve documents for example
and when you get back to as a response is error rate over the sponsors actually because evaluation is performed the embassy development and then uh the actual mediated tool options here you can analyze which of course means more than of which is the default in this case you are only going to the middle of a battle with it they will be useful for sending in
a subsequent recursively there and stuff like that or you can uh basically saying every time
sending back the toward local meant included emitter fears something we want that was just added to the
but if you so if it so quickly on that and that a controller you basically we are basically using the tags for a given that integrity Texas so when you try to modify a document that if you don't provide any match had you what and going to get the patchiness fact the you going to but the to get for a tree back uh if you'll send need to about these eat that is not matching the tag on the server of your way to get there a precondition for you there if you
give me the the tag which matches the
matches is the document on the server then they did it with the goal in widely used is because we want to avoid that a client with an old
version of the document overriding a newer version of the document and 7 so on the client already ignores evolved in the latest release of the document can update yeah the validation of course the thing is that we have here we have
a response example over and above
the insert the word the 1st documented got an error and the kingdom is not unique but uh this is was accepted there is support for authentication authorization so basically talking and and age matter which is basically what the Amazon trees using them on the platform in here so on the kind of Python subtree therefore it and by buying Q that and there's a lot more stuff that we don't have time to go over that is is here rationing it means that API rationing and on document reference so you can have basically a URI point validation 1 essential issue tree of the your API if the yes the license of open source you can do whatever you want with if you don't all me and money and uh OK with so uh uh so far it is what you get for free without any of quality you just have to the Buddha's reaches
on and off the you'll ever have this feature as we at the timing on and off about what the body that oversees what How can I customize I yeah but you example for simple you can have a custom that delirious so
in this case and this is what we see is that the course from the as well as to me branch which is a work in
progress and the broadest sense what you is basically a subclass of the debate is that that a uh um and then you will often write your around layer for example we have an extension which is called the evil elastic and these using success and then here we have a sequentially actually whatever you want to use this is an example of
a signal to me by the way here we see that in these approaches
what are the ways of using the basic allogeneic classes and then you will just have it use of a schema so you don't have to to write the the the the resource came in the 2nd 5 because it's a cartoon is already providing you the classes with the In this implementation of the UN point I have here is a
sample of the associated that
a and the being is doing exactly the same just of the base and that authentication
and this is where you actually have to
some water because you need people a subclass of the base class here and provided integration was by yourself it
is of course because this is something you want to be able to control the and you can do a lot of stuff we know that occasionally you can the doctor would you cannot only sustained points in the
other points open tool and the public order on read-only write-only right whatever broad-based the access control over there is a lot of stuff here but that we have to look at it just 2 steps was that oriented give you an idea of how you do this you basically just importing your
class of physical stress you will override user cost me so that here we have basically saying hey it whatever uh protest comes and point we username and mean possible sequence that the goal is is it is good to go otherwise it only reason that k in another loud response and then what you do is when you we it you'll create your EU EU stance you just as your custom class to lead to leave and the city and it the I is not perfect of course in this case we have just setting the user protection of for the water the API and points about the you can actually change your classes for a Europe for every and every single
endpoint or as I said before you can even leave some points without protection and all the week and what is to in them consolidation you can add the custom data
types of customer relation
logic if you need to and that is very nice because for example in the next 3 years will be allowed to support for the eulogies on and so you you will have a point-to-multipoint polygonal ionomycin and or this kind of stuff a and then we have even talk so this is my choice annoying but
it will quickly on this but uh with the time is short on so uh this is very nice because it when it's something is going to happen on your API what you
can of coke callback function on basically every ain't even so here for you see that you can specify a day and callback function every time an item is is being set
for the or often is being set the same happens with their batch Full deleted and with ever have you there is
a simple example of here what we are going in this example the user of the documents that the kind sending Ghazali that you feel that uh so you just define it your about function here we are and you see that the the functions is getting better so so basically this uses the endpoint and documents in the collection of documents being suggested to that that are going to be inserted in the mobility and what it what I'm doing here is a just adding a new field of overriding this field the the the it exceeds a given his presentation of force in the set of fibers is high is them and you have about the data and then and then when you are about to launch your API you just hope you're function to the court but can see now and then you have customer
5 sources said before we store only the 1st by for the but you can change it whatever you want there is a guy who did then as 3 and class for example so he's a UV Stasi storing the data owner has 3 and necessary or you can install store 5 sees them so with everyone and then there is the comunity just as my if you also meet the uh there are a few extensions available already registered by the community for sampling even doxies a diesel medical product actually that is generates the condition for the and what it does it is because you get the and it docks and point and then when the
people excessive that that point to a instead of getting a geometry similar they're getting a amount data we have the condition of the API and the um um it it is effectively maintained that on the multiple tube with us on this project the and what basically gives you all enough to make the the the to show for
the API you mumbling gene and disease and basically a connector between the and model and you know if anybody you using a model and you know you can do what we have seen we seek a lot to me with or and for a moment look you elastically told about it we so it already even more calories a marking tool for even and the thing that
matters to me is that that the
community about evil is quite he started to grow quite a bit at the moment we have about 50 contributors to the
project but what they really looking for is more contributors running the project so if you're in this kind of stuff you don't know that that you can actually contribute to the project as it is on the tab of course and that we have a fuel old tickets open and within specific looking for that people are willing to walk along this a branch because it is now feudal completed it is about the before mentioned indeed what any of these people are actually wanting to work on this actually branch even after these is being reduced the want to members of this is the the the density and then have the people complain because substances water I don't want to look at the precise and because it is not my kind of job I'm doing as something so if you'll want toward joining them in this project and you're interested please do so
we are working on duties on the for the next release so you if you
whether you would be able to define a and your that upon the dual of the blind and and but additionally you candle queries along this kind of stuff for example you don't be and if you all customer and addresses some of stuff is coming up in the main news on the pipeline basically this is the a URL for the project so you can go there and the commendation get to the of a depository and see the change all the collected in touch with me of all my Twitter account of course so you can get in touch with me even at these account if you will to the tablet to the quality of a github . there is mentioned a guy out you find this so support for the project and if you want to attend and you can follow me and they a user used to the update
on around the managers of the new column is coming under commenting and sometimes even uh at the moment like complaining about stuff like and stuff like that but what if you want you can follow me on Twitter and basically that's if I wanted to give you a little bit more but I don't think we have time for a heavier people so if anybody wants to go see something working just 1 thing there is there is actually a I achieved here this basically an online the of an API this week you can consume with your clients we even we they're just home for example is is Boston and but if you go to 0 if there more and more quot . com and this uses less people what you get back using the exam and because of the chromosphere addressing some of that about it basically you can usually at the eyes and play with the tests and get to request and stuff like that and play and see what the what the for simple here buying asking for the people and . 2 with the land where people as have a wider last within doing here is using they actually here local applications remote you compare with the basically and then
and and get 1st hand experience DAPI thank the
thank you the mean a little bit time for questions so please raise your hand and I come all the microphone thanks so so that that was really interesting things I didn't have any support for testing nearest today the best thing you uh did you will make testing I in there is a huge a test suite on the on the people saw a every few theories of being tested there when every on every commenter usually to to the and so up so the what I mean is it's easy to create the yeah but what if I want to have some desperate for my for my API that they don't use your grandma some but I I disease blue because you will you can and basically really again is a festive occasions stressed so whatever you can do with rescue could we always means that when you can do tests very easily on on not your idea I actually you can also use our test the tool was see how it's done is done and then I implement around as your own ideas that these and in the test suite is something of a pole which I'm mankind kind over annoyed me so about it is so I kind of proud because there are many think 5 7 5 under the tests and the day and test and everything but it is indeed over some effective actually so if you'll that that's another another idea when you called thing about joining the project and you could but thanks for your project you also supports your else set of ideas for showed us that the book and the author of the ID Griffey you're out of 790 yes is what you can do it do show here is you can actually have a nested the URIs so for example you can have both a and C pieces that should CKD Celestia people as measured be by the for example so the pedal somewhere in the in the city and this is not really good example for them that they you and you can design your as in season again it is a 1st application so you can you can even at a defined a and an additional URL from the 7 point for example if you don't like the idea which is the overall number of course so you can define now in New York and there is the on the last name for example so uh on API . com was last uh and this means we get the or a person with the last name of meat so yes you can play with the euro will be quite good things of a thank you again because I think you guys
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation


  527 ms - page object


AV-Portal 3.8.0 (dec2fe8b0ce2e718d55d6f23ab68f0b2424a1f3f)