File tree 4 files changed +41
-28
lines changed
4 files changed +41
-28
lines changed Original file line number Diff line number Diff line change 175
175
of your accepting any such warranty or additional liability.
176
176
177
177
END OF TERMS AND CONDITIONS
178
-
179
- APPENDIX: How to apply the Apache License to your work.
180
-
181
- To apply the Apache License to your work, attach the following
182
- boilerplate notice, with the fields enclosed by brackets "[]"
183
- replaced with your own identifying information. (Don't include
184
- the brackets!) The text should be enclosed in the appropriate
185
- comment syntax for the file format. We also recommend that a
186
- file or class name and description of purpose be included on the
187
- same "printed page" as the copyright notice for easier
188
- identification within third-party archives.
189
-
190
- Copyright [yyyy] [name of copyright owner]
191
-
192
- Licensed under the Apache License, Version 2.0 (the "License");
193
- you may not use this file except in compliance with the License.
194
- You may obtain a copy of the License at
195
-
196
- http://www.apache.org/licenses/LICENSE-2.0
197
-
198
- Unless required by applicable law or agreed to in writing, software
199
- distributed under the License is distributed on an "AS IS" BASIS,
200
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- See the License for the specific language governing permissions and
202
- limitations under the License.
Original file line number Diff line number Diff line change @@ -3,8 +3,44 @@ stitchstream-python
3
3
4
4
Writes the stitchstream format from Python
5
5
6
- Usage
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/stitchstreams/stitchstream-python
29
+ › cd stitchstream-python
30
+ › python setup.py install
31
+ ```
32
+
33
+ Now, from python code within the same ` virtualenv ` , you can use the
34
+ library:
35
+
36
+ ``` python
37
+ import stitchstream as ss
38
+
39
+ records = [{' id' : i, ' value' : ' abc' } for i in range (0 ,10 )]
40
+ ss.write_records(' my_table' , [' id' ], records)
41
+ ss.write_bookmark({' my_table' : i})
42
+ ```
43
+
8
44
9
45
License
10
46
-------
Original file line number Diff line number Diff line change
1
+ from .main import write_records , write_bookmark
Original file line number Diff line number Diff line change 6
6
_headers_written = False
7
7
8
8
def _writeline (s ):
9
- print (s , flush = True )
9
+ print (s )
10
+ sys .stdout .flush ()
10
11
11
12
def _write_headers ():
12
13
global _headers_written
You can’t perform that action at this time.
0 commit comments