llama-index-readers-json


Namellama-index-readers-json JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
Summaryllama-index readers json integration
upload_time2024-08-22 06:24:40
maintaineryisding
docs_urlNone
authorYour Name
requires_python<4.0,>=3.8.1
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # LlamaIndex Readers Integration: Json

## Overview

JSON Reader reads JSON documents with options to help extract relationships between nodes. It provides functionalities to control the depth of JSON traversal, collapse long JSON fragments, and clean JSON structures.

### Installation

You can install JSON Reader via pip:

```bash
pip install llama-index-readers-json
```

## Usage

```python
from llama_index.readers.json import JSONReader

# Initialize JSONReader
reader = JSONReader(
    # The number of levels to go back in the JSON tree. Set to 0 to traverse all levels. Default is None.
    levels_back="<Levels Back>",
    # The maximum number of characters a JSON fragment would be collapsed in the output. Default is None.
    collapse_length="<Collapse Length>",
    # If True, ensures that the output is ASCII-encoded. Default is False.
    ensure_ascii="<Ensure ASCII>",
    # If True, indicates that the file is in JSONL (JSON Lines) format. Default is False.
    is_jsonl="<Is JSONL>",
    # If True, removes lines containing only formatting from the output. Default is True.
    clean_json="<Clean JSON>",
)

# Load data from JSON file
documents = reader.load_data(input_file="<Input File>", extra_info={})
```

This loader is designed to be used as a way to load data into
[LlamaIndex](https://github.com/run-llama/llama_index/tree/main/llama_index) and/or subsequently
used as a Tool in a [LangChain](https://github.com/hwchase17/langchain) Agent.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "llama-index-readers-json",
    "maintainer": "yisding",
    "docs_url": null,
    "requires_python": "<4.0,>=3.8.1",
    "maintainer_email": null,
    "keywords": null,
    "author": "Your Name",
    "author_email": "you@example.com",
    "download_url": "https://files.pythonhosted.org/packages/5f/cb/600721db94eab2657a29151b6a7f2c79b2c91711bd0cb20f1384c5e66587/llama_index_readers_json-0.2.0.tar.gz",
    "platform": null,
    "description": "# LlamaIndex Readers Integration: Json\n\n## Overview\n\nJSON Reader reads JSON documents with options to help extract relationships between nodes. It provides functionalities to control the depth of JSON traversal, collapse long JSON fragments, and clean JSON structures.\n\n### Installation\n\nYou can install JSON Reader via pip:\n\n```bash\npip install llama-index-readers-json\n```\n\n## Usage\n\n```python\nfrom llama_index.readers.json import JSONReader\n\n# Initialize JSONReader\nreader = JSONReader(\n    # The number of levels to go back in the JSON tree. Set to 0 to traverse all levels. Default is None.\n    levels_back=\"<Levels Back>\",\n    # The maximum number of characters a JSON fragment would be collapsed in the output. Default is None.\n    collapse_length=\"<Collapse Length>\",\n    # If True, ensures that the output is ASCII-encoded. Default is False.\n    ensure_ascii=\"<Ensure ASCII>\",\n    # If True, indicates that the file is in JSONL (JSON Lines) format. Default is False.\n    is_jsonl=\"<Is JSONL>\",\n    # If True, removes lines containing only formatting from the output. Default is True.\n    clean_json=\"<Clean JSON>\",\n)\n\n# Load data from JSON file\ndocuments = reader.load_data(input_file=\"<Input File>\", extra_info={})\n```\n\nThis loader is designed to be used as a way to load data into\n[LlamaIndex](https://github.com/run-llama/llama_index/tree/main/llama_index) and/or subsequently\nused as a Tool in a [LangChain](https://github.com/hwchase17/langchain) Agent.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "llama-index readers json integration",
    "version": "0.2.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c0a5544864d6d81a2070ed26fbc877ad03d438fcef1b37232efb65abbb60e121",
                "md5": "dc9c42bb9bcb4b9ba2d6b5208e94495c",
                "sha256": "71ea71aa3e2ea644769cff4f9c4fdedda771cd9449d7dbc4f9b9fa613f8475f2"
            },
            "downloads": -1,
            "filename": "llama_index_readers_json-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dc9c42bb9bcb4b9ba2d6b5208e94495c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8.1",
            "size": 3948,
            "upload_time": "2024-08-22T06:24:39",
            "upload_time_iso_8601": "2024-08-22T06:24:39.167248Z",
            "url": "https://files.pythonhosted.org/packages/c0/a5/544864d6d81a2070ed26fbc877ad03d438fcef1b37232efb65abbb60e121/llama_index_readers_json-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5fcb600721db94eab2657a29151b6a7f2c79b2c91711bd0cb20f1384c5e66587",
                "md5": "3cd3e89503de0048bd736db1b043a7f7",
                "sha256": "4b1c9adc8c3be6c97a98698abd131ef58f1b21687871f5d03d86c2c80be19ef5"
            },
            "downloads": -1,
            "filename": "llama_index_readers_json-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3cd3e89503de0048bd736db1b043a7f7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8.1",
            "size": 3567,
            "upload_time": "2024-08-22T06:24:40",
            "upload_time_iso_8601": "2024-08-22T06:24:40.431559Z",
            "url": "https://files.pythonhosted.org/packages/5f/cb/600721db94eab2657a29151b6a7f2c79b2c91711bd0cb20f1384c5e66587/llama_index_readers_json-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-22 06:24:40",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "llama-index-readers-json"
}
        
Elapsed time: 0.43881s