-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
1,087 additions
and
498 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -113,5 +113,5 @@ examples/tmp.py | |
# mypy | ||
.mypy_cache | ||
|
||
# documentations | ||
docs/ | ||
# mkdocs outputs | ||
site/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
# `iotoolz` | ||
|
||
## v0.1.0 | ||
## v0.1.0-rc-3 | ||
|
||
- Converted sphinx docs to mkdocs for better look and feel. | ||
- Removed the need for a context manager for the iterable. | ||
- Renamed the 2 abstract methods. | ||
|
||
## v0.1.0-rc-2 | ||
|
||
- Initial Release | ||
|
||
- Features: | ||
- `iotoolz.AbcStream` is an abstract class to represent any IO. It follows the `open` very closely. | ||
- `iotoolz. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{!CHANGELOG.md!} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# AbcStream | ||
|
||
::: iotoolz:AbcStream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# FileStream | ||
|
||
`iotoolz.FileStream` is a helper | ||
|
||
::: iotoolz:FileStream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# HttpStream | ||
|
||
`iotoolz.HttpStream` is a helper | ||
|
||
::: iotoolz:HttpStream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# StreamInfo | ||
|
||
::: iotoolz:StreamInfo | ||
selections: | ||
members: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# iotoolz.streams.Streams | ||
|
||
::: iotoolz.streams:Streams |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# TempStream | ||
|
||
`iotoolz.TempStream` is a helper | ||
|
||
::: iotoolz:TempStream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{!README.md!} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# iotoolz.streams | ||
|
||
The module `iotoolz.streams` provides a helper class | ||
[iotoolz.streams.Streams](./classes/Streams.md) to manage the different concrete | ||
AbcStream classes. | ||
|
||
It also provides a default `iotoolz.streams.Streams` singleton which support most of the | ||
implemented streams. The singleton object's methods are exposed as module callables: | ||
|
||
- `open_stream`: corresponds to `iotoolz.streams.Streams.open` | ||
- `register_stream` : corresponds to `iotoolz.streams.Streams.register_stream` | ||
- `set_schema_kwargs`: corresponds to `iotoolz.streams.Streams.set_schema_kwargs` | ||
|
||
## Usage | ||
|
||
```py | ||
from iotoolz.streams import open_stream, register_stream, set_schema_kwargs | ||
|
||
# do not verify the ssl cert for all https requests | ||
set_schema_kwargs("https", verify=False) | ||
|
||
# print line by line some data in from a https endpoint | ||
with open_stream("https://foo/bar/data.txt", "r") as stream: | ||
for line in stream: | ||
print(line) | ||
|
||
# Post some binary content to a http endpoint | ||
with open_stream("https://foo.bar/api/data", "wb") as stream: | ||
stream.write(b"hello world") | ||
|
||
# Read a file from local path | ||
with open_stream("path/to/data.csv", "r") as csv_source: | ||
# create a tempfile | ||
tmpsink = open_stream("tmp://foobar.txt", "w") | ||
# pipe content in csv_source to tmpsink | ||
csv_source.pipe(tmpsink) | ||
|
||
print(tmpsink.read()) # prints contents of csv_source | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
.doc-method, .doc-attribute { | ||
padding: 5px 5px; | ||
} | ||
.doc-method:nth-child(odd), | ||
.doc-attribute:nth-child(odd) { | ||
background-color: #f1f1f1; | ||
} | ||
.md-typeset h3 { | ||
border-bottom: 2px solid #eeeeee; | ||
padding-left: 5px; | ||
} | ||
h4.doc-heading { | ||
font-size: 0.9rem; | ||
} | ||
div.doc-contents { | ||
font-size: 0.7rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# iotoolz.utils | ||
|
||
::: iotoolz.utils | ||
selection: | ||
members: | ||
- peek_stream | ||
- guess_encoding |
Oops, something went wrong.