Skip to main content

space-reader: Convert any file path into LLM-friendly inputs

Project description

Space Reader

space-reader is a tool that can read a workspace URL and convert the content into LLM-friendly format.

Installation

pip install sreader

Usage

from sreader import read

read("<workspace URL>")

Support Workspace

  • Local File (e.g., /Users/user/desktop/demo.pdf)
  • Local Directory (e.g., /Users/user/desktop/demo)
  • Remote File with Access (e.g., https://example.com/demo.pdf)
  • GitHub Repo with Access (e.g., https://github.com/user/demo)

Support Formats

Markdown

read("<workspace URL>", format="markdown")

"""
## /Users/user/desktop/demo
- ****
  - a.py
  - c.py
  - b.py
  - **d**
    - g.py
    - **f**
      - f.py
  - **e**
"""

JSON and Dict

read("<workspace URL>", format="json")  # or "dict"

"""
{
    "/Users/user/desktop/demo": {
        "files": [
            "a.py",
            "c.py",
            "b.py"
        ],
        "dirs": {
            "d": {
                "files": [
                    "g.py"
                ],
                "dirs": {
                    "f": {
                        "files": [
                            "f.py"
                        ],
                        "dirs": {}
                    }
                }
            },
            "e": {
                "files": [],
                "dirs": {}
            }
        }
    }
}
"""

Tree

read("<workspace URL>", format="tree")

"""
/Users/user/desktop/demo
└── 
    ├── a.py
    ├── c.py
    ├── b.py
    ├── d
    │   ├── g.py
    │   └── f
    │       └── f.py
    └── e
"""

Examples

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sreader-0.0.1.tar.gz (5.5 kB view hashes)

Uploaded Source

Built Distribution

sreader-0.0.1-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page