__init__ constructor
Leave feedback
On this page
Initializes a new data source with data from a JSON file using default parsing options.
def __init__(self, json_path):
...
| Parameter | Type | Description |
|---|---|---|
| json_path | str |
The path to the JSON file to be used as the data source. |
from groupdocs.assembly.data import JsonDataSource
json_data_source = JsonDataSource("staff-member.json")
Initializes a new data source with data from a JSON file using the specified options for parsing JSON data.
def __init__(self, json_path, options):
...
| Parameter | Type | Description |
|---|---|---|
| json_path | str |
The path to the JSON file to be used as the data source. |
| options | JsonDataLoadOptions |
Options for parsing JSON data. |
Initializes a new data source with data from a JSON stream using default parsing options.
def __init__(self, json_stream):
...
| Parameter | Type | Description |
|---|---|---|
| json_stream | io.RawIOBase |
The stream of JSON data to be used as the data source. |
import io
from groupdocs.assembly.data import JsonDataSource
json_array = """[
{ "name": "Amara Osei", "age": 41 },
{ "name": "Jonas Weber", "age": 37 },
{ "name": "Lena Park", "age": 29 }
]"""
json_data_source = JsonDataSource(io.BytesIO(json_array.encode("utf-8")))
Initializes a new data source with data from a JSON stream using the specified options for parsing JSON data.
def __init__(self, json_stream, options):
...
| Parameter | Type | Description |
|---|---|---|
| json_stream | io.RawIOBase |
The stream of JSON data to be used as the data source. |
| options | JsonDataLoadOptions |
Options for parsing JSON data. |
- class
JsonDataSource
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.