requests-file


Namerequests-file JSON
Version 2.1.0 PyPI version JSON
download
home_pageNone
SummaryFile transport adapter for Requests
upload_time2024-05-21 16:28:00
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
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": null,
    "name": "requests-file",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "David Shea <reallylongword@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/72/97/bf44e6c6bd8ddbb99943baf7ba8b1a8485bcd2fe0e55e5708d7fee4ff1ae/requests_file-2.1.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.1.0",
    "project_urls": {
        "Homepage": "https://github.com/dashea/requests-file"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d725dd878a121fcfdf38f52850f11c512e13ec87c2ea72385933818e5b6c15ce",
                "md5": "333407b66e06f1c6b662c2651b459efa",
                "sha256": "cf270de5a4c5874e84599fc5778303d496c10ae5e870bfa378818f35d21bda5c"
            },
            "downloads": -1,
            "filename": "requests_file-2.1.0-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "333407b66e06f1c6b662c2651b459efa",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 4244,
            "upload_time": "2024-05-21T16:27:57",
            "upload_time_iso_8601": "2024-05-21T16:27:57.733142Z",
            "url": "https://files.pythonhosted.org/packages/d7/25/dd878a121fcfdf38f52850f11c512e13ec87c2ea72385933818e5b6c15ce/requests_file-2.1.0-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7297bf44e6c6bd8ddbb99943baf7ba8b1a8485bcd2fe0e55e5708d7fee4ff1ae",
                "md5": "7ae75e6288e4721cf544de5b64cff431",
                "sha256": "0f549a3f3b0699415ac04d167e9cb39bccfb730cb832b4d20be3d9867356e658"
            },
            "downloads": -1,
            "filename": "requests_file-2.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "7ae75e6288e4721cf544de5b64cff431",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6891,
            "upload_time": "2024-05-21T16:28:00",
            "upload_time_iso_8601": "2024-05-21T16:28:00.240571Z",
            "url": "https://files.pythonhosted.org/packages/72/97/bf44e6c6bd8ddbb99943baf7ba8b1a8485bcd2fe0e55e5708d7fee4ff1ae/requests_file-2.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-21 16:28:00",
    "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.56615s