Name | new-reader JSON |
Version |
0.1.9
JSON |
| download |
home_page | https://github.com/futzu/new_reader |
Summary | Read http(s), multicast, and udp streams like files |
upload_time | 2024-03-17 10:03:52 |
maintainer | |
docs_url | None |
author | Adrian |
requires_python | >=3.6 |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# `new_reader`
## Read `stdin`, `files`, `multicast`, `udp`, and `http(s)` URIs the same way.
```python3
from new_reader import reader
rdr = reader('udp://@235.35.3.5:3535')
rdr.read()
```
![image](https://user-images.githubusercontent.com/52701496/205797792-aee34f1c-039c-427b-87f4-709c3b6a8aa2.png)
## new_reader is used by [`threefive`](https://github.com/futzu/threefive), [`x9k3`](https://github.com/futzu/x9k3), [`gumd`](https://github.com/futzu/gumd), [`m3ufu`](https://github.com/futzu/m3ufu), [`superkabuki`](https://github.com/futzu/superkabuki), [`iframes`](https://github.com/futzu/iframes) , [`umzz`](https://github.com/futzu/umzz),[`showcues`](https://github.com/futzu/showcues),[`six2scte35`](https://github.com/futzu/six2scte35)and [`sideways`](https://github.com/futzu/sideways).
## How is `new_reader.reader` used?
```js
# print a mpegts packet header via https
>>>> from new_reader import reader
>>>> with reader('https://so.slo.me/longb.ts') as rdr:
.... packet = rdr.read(188)
.... print(packet[:4])
....
b'G@\x11\x10'
```
#### | more
- [x] `Files`
```js
from new_reader import reader
with reader("/home/you/video.ts") as data:
fu = data.read()
```
- [x] `HTTP(S)`
```js
from new_reader import reader
with reader('http://iodisco.com/') as disco:
disco.read()
# Add http headers like this
with reader('http://iodisco.com/',headers={"myHeader":"DOOM"}) as doom:
doom.read()
```
- [x] `Multicast`
```smalltalk
from new_reader import reader
with reader("udp://@227.1.3.10:4310") as data:
data.read(8192)
```
- [x] `UDP`
```lua
from new_reader import reader
udp_data =reader("udp://1.2.3.4:5555")
chunks = [udp_data.read(188) for i in range(0,1024)]
udp_data.close()
```
### `UDP` and `Multicast`
* reader will set `socket.SO_RCVBUF` to the maximum value allowed by the OS for `UDP` and `Multicast`.
* `socket.SO_RCVBUF` can also be set like this:
* On `OpenBSD`
```js
sysctl net.inet.udp.recvspace
```
* On `Linux`
```js
sysctl net.core.rmem_max
```
* On `Windows`
```js
I.have.no.idea
```
Raw data
{
"_id": null,
"home_page": "https://github.com/futzu/new_reader",
"name": "new-reader",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "Adrian",
"author_email": "spam@iodisco.com",
"download_url": "https://files.pythonhosted.org/packages/bd/be/4f8218c54ea7438c98d4ba55df3bf57ffe15c5b110737637381a5c7b8248/new_reader-0.1.9.tar.gz",
"platform": "all",
"description": "# `new_reader` \n## Read `stdin`, `files`, `multicast`, `udp`, and `http(s)` URIs the same way. \n```python3\nfrom new_reader import reader\n\nrdr = reader('udp://@235.35.3.5:3535')\nrdr.read()\n```\n \n \n\n![image](https://user-images.githubusercontent.com/52701496/205797792-aee34f1c-039c-427b-87f4-709c3b6a8aa2.png)\n\n## new_reader is used by [`threefive`](https://github.com/futzu/threefive), [`x9k3`](https://github.com/futzu/x9k3), [`gumd`](https://github.com/futzu/gumd), [`m3ufu`](https://github.com/futzu/m3ufu), [`superkabuki`](https://github.com/futzu/superkabuki), [`iframes`](https://github.com/futzu/iframes) , [`umzz`](https://github.com/futzu/umzz),[`showcues`](https://github.com/futzu/showcues),[`six2scte35`](https://github.com/futzu/six2scte35)and [`sideways`](https://github.com/futzu/sideways).\n\n \n ## How is `new_reader.reader` used?\n ```js\n # print a mpegts packet header via https\n \n>>>> from new_reader import reader\n>>>> with reader('https://so.slo.me/longb.ts') as rdr:\n.... packet = rdr.read(188)\n.... print(packet[:4])\n.... \nb'G@\\x11\\x10'\n```\n \n \n#### | more\n\n- [x] `Files`\n```js\n from new_reader import reader\n\n with reader(\"/home/you/video.ts\") as data:\n fu = data.read()\n```\n- [x] `HTTP(S)`\n```js\n from new_reader import reader\n\n with reader('http://iodisco.com/') as disco:\n disco.read()\n\n # Add http headers like this \n \n with reader('http://iodisco.com/',headers={\"myHeader\":\"DOOM\"}) as doom:\n doom.read()\n\n```\n- [x] `Multicast`\n```smalltalk\n from new_reader import reader\n\n with reader(\"udp://@227.1.3.10:4310\") as data:\n data.read(8192)\n```\n- [x] `UDP`\n```lua\n from new_reader import reader\n\n udp_data =reader(\"udp://1.2.3.4:5555\")\n chunks = [udp_data.read(188) for i in range(0,1024)]\n udp_data.close()\n```\n ### `UDP` and `Multicast`\n * reader will set `socket.SO_RCVBUF` to the maximum value allowed by the OS for `UDP` and `Multicast`.\n * `socket.SO_RCVBUF` can also be set like this:\n * On `OpenBSD` \n ```js\n sysctl net.inet.udp.recvspace\n ```\n * On `Linux`\n ```js\n sysctl net.core.rmem_max\n ```\n * On `Windows`\n ```js\n I.have.no.idea\n ```\n \n",
"bugtrack_url": null,
"license": "",
"summary": "Read http(s), multicast, and udp streams like files",
"version": "0.1.9",
"project_urls": {
"Homepage": "https://github.com/futzu/new_reader"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6434c42a81276be551f64b9425f3c358d1621b977fe7992048dbaf926ab7b7cf",
"md5": "7ccf3848a13fa2d1329ef15106cf83ef",
"sha256": "43b34a435a4bd7860fbd03c3ed1ca35be5a84cdf4e860272c23b10a656a87a9f"
},
"downloads": -1,
"filename": "new_reader-0.1.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7ccf3848a13fa2d1329ef15106cf83ef",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 3576,
"upload_time": "2024-03-17T10:03:50",
"upload_time_iso_8601": "2024-03-17T10:03:50.459828Z",
"url": "https://files.pythonhosted.org/packages/64/34/c42a81276be551f64b9425f3c358d1621b977fe7992048dbaf926ab7b7cf/new_reader-0.1.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bdbe4f8218c54ea7438c98d4ba55df3bf57ffe15c5b110737637381a5c7b8248",
"md5": "026a81e21427703214f900ddefcd57cf",
"sha256": "b4a5ce6996b5ce78b2d4127136ad76be6c7bd8a1dd7ba5d222b5683631b1f552"
},
"downloads": -1,
"filename": "new_reader-0.1.9.tar.gz",
"has_sig": false,
"md5_digest": "026a81e21427703214f900ddefcd57cf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 3292,
"upload_time": "2024-03-17T10:03:52",
"upload_time_iso_8601": "2024-03-17T10:03:52.194681Z",
"url": "https://files.pythonhosted.org/packages/bd/be/4f8218c54ea7438c98d4ba55df3bf57ffe15c5b110737637381a5c7b8248/new_reader-0.1.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-03-17 10:03:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "futzu",
"github_project": "new_reader",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "new-reader"
}