- 전체
- Python 일반
- Python 수학
- Python 그래픽
- Python 자료구조
- Python 인공지능
- Python 인터넷
- Python SAGE
- wxPython
- TkInter
- iPython
- wxPython
- pyQT
- Jython
- django
- flask
- blender python scripting
- python for minecraft
- Python 데이터 분석
- Python RPA
- cython
- PyCharm
- pySide
- kivy (python)
Cinema 3 - (Extremely Simplified) Example of Microservices in Python
Overview
microservices-master.zip
Cinema 3 is an example project which demonstrates the use of microservices for a fictional movie theater. The Cinema 3 backend is powered by 4 microservices, all of which happen to be written in Python using Flask.
- Movie Service: Provides information like movie ratings, title, etc.
- Show Times Service: Provides show times information.
- Booking Service: Provides booking information.
- Users Service: Provides movie suggestions for users by communicating with other services.
Requirements
- Python 2.7
- Works on Linux, Windows, Mac OSX and (quite possibly) BSD.
Install
The quick way is use the provided make file.
$ make install
Starting and Stopping Services
To launch the services:
$ make launch
To stop the services:
$ make shutdown
APIs and Documentation
Movie Service (port 5001)
This service is used to get information about a movie. It provides the movie title, rating on a 1-10 scale, director and other information.
To lookup all movies in the database, hit: http://127.0.0.1:5001/movies
GET /movies
Returns a list of all movies.
{
"267eedb8-0f5d-42d5-8f43-72426b9fb3e6": {
"director": "Ryan Coogler",
"id": "267eedb8-0f5d-42d5-8f43-72426b9fb3e6",
"rating": 8.8,
"title": "Creed"
},
...... output truncated ......
To lookup a movie by its id:
GET /movies/7daf7208-be4d-4944-a3ae-c1c2f516f3e6
Returns the specified movie.
{
"director": "Paul McGuigan",
"id": "7daf7208-be4d-4944-a3ae-c1c2f516f3e6",
"rating": 6.4,
"title": "Victor Frankenstein",
"uri": "/movies/7daf7208-be4d-4944-a3ae-c1c2f516f3e6"
}
Showtimes Service (port 5002)
This service is used get a list of movies playing on a certain date.
To lookup all showtimes, hit: http://127.0.0.1:5002/showtimes
GET /showtimes
Returns a list of all showtimes by date.
{
"20151130": [
"720d006c-3a57-4b6a-b18f-9b713b073f3c",
"a8034f44-aee4-44cf-b32c-74cf452aaaae",
"39ab85e5-5e8e-4dc5-afea-65dc368bd7ab"
],
...... output truncated ......
To get movies playing on a certain date:
GET /showtimes/20151201
Returns all movies playing on the date.
[
"267eedb8-0f5d-42d5-8f43-72426b9fb3e6",
"7daf7208-be4d-4944-a3ae-c1c2f516f3e6",
"39ab85e5-5e8e-4dc5-afea-65dc368bd7ab",
"a8034f44-aee4-44cf-b32c-74cf452aaaae"
]
Booking Service (port 5003)
Used to lookup booking information for users.
To get all bookings by all users in the system, hit: http://127.0.0.1:5003/bookings
GET /bookings
Returns a list of booking information for all bookings in the database.
{
"chris_rivers": {
"20151201": [
"267eedb8-0f5d-42d5-8f43-72426b9fb3e6"
]
},
...... output truncated ......
To lookup booking information for a user:
GET /bookings/dwight_schrute
{
"20151201": [
"7daf7208-be4d-4944-a3ae-c1c2f516f3e6",
"267eedb8-0f5d-42d5-8f43-72426b9fb3e6"
],
"20151205": [
"a8034f44-aee4-44cf-b32c-74cf452aaaae",
"276c79ec-a26a-40a6-b3d3-fb242a5947b6"
]
}
User Service (port 5000)
This service returns information about the users of Cinema 3 and also provides movie suggestions to the users. It communicates with other services to retrieve booking or movie information.
To get a list of all the users in the system, hit: http://127.0.0.1:5000/users
GET /users
Returns a list of all users in the database.
{
"chris_rivers": {
"id": "chris_rivers",
"last_active": 1360031010,
"name": "Chris Rivers"
},
...... output truncated ......
To lookup information about a user:
GET /users/michael_scott
{
"id": "michael_scott",
"last_active": 1360031625,
"name": "Michael Scott"
}
To get suggested movies for a user:
GET /users/michael_scott/suggested
[출처] https://github.com/umermansoor/microservices#cinema-3---extremely-simplified-example-of-microservices-in-python
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
댓글 0
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 8 |
[python, 그래픽] [파이썬 활용] 마우스 자동화 (pyautogui)
| 졸리운_곰 | 2022.11.26 | 437 |
| 7 |
[python, 그래픽] 파이썬 자동화 툴 - pyautogui 사용하기
| 졸리운_곰 | 2022.11.26 | 568 |
| 6 |
[python][image processing][파이썬][이미지프로세싱] 파이썬 영상 처리 (OpenCV)
| 졸리운_곰 | 2021.11.12 | 629 |
| 5 |
[Python, GUI tool] GUI drag & drop style GUI Builder for Python Tkinter
| 졸리운_곰 | 2021.05.17 | 613 |
| 4 |
[python 파이썬 2d 그래픽스] The Interesting Python Graphics Libraries for Python Programmers
| 졸리운_곰 | 2021.04.27 | 1227 |
| 3 | 파이선 텍스트 게임 샘플 Code for my First Text-Based Game | 졸리운_곰 | 2018.09.01 | 745 |
| 2 |
python Collada dae file Reading : 파이썬으로 콜라다 dae 파일 분석
| 졸리운_곰 | 2017.08.01 | 1064 |
| 1 |
matplotlib으로 하트 그리기
| 졸리운_곰 | 2017.03.04 | 2278 |

