blob: 7b48c824baea41fa358c5a5c9a1d7426902de900 [file] [log] [blame] [view]
Nathaniel Manista4e7ea932015-10-07 14:34:08 +00001gRPC in 3 minutes (Python)
2========================
3
4Background
5-------------
6For this sample, we've already generated the server and client stubs from
7[helloworld.proto][] and we'll be using a specific reference platform.
8
9Prerequisites
10-------------
11
12- Debian 8.2 "Jessie" platform with `root` access
13- `git`
14- `python2.7`
15- `pip`
16- Python development headers
17
18Set-up
19-------
20 ```sh
21 $ # install the gRPC Core:
22 $ sudo apt-get install libgrpc-dev
23 $ # install gRPC Python:
24 $ sudo pip install -U grpcio==0.11.0b1
25 $ # Since this "hello, world" example uses protocol buffers:
26 $ sudo pip install -U protobuf==3.0.0a3
27 $ # Clone the repository to get the example code:
28 $ git clone https://github.com/grpc/grpc
29 $ # Navigate to the "hello, world" Python example:
30 $ cd grpc/examples/python/helloworld
31 ```
32
33Try it!
34-------
35
36- Run the server
37
38 ```sh
39 $ python2.7 greeter_server.py &
40 ```
41
42- Run the client
43
44 ```sh
45 $ python2.7 greeter_client.py
46 ```
47
48Tutorial
49--------
50
51You can find a more detailed tutorial in [gRPC Basics: Python][]
52
53[helloworld.proto]:../protos/helloworld.proto
54[Install gRPC Python]:../../src/python#installation
55[gRPC Basics: Python]:http://www.grpc.io/docs/tutorials/basic/python.html