{ "info": { "author": "", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. -*- mode: rst -*-\n\npyfortified-requests\n--------------------\n\nExtension of Python HTTP `requests `_ with verbose\nlogging using `pyfortified-logging `_, and robust handling for\nDownloading files containing JSON, CSV, and XML data formats and Streaming.\n\nImportant Note\n^^^^^^^^^^^^^^\n\nThis Python project is a refactoring of `requests-mv-integration `_\nfor the purpose of general usage intent.\n\nWork In Progress\n^^^^^^^^^^^^^^^^\n\nThe following still needs to be performed for this Python project:\n\n- Unit-testing: This project will be switching over to using Python native Unit testing framework `unittest `_.\n- More concise documentation is required.\n- Travis CI\n- Badges\n\n\nBadges\n------\n\n\nInstall\n-------\n\n.. code-block:: bash\n\n pip install pyfortified_requests\n\n\nArchitecture\n------------\n\n``pyfortified-requests`` is an extension of the `Python package requests `_\nand it is used for handling all HTTP requests including APIs in REST and SOAP,\nscreen scrapping, and handling response downloads in JSON, XML, and CSV.\n\nUsage\n-----\n\n.. code-block:: python\n\n URL_REST_COUNTRIES = \\\n 'http://api.population.io/1.0/countries'\n\n from pyfortified_requests import (\n RequestsFortifiedDownload,\n )\n request_download = RequestsFortifiedDownload(logger_level=logging.DEBUG)\n\n result = \\\n request_download.request(\n request_method='GET',\n request_url=URL_REST_COUNTRIES,\n request_params=None,\n request_retry=None,\n request_headers=HEADER_CONTENT_TYPE_APP_JSON,\n request_label=\"REST Countries\"\n )\n\n json_rest_countries = result.json()\n\n pprint(json_rest_countries)\n\n\nExample\n^^^^^^^\n\n.. code-block:: bash\n\n $ make run-example-countries\n\n ======================================================\n run-examples pyfortified-requests\n ======================================================\n rm -fR _tmp/*.json\n ======================================================\n 'Logger file path: ./tmp/log_1526043820.json'\n [\n '{\"asctime\": \"2018-05-14 10:40:54 -0700\", \"levelname\": \"NOTE\", \"name\": \"pyfortified_requests\", \"version\": \"0.3.3\", \"message\": \"debug\"}\\n',\n '{\"asctime\": \"2018-05-14 10:40:55 -0700\", \"levelname\": \"INFO\", \"name\": \"pyfortified_requests\", \"version\": \"0.3.3\", \"message\": \"START\"}\\n',\n '{\"asctime\": \"2018-05-14 10:40:55 -0700\", \"levelname\": \"DEBUG\", \"name\": \"pyfortified_requests\", \"version\": \"0.3.3\", \"message\": \"REST Countries: Start\"}\\n',\n '{\"asctime\": \"2018-05-14 10:40:55 -0700\", \"levelname\": \"DEBUG\", \"name\": \"pyfortified_requests\", \"version\": \"0.3.3\", \"message\": \"REST Countries: Start: Details\", \"Disk:\": {\"free\": \"91.54 GB\", \"percent\": 60, \"total\": \"232.62 GB\", \"path\": \"/\", \"used\": \"140.84 GB\"}, \"Mem\": {\"free\": \"133.81 KB\", \"cached\": \"0 B\", \"total\": \"16.00 GB\", \"used\": \"13.19 GB\", \"shared\": \"0 B\", \"buffers\": \"0 B\"}, \"allow_redirects\": true, \"build_request_curl\": true, \"cookie_payload\": null, \"request_auth\": null, \"request_cert\": null, \"request_data\": null, \"request_headers\": {\"Content-Type\": \"application/json\", \"User-Agent\": \"(pyfortified-requests/0.3.3, Python/3.5.4)\"}, \"request_json\": null, \"request_label\": \"REST Countries\", \"request_method\": \"GET\", \"request_params\": null, \"request_retry\": {\"tries\": 3, \"delay\": 10, \"timeout\": 60}, \"request_url\": \"http://api.population.io/1.0/countries\", \"stream\": false, \"timeout\": null, \"verify\": true}\\n',\n '{\"asctime\": \"2018-05-14 10:40:55 -0700\", \"levelname\": \"DEBUG\", \"name\": \"pyfortified_requests\", \"version\": \"0.3.3\", \"message\": \"REST Countries: Start\", \"request_label\": \"REST Countries\", \"request_retry_excps\": [\"ConnectTimeout\", \"ReadTimeout\", \"Timeout\"], \"request_retry_http_status_codes\": [500, 502, 503, 504, 429], \"timeout\": null}\\n',\n '{\"asctime\": \"2018-05-14 10:40:55 -0700\", \"levelname\": \"DEBUG\", \"name\": \"pyfortified_requests\", \"version\": \"0.3.3\", \"message\": \"REST Countries: Attempt\", \"attempts\": 1, \"delay\": 10, \"request_label\": \"REST Countries\", \"request_url\": \"http://api.population.io/1.0/countries\", \"timeout\": 60, \"tries\": 3}\\n',\n '{\"asctime\": \"2018-05-14 10:40:55 -0700\", \"levelname\": \"DEBUG\", \"name\": \"pyfortified_requests\", \"version\": \"0.3.3\", \"message\": \"REST Countries: Session: Details\", \"cookie_payload\": {}, \"request_label\": \"REST Countries\"}\\n',\n '{\"asctime\": \"2018-05-14 10:40:55 -0700\", \"levelname\": \"DEBUG\", \"name\": \"pyfortified_requests\", \"version\": \"0.3.3\", \"message\": \"REST Countries: Details\", \"request_data\": \"\", \"request_headers\": {\"Content-Type\": \"application/json\", \"User-Agent\": \"(pyfortified-requests/0.3.3, Python/3.5.4)\"}, \"request_label\": \"REST Countries\", \"request_method\": \"GET\", \"request_params\": {}, \"request_url\": \"http://api.population.io/1.0/countries\", \"timeout\": 60}\\n',\n '{\"asctime\": \"2018-05-14 10:40:55 -0700\", \"levelname\": \"NOTE\", \"name\": \"pyfortified_requests\", \"version\": \"0.3.3\", \"message\": \"REST Countries: Curl\", \"request_curl\": \"curl --verbose -X GET -H \\'Content-Type: application/json\\' -H \\'User-Agent: (pyfortified-requests/0.3.3, Python/3.5.4)\\' --connect-timeout 60 -L \\'http://api.population.io/1.0/countries\\'\", \"request_label\": \"REST Countries\", \"request_method\": \"GET\"}\\n',\n '{\"asctime\": \"2018-05-14 10:40:55 -0700\", \"levelname\": \"DEBUG\", \"name\": \"pyfortified_requests.support.requests_session_client\", \"version\": \"0.3.3\", \"message\": \"Session Request: Details\", \"allow_redirects\": true, \"headers\": {\"Content-Type\": \"application/json\", \"User-Agent\": \"(pyfortified-requests/0.3.3, Python/3.5.4)\"}, \"method\": \"GET\", \"timeout\": 60, \"url\": \"http://api.population.io/1.0/countries\", \"verify\": true}\\n',\n '{\"asctime\": \"2018-05-14 10:40:55 -0700\", \"levelname\": \"DEBUG\", \"name\": \"pyfortified_requests\", \"version\": \"0.3.3\", \"message\": \"REST Countries: Response: Details\", \"http_status_code\": 200, \"http_status_desc\": \"Request fulfilled, document follows\", \"http_status_type\": \"Successful\", \"response_headers\": {\"Vary\": \"Accept\", \"Allow\": \"OPTIONS, GET\", \"Cache-Control\": \"max-age=3600\", \"Via\": \"1.1 7bfcc2251021d9dc94a87ff179d69731.cloudfront.net (CloudFront)\", \"Expires\": \"Mon, 14 May 2018 18:23:07 GMT\", \"Connection\": \"keep-alive\", \"X-Amz-Cf-Id\": \"_Q_sioBJ9zkP0pFZztqnQJHLBXl5DWoAnGnb2HBGxJHDEmPX4jH82g==\", \"Date\": \"Mon, 14 May 2018 17:23:07 GMT\", \"Content-Type\": \"application/json\", \"Server\": \"nginx/1.10.2\", \"Content-Length\": \"1572\", \"X-Cache\": \"Hit from cloudfront\", \"Age\": \"1039\", \"Content-Encoding\": \"gzip\"}}\\n',\n '{\"asctime\": \"2018-05-14 10:40:55 -0700\", \"levelname\": \"DEBUG\", \"name\": \"pyfortified_requests\", \"version\": \"0.3.3\", \"message\": \"REST Countries: Cookie Payload\", \"cookie_payload\": {}, \"request_label\": \"REST Countries\"}\\n',\n '{\"asctime\": \"2018-05-14 10:40:55 -0700\", \"levelname\": \"DEBUG\", \"name\": \"pyfortified_requests\", \"version\": \"0.3.3\", \"message\": \"REST Countries: Try Send Request: Is Return Response: Checking\", \"request_url\": \"http://api.population.io/1.0/countries\"}\\n',\n '{\"asctime\": \"2018-05-14 10:40:55 -0700\", \"levelname\": \"DEBUG\", \"name\": \"pyfortified_requests\", \"version\": \"0.3.3\", \"message\": \"REST Countries: Try Send Request: Is Return Response: Valid\", \"request_url\": \"http://api.population.io/1.0/countries\"}\\n',\n '{\"asctime\": \"2018-05-14 10:40:55 -0700\", \"levelname\": \"INFO\", \"name\": \"pyfortified_requests\", \"version\": \"0.3.3\", \"message\": \"REST Countries: Finished\", \"request_time_msecs\": 96}\\n',\n '{\"asctime\": \"2018-05-14 10:40:55 -0700\", \"levelname\": \"DEBUG\", \"name\": \"pyfortified_requests\", \"version\": \"0.3.3\", \"message\": \"REST Countries: Usage\", \"Disk:\": {\"free\": \"91.54 GB\", \"percent\": 60, \"total\": \"232.62 GB\", \"path\": \"/\", \"used\": \"140.84 GB\"}, \"Mem\": {\"free\": \"133.17 KB\", \"cached\": \"0 B\", \"total\": \"16.00 GB\", \"used\": \"13.19 GB\", \"shared\": \"0 B\", \"buffers\": \"0 B\"}}\\n',\n '{\"asctime\": \"2018-05-14 10:40:55 -0700\", \"levelname\": \"INFO\", \"name\": \"pyfortified_requests\", \"version\": \"0.3.3\", \"message\": \"COMPLETED\", \"connection\": \"\", \"cookies\": \"\", \"elapsed\": \"0:00:00.079948\", \"encoding\": null, \"headers\": \"{\\'Allow\\': \\'OPTIONS, GET\\', \\'Cache-Control\\': \\'max-age=3600\\', \\'Content-Length\\': \\'1572\\', \\'Vary\\': \\'Accept\\', \\'Age\\': \\'1039\\', \\'Connection\\': \\'keep-alive\\', \\'X-Cache\\': \\'Hit from cloudfront\\', \\'Content-Type\\': \\'application/json\\', \\'Server\\': \\'nginx/1.10.2\\', \\'Via\\': \\'1.1 7bfcc2251021d9dc94a87ff179d69731.cloudfront.net (CloudFront)\\', \\'Expires\\': \\'Mon, 14 May 2018 18:23:07 GMT\\', \\'Date\\': \\'Mon, 14 May 2018 17:23:07 GMT\\', \\'X-Amz-Cf-Id\\': \\'_Q_sioBJ9zkP0pFZztqnQJHLBXl5DWoAnGnb2HBGxJHDEmPX4jH82g==\\', \\'Content-Encoding\\': \\'gzip\\'}\", \"history\": [], \"raw\": \"\", \"reason\": \"OK\", \"request\": \"\", \"status_code\": 200, \"url\": \"http://api.population.io/1.0/countries\"}\\n',\n ]\n 'DEBUG'\n {\n 'countries': [\n 'Afghanistan',\n 'AFRICA',\n 'Albania',\n 'Algeria',\n 'Angola',\n 'Antigua and Barbuda',\n 'Arab Rep of Egypt',\n 'Argentina',\n 'Armenia',\n 'Aruba',\n 'ASIA',\n 'Australia',\n 'Australia/New Zealand',\n 'Austria',\n 'Azerbaijan',\n 'The Bahamas',\n ***\n 'Uganda',\n 'Ukraine',\n 'United Arab Emirates',\n 'United Kingdom',\n 'United States',\n 'US Virgin Islands',\n 'Uruguay',\n 'Uzbekistan',\n 'Vanuatu',\n 'Vietnam',\n 'Western Africa',\n 'Western Asia',\n 'Western Europe',\n 'Western Sahara',\n 'World',\n 'Zambia',\n 'Zimbabwe',\n ],\n }\n\nClasses\n-------\n\n- ``class RequestsFortified`` -- Base class using `requests `_ with retry functionality and verbose logging.\n- ``class RequestsFortifiedDownload`` -- Download file handling.\n- ``class RequestsFortifiedUpload`` -- Upload file handling.\n\nRequirements\n------------\n\n``pyfortified-requests`` module is built upon Python 3 and has dependencies upon\nseveral Python modules available within `Python Package Index PyPI `_.\n\n.. code-block:: bash\n\n make install\n\nor\n\n.. code-block:: bash\n\n python3 -m pip uninstall --yes --no-input -r requirements.txt\n python3 -m pip install --upgrade -r requirements.txt\n\n\nPackages\n^^^^^^^^\n\n- **beautifulsoup4**: https://pypi.python.org/pypi/beautifulsoup4\n- **deepdiff**: https://pypi.python.org/pypi/deepdiff\n- **pyfortified-logging**: https://pypi.org/project/pyfortified-logging\n- **pyhttpstatus-utils**: https://pypi.python.org/pypi/pyhttpstatus-utils\n- **requests**: https://pypi.python.org/pypi/requests\n- **safe-cast**: https://pypi.python.org/pypi/safe-cast\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/jeff00seattle/pyfortified-requests/archive/v0.3.6.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/jeff00seattle/pyfortified-requests", "keywords": "pyfortified requests", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "pyfortified-requests", "package_url": "https://pypi.org/project/pyfortified-requests/", "platform": "", "project_url": "https://pypi.org/project/pyfortified-requests/", "project_urls": { "Download": "https://github.com/jeff00seattle/pyfortified-requests/archive/v0.3.6.tar.gz", "Homepage": "https://github.com/jeff00seattle/pyfortified-requests" }, "release_url": "https://pypi.org/project/pyfortified-requests/0.3.6/", "requires_dist": null, "requires_python": "", "summary": "Extension to Python `requests` functionality.", "version": "0.3.6" }, "last_serial": 3861904, "releases": { "0.3.2": [ { "comment_text": "", "digests": { "md5": "b4c72af807eaacea01a5071876127e7d", "sha256": "33bfc6faf817037d508b5168b6706f23422fca8487d618fcdf3d8b925d4125a4" }, "downloads": -1, "filename": "pyfortified_requests-0.3.2-py3-none-any.whl", "has_sig": false, "md5_digest": "b4c72af807eaacea01a5071876127e7d", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 39301, "upload_time": "2018-05-14T17:28:58", "url": "https://files.pythonhosted.org/packages/32/c2/477ec90b71a741bbccbfdb832b9ea31963aba3892caf0e97a6e9373d74d4/pyfortified_requests-0.3.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a3aeb592d8dc36fb074915577a36b7ee", "sha256": "faf8101da45816385365987745875b5f2c60ff5e3485ace32243f55852494125" }, "downloads": -1, "filename": "pyfortified-requests-0.3.2.tar.gz", "has_sig": false, "md5_digest": "a3aeb592d8dc36fb074915577a36b7ee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 35120, "upload_time": "2018-05-14T17:28:56", "url": "https://files.pythonhosted.org/packages/af/39/74ca32983cd406ff0ec8371d7b1b92aa8baaaa01d0f3fb80cd856806e56c/pyfortified-requests-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "f8bc49cf4c58fde4b626c156db070bf4", "sha256": "28429d56d5d471f3608f8b277364906cd1e0449087f2a660feb0a504294f2ccd" }, "downloads": -1, "filename": "pyfortified_requests-0.3.3-py3-none-any.whl", "has_sig": false, "md5_digest": "f8bc49cf4c58fde4b626c156db070bf4", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 38849, "upload_time": "2018-05-14T17:43:27", "url": "https://files.pythonhosted.org/packages/2c/d1/8882d82309e61be80782daa7aff0ed4b17dc2c29593160199f96ef384d56/pyfortified_requests-0.3.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ce2443464a7518425276ae5be25a9eac", "sha256": "4dd1268141bd81a7518282bf8edbe56289984504f2a891428f467d128b99054c" }, "downloads": -1, "filename": "pyfortified-requests-0.3.3.tar.gz", "has_sig": false, "md5_digest": "ce2443464a7518425276ae5be25a9eac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34067, "upload_time": "2018-05-14T17:43:26", "url": "https://files.pythonhosted.org/packages/a7/a5/7f6841f4d91757636783ad96dc33585b6c8cd6448a9e6beceff0b7b096aa/pyfortified-requests-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "74c0c08293d9c0e277ce19b9cb5036d8", "sha256": "b0a41dfc5046717ca4886f46f74870191ff5f1acceed8cfefe8db64feef82d0d" }, "downloads": -1, "filename": "pyfortified_requests-0.3.4-py3-none-any.whl", "has_sig": false, "md5_digest": "74c0c08293d9c0e277ce19b9cb5036d8", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 38640, "upload_time": "2018-05-14T17:45:46", "url": "https://files.pythonhosted.org/packages/69/be/c1b6ed0e2ae1bbabf9081e8e50d85568fe4c9f5e547795e05548282c6543/pyfortified_requests-0.3.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6b9c7d435a6065513944c2efc83e19fb", "sha256": "55ccd7b49e8402c806acb241978f3b8b02a2bb01b78d8a677c5332f65a3d0891" }, "downloads": -1, "filename": "pyfortified-requests-0.3.4.tar.gz", "has_sig": false, "md5_digest": "6b9c7d435a6065513944c2efc83e19fb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33584, "upload_time": "2018-05-14T17:45:44", "url": "https://files.pythonhosted.org/packages/85/b2/d400cb29f7e33773aba18931cac470dfd8c347a971d66baa774ddc7e0146/pyfortified-requests-0.3.4.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "9837f676997c8f00a6f7c11a66af6cfe", "sha256": "81123c5da963a3948d4fb2b6c3dd431142573454374c5cde1795ac2fff8b6e65" }, "downloads": -1, "filename": "pyfortified_requests-0.3.5-py3-none-any.whl", "has_sig": false, "md5_digest": "9837f676997c8f00a6f7c11a66af6cfe", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 38632, "upload_time": "2018-05-14T17:49:39", "url": "https://files.pythonhosted.org/packages/2f/30/cd45c9c45ddba55a51f2c56f0011385638f3df0794f51e431cde8a513066/pyfortified_requests-0.3.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "78575ed98bc85a6f1870b78b56ee4ccf", "sha256": "87f54aa80ffb9c255dbd3633c9d3c120d82b2e93e6998992282ba3d5d9bd2583" }, "downloads": -1, "filename": "pyfortified-requests-0.3.5.tar.gz", "has_sig": false, "md5_digest": "78575ed98bc85a6f1870b78b56ee4ccf", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33573, "upload_time": "2018-05-14T17:49:36", "url": "https://files.pythonhosted.org/packages/b0/f3/d4d00c6d77be378a44a244c46a317ac2f6b6284a7dc89a191b639ec0ab82/pyfortified-requests-0.3.5.tar.gz" } ], "0.3.6": [ { "comment_text": "", "digests": { "md5": "c4b08745091aa995538448e46a3fc116", "sha256": "2a7bb206b2d95e27b5af4dae428f21c3be848d0b3ec896067b80324ed649d4a9" }, "downloads": -1, "filename": "pyfortified_requests-0.3.6-py3-none-any.whl", "has_sig": false, "md5_digest": "c4b08745091aa995538448e46a3fc116", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 38627, "upload_time": "2018-05-14T18:05:44", "url": "https://files.pythonhosted.org/packages/84/d2/c16d897657493855f0914c27fe9f37fa397d967529715d71813926fed7f7/pyfortified_requests-0.3.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0050eb50a04831c0c301d25895121a34", "sha256": "a704863cd1b673861347bb20af540448fe984a3c434d849abc4da704991ac61b" }, "downloads": -1, "filename": "pyfortified-requests-0.3.6.tar.gz", "has_sig": false, "md5_digest": "0050eb50a04831c0c301d25895121a34", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33558, "upload_time": "2018-05-14T18:05:42", "url": "https://files.pythonhosted.org/packages/67/8d/fbd58eb7bead6f135deef8e62e1149ee29c3fda80bb9f77191af7906d916/pyfortified-requests-0.3.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c4b08745091aa995538448e46a3fc116", "sha256": "2a7bb206b2d95e27b5af4dae428f21c3be848d0b3ec896067b80324ed649d4a9" }, "downloads": -1, "filename": "pyfortified_requests-0.3.6-py3-none-any.whl", "has_sig": false, "md5_digest": "c4b08745091aa995538448e46a3fc116", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 38627, "upload_time": "2018-05-14T18:05:44", "url": "https://files.pythonhosted.org/packages/84/d2/c16d897657493855f0914c27fe9f37fa397d967529715d71813926fed7f7/pyfortified_requests-0.3.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0050eb50a04831c0c301d25895121a34", "sha256": "a704863cd1b673861347bb20af540448fe984a3c434d849abc4da704991ac61b" }, "downloads": -1, "filename": "pyfortified-requests-0.3.6.tar.gz", "has_sig": false, "md5_digest": "0050eb50a04831c0c301d25895121a34", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33558, "upload_time": "2018-05-14T18:05:42", "url": "https://files.pythonhosted.org/packages/67/8d/fbd58eb7bead6f135deef8e62e1149ee29c3fda80bb9f77191af7906d916/pyfortified-requests-0.3.6.tar.gz" } ] }