--- id: requests-file version: "3.0.1" license: Apache 2.0 license_treatment: permissive maintenance: aging --- # requests-file — File transport adapter for Requests License: permissive · Maintenance: aging · Popularity: top 1,000 on PyPI ## Install pip install requests-file uv add requests-file poetry add requests-file ## Description Requests-File ============= Requests-File is a transport adapter for use with the `Requests`_ Python library to allow local filesystem access via file:\/\/ URLs. To use: .. code-block:: python import requests from requests_file import FileAdapter s = requests.Session() s.mount('file://', FileAdapter()) resp = s.get('file:///path/to/file') Features -------- - Will open and read local files - Might set a Content-Length header - That's about it No encoding information is set in the response object, so be careful using Response.text: the chardet library will be used to convert the file to a unicode type and it may not detect what you actually want. EACCES is converted to a 403 status code, and ENOENT is converted to a 404. All other IOError types are converted to a 400. Contributing ------------ Contributions welcome! Feel free to open a pull request against https://codeberg.org/dashea/requests-file License ------- To maximise compatibility with Requests, this code is licensed under the Apache license. See LICENSE for more details. .. _`Requests`: https://github.com/psf/requests ## AI interpretation — verify before relying Requests-File adds file:// URL support to the Requests HTTP library, allowing you to read local files through the same Session interface you use for HTTP requests. Verdict: Requests-File is a lightweight, permissively licensed adapter for reading local files via Requests' familiar API. Zero known vulnerabilities and low install friction make it safe to adopt, but its Alpha status and 297-day release gap suggest limited active maintenance—suitable for stable use cases where file:// URL support is needed, but not for projects requiring frequent updates. [View on SkillFed](https://skillfed.io/packages/requests-file) · [View on PyPI](https://pypi.org/project/requests-file/)