File: generators.py

package info (click to toggle)
python-ijson 3.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 668 kB
  • sloc: python: 2,687; ansic: 1,776; sh: 4; makefile: 3
file content (11 lines) | stat: -rw-r--r-- 240 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
import io


def _reader(json):
    if type(json) == bytes:
        return io.BytesIO(json)
    return io.StringIO(json)


def get_all(routine, json_content, *args, **kwargs):
    return list(routine(_reader(json_content), *args, **kwargs))