requests-file


Namerequests-file JSON
Version 2.0.0 PyPI version JSON
download
home_page
SummaryFile transport adapter for Requests
upload_time2024-01-29 19:10:56
maintainer
docs_urlNone
author
requires_python
licenseApache 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            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://github.com/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/kennethreitz/requests

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "requests-file",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "",
    "author_email": "David Shea <reallylongword@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/2b/69/ba1b5f52f96cde4f2d8eca74a0aa2c11a66b2fe58d0fb63b2e46edce6ed3/requests-file-2.0.0.tar.gz",
    "platform": null,
    "description": "Requests-File\n=============\n\nRequests-File is a transport adapter for use with the `Requests`_ Python\nlibrary to allow local filesystem access via file:\\/\\/ URLs.\n\nTo use:\n\n.. code-block:: python\n\n    import requests\n    from requests_file import FileAdapter\n\n    s = requests.Session()\n    s.mount('file://', FileAdapter())\n\n    resp = s.get('file:///path/to/file')\n\nFeatures\n--------\n\n- Will open and read local files\n- Might set a Content-Length header\n- That's about it\n\nNo encoding information is set in the response object, so be careful using\nResponse.text: the chardet library will be used to convert the file to a\nunicode type and it may not detect what you actually want.\n\nEACCES is converted to a 403 status code, and ENOENT is converted to a\n404. All other IOError types are converted to a 400.\n\nContributing\n------------\n\nContributions welcome! Feel free to open a pull request against\nhttps://github.com/dashea/requests-file\n\nLicense\n-------\n\nTo maximise compatibility with Requests, this code is licensed under the Apache\nlicense. See LICENSE for more details.\n\n.. _`Requests`: https://github.com/kennethreitz/requests\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "File transport adapter for Requests",
    "version": "2.0.0",
    "project_urls": {
        "Homepage": "https://github.com/dashea/requests-file"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2b69ba1b5f52f96cde4f2d8eca74a0aa2c11a66b2fe58d0fb63b2e46edce6ed3",
                "md5": "19e2b65d5e44ec331535182864d51fa8",
                "sha256": "20c5931629c558fda566cacc10cfe2cd502433e628f568c34c80d96a0cc95972"
            },
            "downloads": -1,
            "filename": "requests-file-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "19e2b65d5e44ec331535182864d51fa8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6863,
            "upload_time": "2024-01-29T19:10:56",
            "upload_time_iso_8601": "2024-01-29T19:10:56.703816Z",
            "url": "https://files.pythonhosted.org/packages/2b/69/ba1b5f52f96cde4f2d8eca74a0aa2c11a66b2fe58d0fb63b2e46edce6ed3/requests-file-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-29 19:10:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dashea",
    "github_project": "requests-file",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "requests-file"
}
        
Elapsed time: 0.20781s