Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
eve - restful api for human
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
begood
January 24, 2018
Programming
0
72
eve - restful api for human
this is my slide for presenting in python meeting in PYMI and VCCLOUD
begood
January 24, 2018
Tweet
Share
Other Decks in Programming
See All in Programming
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2.4k
AI時代の認知負荷との向き合い方
optfit
0
160
CSC307 Lecture 02
javiergs
PRO
1
780
AI & Enginnering
codelynx
0
110
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
2.5k
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
AtCoder Conference 2025
shindannin
0
1.1k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
590
AgentCoreとHuman in the Loop
har1101
5
240
ぼくの開発環境2026
yuzneri
0
240
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
Featured
See All Featured
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
190
Code Reviewing Like a Champion
maltzj
527
40k
New Earth Scene 8
popppiees
1
1.5k
How STYLIGHT went responsive
nonsquared
100
6k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
53
Claude Code のすすめ
schroneko
67
210k
sira's awesome portfolio website redesign presentation
elsirapls
0
150
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Mobile First: as difficult as doing things right
swwweet
225
10k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Fireside Chat
paigeccino
41
3.8k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
420
Transcript
eve RESTful API for humans Quangvn - VCCLOUD
Eve được phát triển bởi
Mục lục: • Phần 1. Đôi điều về eve •
Phần 2. Tính năng • Phần 3. Ưu điểm, nhược điểm
Phần 1. Đôi điều về eve Đơn giản cùng với
setting.py mặc định ở cùng thư mục DOMAIN={“speakers”: {}} from eve import Eve app = Eve() if __name__ == '__main__': app.run()
Run simple $: python2 run.py * Running on http://127.0.0.1:5000/ (Press
CTRL+C to quit)
Call to api $: http GET :5000/blogs
{ "_items": [ ], "_links": { "parent": { "href": "/",
"title": "home" }, "self": { "href": "blogs", "title": "blogs" } }, "_meta": { "max_results": 25, "page": 1, "total": 0 } }
{ "_items": [ ], "_links": { "parent": { "href": "/",
"title": "home" }, "self": { "href": "blogs", "title": "blogs" } }, "_meta": { "max_results": 25, "page": 1, "total": 0 } } Những object trả về
{ "_items": [ ], "_links": { "parent": { "href": "/",
"title": "home" }, "self": { "href": "blogs", "title": "blogs" } }, "_meta": { "max_results": 25, "page": 1, "total": 0 } } Phần HATEOAS
{ "_items": [ ], "_links": { "parent": { "href": "/",
"title": "home" }, "self": { "href": "blogs", "title": "blogs" } }, "_meta": { "max_results": 25, "page": 1, "total": 0 } } Phần phân trang
Chỉnh sửa setting.py DOMAIN={“speakers”: {}} # mongo connection MONGO_HOST =
'localhost' MONGO_PORT = 27017 MONGO_USERNAME = 'eve_admin' MONGO_PASSWORD = 'eve_admin' MONGO_DBNAME = 'eve_demo' # /blogs RESOURCE_METHODS = ['GET', 'POST'] # /blogs/<id> ITEM_METHODS = ['GET', 'PATCH']
Chỉnh sửa schema blogs = { 'item_title': 'blog', 'additional_lookup': {
'url': 'regex("[\w]+")', 'field': 'name' }, 'schema': { 'name': { 'type': 'string', 'minlength': 1, }, 'content': { 'type': 'string', 'minlength': 1, } } }
Phần 2: Tính năng của eve Mongo Filter: ?where={“lastname”: “pymi”}
Phần 2: Tính năng của eve Python Filter: ?where=lastname==”pymi”
Phần 2: Tính năng của eve Sorting: ?sort=-_created (Giảm dần
theo ngày tạo)
Phần 2: Tính năng của eve Pagination: ?max_results=20&page=2
Phần 2: Tính năng của eve Projection: ?projection={“lastname”: 1} (Chỉ
trả về trường lastname)
Phần 2: Tính năng của eve Embedded: ?embedded={“blogs”: 1} (Trả
dữ liệu kèm theo blog)
Phần 3: Ưu điểm, nhược điểm Ưu điểm: • Dễ
sử dụng • Dễ triển khai • Hỗ trợ nhiều tính năng cần thiết để làm ra API • Có nhiều extension
Phần 3: Ưu điểm, nhược điểm Nhược điểm: • Schema
chưa có phần đổi tên trường • Chỉ dành cho API
Q & A
Lời cám ơn!