# Space Reader
`space-reader` is a tool that can read a workspace URL and convert the content into LLM-friendly format.
## Installation
```shell
pip install sreader
```
## Usage
```python
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
```python
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
```python
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
```python
read("<workspace URL>", format="tree")
"""
/Users/user/desktop/demo
└──
├── a.py
├── c.py
├── b.py
├── d
│ ├── g.py
│ └── f
│ └── f.py
└── e
"""
```
## Examples
- [Simple print](https://github.com/huangyz0918/space-reader/blob/main/example/simple.py)
- [File system Q&A Chatbot](https://github.com/huangyz0918/space-reader/blob/main/example/chatbot.py)
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
Raw data
{
"_id": null,
"home_page": "https://github.com/huangyz0918/space-reader",
"name": "sreader",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "LLM, Large Language Model, data processing, data science",
"author": "Yizheng Huang, Silin Meng",
"author_email": "huangyz0918@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/fd/08/6a5de70f1aadd929bf1a7d8bd9066a6029fdf322dbf59d0784ce7111ee30/sreader-0.0.1.tar.gz",
"platform": null,
"description": "# Space Reader\n\n`space-reader` is a tool that can read a workspace URL and convert the content into LLM-friendly format.\n\n## Installation\n\n```shell\npip install sreader\n```\n\n## Usage\n\n```python\nfrom sreader import read\n\nread(\"<workspace URL>\")\n```\n\n## Support Workspace\n\n- Local File (e.g., `/Users/user/desktop/demo.pdf`)\n- Local Directory (e.g., `/Users/user/desktop/demo`)\n- Remote File with Access (e.g., `https://example.com/demo.pdf`)\n- GitHub Repo with Access (e.g., `https://github.com/user/demo`)\n\n## Support Formats\n\n#### Markdown\n\n```python\nread(\"<workspace URL>\", format=\"markdown\")\n\n\"\"\"\n## /Users/user/desktop/demo\n- ****\n - a.py\n - c.py\n - b.py\n - **d**\n - g.py\n - **f**\n - f.py\n - **e**\n\"\"\"\n```\n\n#### JSON and Dict\n\n```python\nread(\"<workspace URL>\", format=\"json\") # or \"dict\"\n\n\"\"\"\n{\n \"/Users/user/desktop/demo\": {\n \"files\": [\n \"a.py\",\n \"c.py\",\n \"b.py\"\n ],\n \"dirs\": {\n \"d\": {\n \"files\": [\n \"g.py\"\n ],\n \"dirs\": {\n \"f\": {\n \"files\": [\n \"f.py\"\n ],\n \"dirs\": {}\n }\n }\n },\n \"e\": {\n \"files\": [],\n \"dirs\": {}\n }\n }\n }\n}\n\"\"\"\n```\n\n#### Tree\n\n```python\nread(\"<workspace URL>\", format=\"tree\")\n\n\"\"\"\n/Users/user/desktop/demo\n\u2514\u2500\u2500 \n \u251c\u2500\u2500 a.py\n \u251c\u2500\u2500 c.py\n \u251c\u2500\u2500 b.py\n \u251c\u2500\u2500 d\n \u2502 \u251c\u2500\u2500 g.py\n \u2502 \u2514\u2500\u2500 f\n \u2502 \u2514\u2500\u2500 f.py\n \u2514\u2500\u2500 e\n\"\"\"\n```\n\n## Examples\n\n- [Simple print](https://github.com/huangyz0918/space-reader/blob/main/example/simple.py)\n- [File system Q&A Chatbot](https://github.com/huangyz0918/space-reader/blob/main/example/chatbot.py)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "space-reader: Convert any file path into LLM-friendly inputs",
"version": "0.0.1",
"project_urls": {
"Download": "https://github.com/huangyz0918/space-reader/archive/refs/heads/main.zip",
"Homepage": "https://github.com/huangyz0918/space-reader"
},
"split_keywords": [
"llm",
" large language model",
" data processing",
" data science"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d4b0cc76a2c705d0c8bf0e3e272ab357249f8894bc94402bda18d3a7c3b3fcf1",
"md5": "8da612404725fa680c86f5fb96591ff0",
"sha256": "ba827363652eaf77e7b4b5e80af84d0e4107a666e7c9dff730fefc043d23b57e"
},
"downloads": -1,
"filename": "sreader-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8da612404725fa680c86f5fb96591ff0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 6039,
"upload_time": "2024-05-24T18:48:21",
"upload_time_iso_8601": "2024-05-24T18:48:21.080613Z",
"url": "https://files.pythonhosted.org/packages/d4/b0/cc76a2c705d0c8bf0e3e272ab357249f8894bc94402bda18d3a7c3b3fcf1/sreader-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fd086a5de70f1aadd929bf1a7d8bd9066a6029fdf322dbf59d0784ce7111ee30",
"md5": "95ec805f4c0002373054505d76208112",
"sha256": "84592984f251491609b67b84154dea116d6f6efd87273c3038de04a9db213713"
},
"downloads": -1,
"filename": "sreader-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "95ec805f4c0002373054505d76208112",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5518,
"upload_time": "2024-05-24T18:48:22",
"upload_time_iso_8601": "2024-05-24T18:48:22.738942Z",
"url": "https://files.pythonhosted.org/packages/fd/08/6a5de70f1aadd929bf1a7d8bd9066a6029fdf322dbf59d0784ce7111ee30/sreader-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-24 18:48:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "huangyz0918",
"github_project": "space-reader",
"github_not_found": true,
"lcname": "sreader"
}