Skip to content

Commit 9390666

Browse files
author
Christopher Merrick
committed
improve README
1 parent 690727e commit 9390666

File tree

2 files changed

+41
-3
lines changed

2 files changed

+41
-3
lines changed

README.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,46 @@ python-stitch-client
33

44
A python client library for the Stitch Import API
55

6-
Quick Start
7-
-----------
6+
Use
7+
---
8+
9+
This library depends on python3 and a to-be-released version of
10+
`transit-python`. The first step is to setup the python environment
11+
and manually install the correct version of that library:
12+
13+
```bash
14+
› mkvirtualenv -p python3 stitch
15+
```
16+
17+
```bash
18+
› workon stitch
19+
› git clone https://github.com/cognitect/transit-python
20+
cd transit-python
21+
› python setup.py install
22+
```
23+
24+
Next, install this library:
25+
26+
```bash
27+
› workon stitch
28+
› git clone http://github.com/stitchdata/python-stitch-client
29+
cd python-stitch-client
30+
› python setup.py install
31+
```
32+
33+
Now you're ready to use the library. Using the same `virtualenv`:
34+
35+
```python
36+
from stitchclient.client import Client
37+
38+
with Client(int(os.environ['STITCH_CLIENT_ID']), os.environ['STITCH_TOKEN'], callback_function=print) as c:
39+
for i in range(1,10):
40+
c.push({'action': 'upsert',
41+
'table_name': 'test_table',
42+
'key_names': ['id'],
43+
'sequence': i,
44+
'data': {'id': i, 'value': 'abc'}}, i)
45+
```
846

947
License
1048
-------

stitchclient/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def __exit__(self, exception_type, exception_value, traceback):
162162
with Client(int(os.environ['STITCH_CLIENT_ID']), os.environ['STITCH_TOKEN'], callback_function=print) as c:
163163
for i in range(1,10):
164164
c.push({'action': 'upsert',
165-
'table_name': 'cm_test_table',
165+
'table_name': 'test_table',
166166
'key_names': ['id'],
167167
'sequence': i,
168168
'data': {'id': i, 'value': 'abc'}}, i)

0 commit comments

Comments
 (0)