Requests-Glob is a transport adapter for use with the Requests Python library to allow local filesystem access via glob:// URLs.
To use:
import requests
from requests_glob import GlobAdapter
s = requests.Session()
s.mount('glob://', GlobAdapter())
resp = s.get('glob:///glob_expression')
Features
Will open and read local files
Might set a Content-Length header
That’s about it
Also, url can contain query information, such as glob (yes - default, no), glob_include_hidden (no - default, yes), glob_recursive (yes - default, no)
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://github.com/huakim/python-requests-glob
License
To maximise compatibility with Requests, this code is licensed under the Apache license. See LICENSE for more details.
Metadata
Release files for requests-glob 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| requests_glob-0.3.2.tar.gz | 8.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| requests_glob-0.3.2-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 15.0 kB
Release files / requests_glob-0.3.2.tar.gz
| Download URL | requests_glob-0.3.2.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
033685858f597bc058f72995f353cfef91b48bc640749599af0e6ea1eabf35d4
|
|
BLAKE2b-256 checksum How to use checksums |
70441223c82f82170e52fef5522f2b05566aa0a8dbb0ef2857babd8eaba2169c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / requests_glob-0.3.2-py2.py3-none-any.whl
| Download URL | requests_glob-0.3.2-py2.py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
0e7e44467aec57b806a616d4ab1bca7c6ef7b3097f0a2a2fc4b24025dc7a718a
|
|
BLAKE2b-256 checksum How to use checksums |
6515cb4705fae31df89a5494faad4c73b8fffc2267a2a7e370613bc065570e32
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|