fylepy 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fylepy-0.1.0/.gitignore +222 -0
- fylepy-0.1.0/LICENSE +21 -0
- fylepy-0.1.0/PKG-INFO +272 -0
- fylepy-0.1.0/README.md +198 -0
- fylepy-0.1.0/pyproject.toml +103 -0
- fylepy-0.1.0/src/fyle/__init__.py +46 -0
- fylepy-0.1.0/src/fyle/_core/__init__.py +5 -0
- fylepy-0.1.0/src/fyle/_core/api.py +164 -0
- fylepy-0.1.0/src/fyle/_core/chunking.py +107 -0
- fylepy-0.1.0/src/fyle/_core/document.py +345 -0
- fylepy-0.1.0/src/fyle/_core/fetcher.py +68 -0
- fylepy-0.1.0/src/fyle/_core/registry.py +107 -0
- fylepy-0.1.0/src/fyle/_core/sniffer.py +251 -0
- fylepy-0.1.0/src/fyle/_readers/__init__.py +32 -0
- fylepy-0.1.0/src/fyle/_readers/_md_structure.py +208 -0
- fylepy-0.1.0/src/fyle/_readers/_whisper.py +126 -0
- fylepy-0.1.0/src/fyle/_readers/archive/__init__.py +8 -0
- fylepy-0.1.0/src/fyle/_readers/archive/stdlib.py +513 -0
- fylepy-0.1.0/src/fyle/_readers/audio/__init__.py +9 -0
- fylepy-0.1.0/src/fyle/_readers/audio/faster_whisper.py +162 -0
- fylepy-0.1.0/src/fyle/_readers/base.py +70 -0
- fylepy-0.1.0/src/fyle/_readers/csv/__init__.py +6 -0
- fylepy-0.1.0/src/fyle/_readers/csv/stdlib.py +119 -0
- fylepy-0.1.0/src/fyle/_readers/docx/__init__.py +6 -0
- fylepy-0.1.0/src/fyle/_readers/docx/mammoth.py +130 -0
- fylepy-0.1.0/src/fyle/_readers/html/__init__.py +6 -0
- fylepy-0.1.0/src/fyle/_readers/html/markdownify.py +113 -0
- fylepy-0.1.0/src/fyle/_readers/image/__init__.py +18 -0
- fylepy-0.1.0/src/fyle/_readers/image/stdlib.py +136 -0
- fylepy-0.1.0/src/fyle/_readers/markdown/__init__.py +6 -0
- fylepy-0.1.0/src/fyle/_readers/markdown/stdlib.py +61 -0
- fylepy-0.1.0/src/fyle/_readers/pdf/__init__.py +2 -0
- fylepy-0.1.0/src/fyle/_readers/pdf/pymupdf4llm.py +202 -0
- fylepy-0.1.0/src/fyle/_readers/pptx/__init__.py +7 -0
- fylepy-0.1.0/src/fyle/_readers/pptx/python_pptx.py +306 -0
- fylepy-0.1.0/src/fyle/_readers/sqlite/__init__.py +8 -0
- fylepy-0.1.0/src/fyle/_readers/sqlite/stdlib.py +366 -0
- fylepy-0.1.0/src/fyle/_readers/text/__init__.py +7 -0
- fylepy-0.1.0/src/fyle/_readers/text/stdlib.py +76 -0
- fylepy-0.1.0/src/fyle/_readers/video/__init__.py +10 -0
- fylepy-0.1.0/src/fyle/_readers/video/scenedetect.py +330 -0
- fylepy-0.1.0/src/fyle/_readers/xlsx/__init__.py +6 -0
- fylepy-0.1.0/src/fyle/_readers/xlsx/openpyxl.py +158 -0
- fylepy-0.1.0/src/fyle/errors.py +42 -0
- fylepy-0.1.0/src/fyle/sqlite.py +175 -0
fylepy-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[codz]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
.coverage.*
|
|
45
|
+
.cache
|
|
46
|
+
nosetests.xml
|
|
47
|
+
coverage.xml
|
|
48
|
+
*.cover
|
|
49
|
+
*.py.cover
|
|
50
|
+
.hypothesis/
|
|
51
|
+
.pytest_cache/
|
|
52
|
+
cover/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Scrapy stuff:
|
|
69
|
+
.scrapy
|
|
70
|
+
|
|
71
|
+
# Sphinx documentation
|
|
72
|
+
docs/_build/
|
|
73
|
+
|
|
74
|
+
# PyBuilder
|
|
75
|
+
.pybuilder/
|
|
76
|
+
target/
|
|
77
|
+
|
|
78
|
+
# Jupyter Notebook
|
|
79
|
+
.ipynb_checkpoints
|
|
80
|
+
|
|
81
|
+
# IPython
|
|
82
|
+
profile_default/
|
|
83
|
+
ipython_config.py
|
|
84
|
+
|
|
85
|
+
# pyenv
|
|
86
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
87
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
88
|
+
# .python-version
|
|
89
|
+
|
|
90
|
+
# pipenv
|
|
91
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
92
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
93
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
94
|
+
# install all needed dependencies.
|
|
95
|
+
# Pipfile.lock
|
|
96
|
+
|
|
97
|
+
# UV
|
|
98
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
99
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
100
|
+
# commonly ignored for libraries.
|
|
101
|
+
# uv.lock
|
|
102
|
+
|
|
103
|
+
# poetry
|
|
104
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
105
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
106
|
+
# commonly ignored for libraries.
|
|
107
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
108
|
+
# poetry.lock
|
|
109
|
+
# poetry.toml
|
|
110
|
+
|
|
111
|
+
# pdm
|
|
112
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
113
|
+
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
|
|
114
|
+
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
|
|
115
|
+
# pdm.lock
|
|
116
|
+
# pdm.toml
|
|
117
|
+
.pdm-python
|
|
118
|
+
.pdm-build/
|
|
119
|
+
|
|
120
|
+
# pixi
|
|
121
|
+
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
|
|
122
|
+
# pixi.lock
|
|
123
|
+
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
|
|
124
|
+
# in the .venv directory. It is recommended not to include this directory in version control.
|
|
125
|
+
.pixi
|
|
126
|
+
|
|
127
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
128
|
+
__pypackages__/
|
|
129
|
+
|
|
130
|
+
# Celery stuff
|
|
131
|
+
celerybeat-schedule
|
|
132
|
+
celerybeat.pid
|
|
133
|
+
|
|
134
|
+
# Redis
|
|
135
|
+
*.rdb
|
|
136
|
+
*.aof
|
|
137
|
+
*.pid
|
|
138
|
+
|
|
139
|
+
# RabbitMQ
|
|
140
|
+
mnesia/
|
|
141
|
+
rabbitmq/
|
|
142
|
+
rabbitmq-data/
|
|
143
|
+
|
|
144
|
+
# ActiveMQ
|
|
145
|
+
activemq-data/
|
|
146
|
+
|
|
147
|
+
# SageMath parsed files
|
|
148
|
+
*.sage.py
|
|
149
|
+
|
|
150
|
+
# Environments
|
|
151
|
+
.env
|
|
152
|
+
.envrc
|
|
153
|
+
.venv
|
|
154
|
+
env/
|
|
155
|
+
venv/
|
|
156
|
+
ENV/
|
|
157
|
+
env.bak/
|
|
158
|
+
venv.bak/
|
|
159
|
+
|
|
160
|
+
# Spyder project settings
|
|
161
|
+
.spyderproject
|
|
162
|
+
.spyproject
|
|
163
|
+
|
|
164
|
+
# Rope project settings
|
|
165
|
+
.ropeproject
|
|
166
|
+
|
|
167
|
+
# mkdocs documentation
|
|
168
|
+
/site
|
|
169
|
+
|
|
170
|
+
# mypy
|
|
171
|
+
.mypy_cache/
|
|
172
|
+
.dmypy.json
|
|
173
|
+
dmypy.json
|
|
174
|
+
|
|
175
|
+
# Pyre type checker
|
|
176
|
+
.pyre/
|
|
177
|
+
|
|
178
|
+
# pytype static type analyzer
|
|
179
|
+
.pytype/
|
|
180
|
+
|
|
181
|
+
# Cython debug symbols
|
|
182
|
+
cython_debug/
|
|
183
|
+
|
|
184
|
+
# PyCharm
|
|
185
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
186
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
187
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
188
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
189
|
+
# .idea/
|
|
190
|
+
|
|
191
|
+
# Abstra
|
|
192
|
+
# Abstra is an AI-powered process automation framework.
|
|
193
|
+
# Ignore directories containing user credentials, local state, and settings.
|
|
194
|
+
# Learn more at https://abstra.io/docs
|
|
195
|
+
.abstra/
|
|
196
|
+
|
|
197
|
+
# Visual Studio Code
|
|
198
|
+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
|
|
199
|
+
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
|
|
200
|
+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
|
|
201
|
+
# you could uncomment the following to ignore the entire vscode folder
|
|
202
|
+
# .vscode/
|
|
203
|
+
# Temporary file for partial code execution
|
|
204
|
+
tempCodeRunnerFile.py
|
|
205
|
+
|
|
206
|
+
# Ruff stuff:
|
|
207
|
+
.ruff_cache/
|
|
208
|
+
|
|
209
|
+
# PyPI configuration file
|
|
210
|
+
.pypirc
|
|
211
|
+
|
|
212
|
+
# Marimo
|
|
213
|
+
marimo/_static/
|
|
214
|
+
marimo/_lsp/
|
|
215
|
+
__marimo__/
|
|
216
|
+
|
|
217
|
+
# Streamlit
|
|
218
|
+
.streamlit/secrets.toml
|
|
219
|
+
|
|
220
|
+
design/
|
|
221
|
+
playground/
|
|
222
|
+
.qoder/
|
fylepy-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 zhixiangxue
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
fylepy-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: fylepy
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Open anything, get clean Markdown for LLMs.
|
|
5
|
+
Project-URL: Homepage, https://github.com/zhixiangxue/fyle
|
|
6
|
+
Project-URL: Design, https://github.com/zhixiangxue/fyle/blob/main/design/02-fyle-sdk-design.md
|
|
7
|
+
Author: zhixiangxue
|
|
8
|
+
License: MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2026 zhixiangxue
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Keywords: document,llm,markdown,parsing,pdf
|
|
31
|
+
Classifier: Development Status :: 3 - Alpha
|
|
32
|
+
Classifier: Intended Audience :: Developers
|
|
33
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
34
|
+
Classifier: Programming Language :: Python :: 3
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
38
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
39
|
+
Classifier: Topic :: Text Processing
|
|
40
|
+
Requires-Python: >=3.10
|
|
41
|
+
Requires-Dist: beautifulsoup4>=4.12
|
|
42
|
+
Requires-Dist: httpx>=0.27
|
|
43
|
+
Requires-Dist: lxml>=5
|
|
44
|
+
Requires-Dist: mammoth>=1.8
|
|
45
|
+
Requires-Dist: markdown-it-py>=3
|
|
46
|
+
Requires-Dist: markdownify>=0.11
|
|
47
|
+
Requires-Dist: openpyxl>=3.1
|
|
48
|
+
Requires-Dist: pdfplumber>=0.11
|
|
49
|
+
Requires-Dist: pillow>=10
|
|
50
|
+
Requires-Dist: pydantic>=2
|
|
51
|
+
Requires-Dist: pymupdf4llm>=0.0.17
|
|
52
|
+
Requires-Dist: pymupdf>=1.24
|
|
53
|
+
Requires-Dist: pypdf>=4
|
|
54
|
+
Requires-Dist: python-docx>=1.1
|
|
55
|
+
Requires-Dist: python-magic>=0.4
|
|
56
|
+
Requires-Dist: python-pptx>=0.6
|
|
57
|
+
Requires-Dist: tabulate>=0.9
|
|
58
|
+
Requires-Dist: tiktoken>=0.7
|
|
59
|
+
Provides-Extra: audio
|
|
60
|
+
Requires-Dist: faster-whisper>=1.0; extra == 'audio'
|
|
61
|
+
Provides-Extra: av
|
|
62
|
+
Requires-Dist: av>=12; extra == 'av'
|
|
63
|
+
Requires-Dist: faster-whisper>=1.0; extra == 'av'
|
|
64
|
+
Requires-Dist: scenedetect[pyav]>=0.6; extra == 'av'
|
|
65
|
+
Provides-Extra: dev
|
|
66
|
+
Requires-Dist: pytest-cov>=5; extra == 'dev'
|
|
67
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
68
|
+
Requires-Dist: ruff>=0.5; extra == 'dev'
|
|
69
|
+
Provides-Extra: video
|
|
70
|
+
Requires-Dist: av>=12; extra == 'video'
|
|
71
|
+
Requires-Dist: faster-whisper>=1.0; extra == 'video'
|
|
72
|
+
Requires-Dist: scenedetect[pyav]>=0.6; extra == 'video'
|
|
73
|
+
Description-Content-Type: text/markdown
|
|
74
|
+
|
|
75
|
+
<div align="center">
|
|
76
|
+
|
|
77
|
+
<img src="https://raw.githubusercontent.com/zhixiangxue/fyle/main/docs/assets/logo.png" alt="fyle" width="120">
|
|
78
|
+
|
|
79
|
+
[](https://pypi.org/project/fylepy/)
|
|
80
|
+
[](https://pypi.org/project/fylepy/)
|
|
81
|
+
[](LICENSE)
|
|
82
|
+
[](https://pypi.org/project/fylepy/)
|
|
83
|
+
|
|
84
|
+
**Any file in. Clean Markdown out. LLM ready.**
|
|
85
|
+
|
|
86
|
+
A lightweight library that turns PDF, DOCX, XLSX, audio, video, and ~100 more formats into the Markdown your LLM already understands.
|
|
87
|
+
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## What is this?
|
|
93
|
+
|
|
94
|
+
A lightweight library for reading files. What makes it different: the output is **LLM-ready** — clean Markdown you can feed straight into any model, no post-processing, no cleanup.
|
|
95
|
+
|
|
96
|
+
**One line. Every common file. LLM-ready Markdown.** Point fyle at a path, URL, or raw bytes — what comes back is already something a model can read natively. No OCR plumbing, no format-specific parser glue, no prompt engineering to "please strip the headers and footers".
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
import fyle
|
|
100
|
+
|
|
101
|
+
text = fyle.read("report.pdf") # or .docx / .xlsx / .mp3 / .mp4 / an http(s) URL / raw bytes
|
|
102
|
+
llm.complete(text) # that's it.
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Works out of the box on:
|
|
106
|
+
|
|
107
|
+
- **PDF / DOCX / XLSX / PPTX / HTML / Markdown / CSV** — parsed into Markdown
|
|
108
|
+
- **Images** — base64 `data:image/...` URLs ready for multimodal models
|
|
109
|
+
- **Audio / video** — local ASR transcripts with `[MM:SS]` timestamps (+ keyframes for video)
|
|
110
|
+
- **SQLite** — schema preview + fluent `doc.table(t).query(sql)` API
|
|
111
|
+
- **Archive** — safe extraction + Markdown manifest, agent decides what to open next
|
|
112
|
+
- **~100 source / config / log formats** — passthrough as plain text
|
|
113
|
+
|
|
114
|
+
> 100% local. No cloud APIs. No telemetry. No API keys.
|
|
115
|
+
> Just `fyle.open(...)` and the file becomes something an LLM can see.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Install
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
pip install fylepy
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
Audio / video transcription are opt-in extras (native wheels + a ~140 MB model on first run):
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
pip install 'fylepy[audio]' # faster-whisper
|
|
129
|
+
pip install 'fylepy[video]' # faster-whisper + PySceneDetect + PyAV
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Quick start
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
import fyle
|
|
138
|
+
|
|
139
|
+
doc = fyle.open("report.pdf")
|
|
140
|
+
# or: fyle.open("https://example.com/report.pdf")
|
|
141
|
+
# or: fyle.open(raw_bytes) # format auto-detected from magic bytes
|
|
142
|
+
|
|
143
|
+
# Three views of the same document:
|
|
144
|
+
print(doc.text) # pure content — whatever the reader produced
|
|
145
|
+
print(str(doc)) # LLM-ready: filename + format + size header, then content
|
|
146
|
+
print(repr(doc)) # short debug line for logs
|
|
147
|
+
|
|
148
|
+
# Typical usage — hand the whole thing to your model in one line:
|
|
149
|
+
llm.complete(str(doc)) # filename carries real signal the model can use
|
|
150
|
+
|
|
151
|
+
print(doc.meta.format) # "pdf"
|
|
152
|
+
print(doc.meta.ext) # "pdf"
|
|
153
|
+
print(doc.pages[0].text) # just page 1
|
|
154
|
+
|
|
155
|
+
# One-shot convenience: str in, LLM-ready string out (same as str(fyle.open(...)))
|
|
156
|
+
text = fyle.read("report.pdf")
|
|
157
|
+
|
|
158
|
+
# Check which readers are available in your install
|
|
159
|
+
fyle.readers()
|
|
160
|
+
# {"pdf": ["pymupdf4llm*"], "audio": ["faster-whisper*"], ...}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## Supported formats
|
|
166
|
+
|
|
167
|
+
| Family | Extensions | Reader |
|
|
168
|
+
|---|---|---|
|
|
169
|
+
| PDF | `.pdf` | pymupdf4llm |
|
|
170
|
+
| Word | `.docx` | mammoth |
|
|
171
|
+
| Excel | `.xlsx` | openpyxl + tabulate |
|
|
172
|
+
| PowerPoint | `.pptx` | python-pptx |
|
|
173
|
+
| Web | `.html` `.htm` | markdownify |
|
|
174
|
+
| Markdown | `.md` `.markdown` | markdown-it-py |
|
|
175
|
+
| CSV | `.csv` | stdlib + tabulate |
|
|
176
|
+
| Image | `.png` `.jpg` `.jpeg` `.webp` | Pillow → base64 data URL |
|
|
177
|
+
| Audio | `.mp3` `.m4a` `.wav` `.flac` `.ogg` | faster-whisper (CPU, int8) |
|
|
178
|
+
| Video | `.mp4` `.m4v` `.mov` `.avi` `.mkv` `.webm` | PySceneDetect + Whisper |
|
|
179
|
+
| Database | `.db` `.sqlite` `.sqlite3` | stdlib + fluent SQL API |
|
|
180
|
+
| Archive | `.zip` `.tar` `.gz` `.bz2` `.xz` ... | stdlib — extract to disk + manifest |
|
|
181
|
+
| Text | `.py` `.js` `.go` `.rs` `.java` `.json` `.yaml` `.toml` `.sql` `.log` ... (~100) | passthrough |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Audio & video
|
|
186
|
+
|
|
187
|
+
```python
|
|
188
|
+
doc = fyle.open("meeting.mp4")
|
|
189
|
+
|
|
190
|
+
print(doc.text)
|
|
191
|
+
# # Video: meeting.mp4
|
|
192
|
+
#
|
|
193
|
+
# - Duration: `12:34`
|
|
194
|
+
# - Keyframes: 8
|
|
195
|
+
# - Language: `en`
|
|
196
|
+
#
|
|
197
|
+
# ## Transcript
|
|
198
|
+
#
|
|
199
|
+
# [00:00] Welcome everyone to the quarterly review...
|
|
200
|
+
|
|
201
|
+
for img in doc.images:
|
|
202
|
+
print(img.caption, img.src[:32])
|
|
203
|
+
# "02:17" "data:image/jpeg;base64,/9j/4AA..."
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
First call downloads the Whisper `base` model (~140 MB). CPU only — no GPU needed.
|
|
207
|
+
Override with `FYLE_WHISPER_MODEL=small` (or `medium` / `large-v3`) for higher quality.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## SQLite
|
|
212
|
+
|
|
213
|
+
```python
|
|
214
|
+
doc = fyle.open("chinook.db")
|
|
215
|
+
|
|
216
|
+
for page in doc.pages:
|
|
217
|
+
print(page.name) # table or view name
|
|
218
|
+
print(page.text) # schema + sample rows
|
|
219
|
+
|
|
220
|
+
rows = doc.table("Customer").query(
|
|
221
|
+
"SELECT Country, COUNT(*) AS n FROM Customer GROUP BY Country ORDER BY n DESC"
|
|
222
|
+
)
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## Archive
|
|
228
|
+
|
|
229
|
+
```python
|
|
230
|
+
doc = fyle.open("~/Downloads/invoices.zip")
|
|
231
|
+
|
|
232
|
+
print(doc.text) # Markdown listing of extracted files
|
|
233
|
+
print(doc.meta.warnings) # ["extracted to: /.../invoices/"]
|
|
234
|
+
|
|
235
|
+
# Agent's next step: fyle.open(one of the extracted files)
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Refuses `..` path traversal and symlink escapes; extracts to the archive's sibling directory.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Chunking for RAG
|
|
243
|
+
|
|
244
|
+
```python
|
|
245
|
+
for chunk in doc.chunks(max_tokens=4000, overlap=200):
|
|
246
|
+
embed(chunk.text)
|
|
247
|
+
# chunk.tokens / chunk.page_range also available
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Notes
|
|
253
|
+
|
|
254
|
+
1. **Offline only.** Every reader runs locally. The audio/video reader downloads the Whisper model from Hugging Face on first run; after that, no network.
|
|
255
|
+
2. **Archive reader is list-only.** It extracts files to disk and returns a manifest — it does not recursively parse contents. The agent decides what to open next.
|
|
256
|
+
3. **Alpha.** Core is stable, but APIs may move between `0.x` releases.
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## Feedback
|
|
261
|
+
|
|
262
|
+
Issues, PRs, and stars are welcome.
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
## License
|
|
267
|
+
|
|
268
|
+
MIT © 2026 zhixiangxue
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
<div align="right"><img src="https://raw.githubusercontent.com/zhixiangxue/fyle/main/docs/assets/logo.png" alt="fyle" width="120"></div>
|
fylepy-0.1.0/README.md
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img src="https://raw.githubusercontent.com/zhixiangxue/fyle/main/docs/assets/logo.png" alt="fyle" width="120">
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/fylepy/)
|
|
6
|
+
[](https://pypi.org/project/fylepy/)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](https://pypi.org/project/fylepy/)
|
|
9
|
+
|
|
10
|
+
**Any file in. Clean Markdown out. LLM ready.**
|
|
11
|
+
|
|
12
|
+
A lightweight library that turns PDF, DOCX, XLSX, audio, video, and ~100 more formats into the Markdown your LLM already understands.
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## What is this?
|
|
19
|
+
|
|
20
|
+
A lightweight library for reading files. What makes it different: the output is **LLM-ready** — clean Markdown you can feed straight into any model, no post-processing, no cleanup.
|
|
21
|
+
|
|
22
|
+
**One line. Every common file. LLM-ready Markdown.** Point fyle at a path, URL, or raw bytes — what comes back is already something a model can read natively. No OCR plumbing, no format-specific parser glue, no prompt engineering to "please strip the headers and footers".
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
import fyle
|
|
26
|
+
|
|
27
|
+
text = fyle.read("report.pdf") # or .docx / .xlsx / .mp3 / .mp4 / an http(s) URL / raw bytes
|
|
28
|
+
llm.complete(text) # that's it.
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Works out of the box on:
|
|
32
|
+
|
|
33
|
+
- **PDF / DOCX / XLSX / PPTX / HTML / Markdown / CSV** — parsed into Markdown
|
|
34
|
+
- **Images** — base64 `data:image/...` URLs ready for multimodal models
|
|
35
|
+
- **Audio / video** — local ASR transcripts with `[MM:SS]` timestamps (+ keyframes for video)
|
|
36
|
+
- **SQLite** — schema preview + fluent `doc.table(t).query(sql)` API
|
|
37
|
+
- **Archive** — safe extraction + Markdown manifest, agent decides what to open next
|
|
38
|
+
- **~100 source / config / log formats** — passthrough as plain text
|
|
39
|
+
|
|
40
|
+
> 100% local. No cloud APIs. No telemetry. No API keys.
|
|
41
|
+
> Just `fyle.open(...)` and the file becomes something an LLM can see.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Install
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install fylepy
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Audio / video transcription are opt-in extras (native wheels + a ~140 MB model on first run):
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install 'fylepy[audio]' # faster-whisper
|
|
55
|
+
pip install 'fylepy[video]' # faster-whisper + PySceneDetect + PyAV
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Quick start
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
import fyle
|
|
64
|
+
|
|
65
|
+
doc = fyle.open("report.pdf")
|
|
66
|
+
# or: fyle.open("https://example.com/report.pdf")
|
|
67
|
+
# or: fyle.open(raw_bytes) # format auto-detected from magic bytes
|
|
68
|
+
|
|
69
|
+
# Three views of the same document:
|
|
70
|
+
print(doc.text) # pure content — whatever the reader produced
|
|
71
|
+
print(str(doc)) # LLM-ready: filename + format + size header, then content
|
|
72
|
+
print(repr(doc)) # short debug line for logs
|
|
73
|
+
|
|
74
|
+
# Typical usage — hand the whole thing to your model in one line:
|
|
75
|
+
llm.complete(str(doc)) # filename carries real signal the model can use
|
|
76
|
+
|
|
77
|
+
print(doc.meta.format) # "pdf"
|
|
78
|
+
print(doc.meta.ext) # "pdf"
|
|
79
|
+
print(doc.pages[0].text) # just page 1
|
|
80
|
+
|
|
81
|
+
# One-shot convenience: str in, LLM-ready string out (same as str(fyle.open(...)))
|
|
82
|
+
text = fyle.read("report.pdf")
|
|
83
|
+
|
|
84
|
+
# Check which readers are available in your install
|
|
85
|
+
fyle.readers()
|
|
86
|
+
# {"pdf": ["pymupdf4llm*"], "audio": ["faster-whisper*"], ...}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Supported formats
|
|
92
|
+
|
|
93
|
+
| Family | Extensions | Reader |
|
|
94
|
+
|---|---|---|
|
|
95
|
+
| PDF | `.pdf` | pymupdf4llm |
|
|
96
|
+
| Word | `.docx` | mammoth |
|
|
97
|
+
| Excel | `.xlsx` | openpyxl + tabulate |
|
|
98
|
+
| PowerPoint | `.pptx` | python-pptx |
|
|
99
|
+
| Web | `.html` `.htm` | markdownify |
|
|
100
|
+
| Markdown | `.md` `.markdown` | markdown-it-py |
|
|
101
|
+
| CSV | `.csv` | stdlib + tabulate |
|
|
102
|
+
| Image | `.png` `.jpg` `.jpeg` `.webp` | Pillow → base64 data URL |
|
|
103
|
+
| Audio | `.mp3` `.m4a` `.wav` `.flac` `.ogg` | faster-whisper (CPU, int8) |
|
|
104
|
+
| Video | `.mp4` `.m4v` `.mov` `.avi` `.mkv` `.webm` | PySceneDetect + Whisper |
|
|
105
|
+
| Database | `.db` `.sqlite` `.sqlite3` | stdlib + fluent SQL API |
|
|
106
|
+
| Archive | `.zip` `.tar` `.gz` `.bz2` `.xz` ... | stdlib — extract to disk + manifest |
|
|
107
|
+
| Text | `.py` `.js` `.go` `.rs` `.java` `.json` `.yaml` `.toml` `.sql` `.log` ... (~100) | passthrough |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Audio & video
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
doc = fyle.open("meeting.mp4")
|
|
115
|
+
|
|
116
|
+
print(doc.text)
|
|
117
|
+
# # Video: meeting.mp4
|
|
118
|
+
#
|
|
119
|
+
# - Duration: `12:34`
|
|
120
|
+
# - Keyframes: 8
|
|
121
|
+
# - Language: `en`
|
|
122
|
+
#
|
|
123
|
+
# ## Transcript
|
|
124
|
+
#
|
|
125
|
+
# [00:00] Welcome everyone to the quarterly review...
|
|
126
|
+
|
|
127
|
+
for img in doc.images:
|
|
128
|
+
print(img.caption, img.src[:32])
|
|
129
|
+
# "02:17" "data:image/jpeg;base64,/9j/4AA..."
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
First call downloads the Whisper `base` model (~140 MB). CPU only — no GPU needed.
|
|
133
|
+
Override with `FYLE_WHISPER_MODEL=small` (or `medium` / `large-v3`) for higher quality.
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## SQLite
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
doc = fyle.open("chinook.db")
|
|
141
|
+
|
|
142
|
+
for page in doc.pages:
|
|
143
|
+
print(page.name) # table or view name
|
|
144
|
+
print(page.text) # schema + sample rows
|
|
145
|
+
|
|
146
|
+
rows = doc.table("Customer").query(
|
|
147
|
+
"SELECT Country, COUNT(*) AS n FROM Customer GROUP BY Country ORDER BY n DESC"
|
|
148
|
+
)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Archive
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
doc = fyle.open("~/Downloads/invoices.zip")
|
|
157
|
+
|
|
158
|
+
print(doc.text) # Markdown listing of extracted files
|
|
159
|
+
print(doc.meta.warnings) # ["extracted to: /.../invoices/"]
|
|
160
|
+
|
|
161
|
+
# Agent's next step: fyle.open(one of the extracted files)
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Refuses `..` path traversal and symlink escapes; extracts to the archive's sibling directory.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Chunking for RAG
|
|
169
|
+
|
|
170
|
+
```python
|
|
171
|
+
for chunk in doc.chunks(max_tokens=4000, overlap=200):
|
|
172
|
+
embed(chunk.text)
|
|
173
|
+
# chunk.tokens / chunk.page_range also available
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Notes
|
|
179
|
+
|
|
180
|
+
1. **Offline only.** Every reader runs locally. The audio/video reader downloads the Whisper model from Hugging Face on first run; after that, no network.
|
|
181
|
+
2. **Archive reader is list-only.** It extracts files to disk and returns a manifest — it does not recursively parse contents. The agent decides what to open next.
|
|
182
|
+
3. **Alpha.** Core is stable, but APIs may move between `0.x` releases.
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## Feedback
|
|
187
|
+
|
|
188
|
+
Issues, PRs, and stars are welcome.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## License
|
|
193
|
+
|
|
194
|
+
MIT © 2026 zhixiangxue
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
<div align="right"><img src="https://raw.githubusercontent.com/zhixiangxue/fyle/main/docs/assets/logo.png" alt="fyle" width="120"></div>
|