Skip to content

Commit 053c9ad

Browse files
author
Christopher Merrick
committed
make package importable, update README and LICENSE
1 parent 64990dd commit 053c9ad

File tree

4 files changed

+41
-28
lines changed

4 files changed

+41
-28
lines changed

LICENSE

-25
Original file line numberDiff line numberDiff line change
@@ -175,28 +175,3 @@
175175
of your accepting any such warranty or additional liability.
176176

177177
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.

README.md

+38-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,44 @@ stitchstream-python
33

44
Writes the stitchstream format from Python
55

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+
844

945
License
1046
-------

stitchstream/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .main import write_records, write_bookmark

stitchstream/main.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
_headers_written = False
77

88
def _writeline(s):
9-
print(s, flush=True)
9+
print(s)
10+
sys.stdout.flush()
1011

1112
def _write_headers():
1213
global _headers_written

0 commit comments

Comments
 (0)