python-http-client


Namepython-http-client JSON
Version 3.3.7 PyPI version JSON
download
home_pagehttps://github.com/sendgrid/python-http-client
SummaryHTTP REST client, simplified for Python
upload_time2022-03-09 20:23:56
maintainer
docs_urlNone
authorElmer Thomas
requires_python>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
licenseMIT
keywords rest http api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://github.com/sendgrid/sendgrid-python/raw/HEAD/twilio_sendgrid_logo.png
   :target: https://www.sendgrid.com

|Test and Deploy Badge| |Twitter Follow| |Codecov branch| |Code Climate| |Python Versions| |PyPI Version| |GitHub contributors| |MIT licensed|

**The default branch name for this repository has been changed to `main` as of 07/27/2020.**

**Quickly and easily access any RESTful or RESTful-like API.**

If you are looking for the Twilio SendGrid API client library, please see `this repo`_.

Table of Contents
=================

-  `Installation <#installation>`__
-  `Quick Start <#quick-start>`__
-  `Usage <#usage>`__
-  `How to Contribute <#how-to-contribute>`__
-  `Local Setup of the Project <#local-setup-of-the-project>`__
-  `Troubleshooting <#troubleshooting>`__
-  `Announcements <#announcements>`__
-  `Thanks <#thanks>`__
-  `About <#about>`__
-  `License <#license>`__

Installation
============

Prerequisites
-------------

-  Python version 2.7 or 3.4+

Install Package
---------------

.. code:: bash

    pip install python_http_client

or

.. code:: bash

    easy_install python_http_client

API Key
-------

Store your Twilio SendGrid API key in a ``.env`` file.

.. code:: bash

    cp .env_sample .env

Edit the ``.env`` file and add your API key.

Quick Start
===========

Here is a quick example:

``GET /your/api/{param}/call``

.. code:: python

    import python_http_client

    global_headers = {"Authorization": "Bearer XXXXXXX"}
    client = Client(host='base_url', request_headers=global_headers)
    client.your.api._(param).call.get()
    print(response.status_code)
    print(response.headers)
    print(response.body)

``POST /your/api/{param}/call`` with headers, query parameters and a request body with versioning.

.. code:: python

    import python_http_client

    global_headers = {"Authorization": "Bearer XXXXXXX"}
    client = Client(host='base_url', request_headers=global_headers)
    query_params = {"hello":0, "world":1}
    request_headers = {"X-Test": "test"}
    data = {"some": 1, "awesome": 2, "data": 3}
    response = client.your.api._(param).call.post(request_body=data,
                                                  query_params=query_params,
                                                  request_headers=request_headers)
    print(response.status_code)
    print(response.headers)
    print(response.body)

Usage
=====

-  `Example Code`_

How to Contribute
=================

We encourage contribution to our projects, please see our `CONTRIBUTING`_ guide for details.

Quick links:

-  `Feature Request`_
-  `Bug Reports`_
-  `Improvements to the Codebase`_
-  `Review Pull Requests`_

Local Setup of the Project
==========================

The simplest local development workflow is by using docker.

1. Install Docker
2. Run ``docker-compose build`` (this builds the container)
3. Run ``docker-compose up`` (this runs tests by default)

Troubleshooting
===============

Please see our `troubleshooting guide`_ for any issues.

Announcements
=============

All updates to this project is documented in our `CHANGELOG`_.

Thanks
======

We were inspired by the work done on `birdy`_ and `universalclient`_.

About
=====

**python-http-client** is maintained and funded by Twilio SendGrid, Inc.
The names and logos for **python-http-client** are trademarks of Twilio SendGrid, Inc.

License
=======

`The MIT License (MIT)`_

.. _this repo: https://github.com/sendgrid/sendgrid-python
.. _Example Code: https://github.com/sendgrid/python-http-client/tree/HEAD/examples
.. _CONTRIBUTING: https://github.com/sendgrid/python-http-client/blob/HEAD/CONTRIBUTING.md
.. _Feature Request: https://github.com/sendgrid/python-http-client/blob/HEAD/CONTRIBUTING.md#feature-request
.. _Bug Reports: https://github.com/sendgrid/python-http-client/blob/HEAD/CONTRIBUTING.md#submit-a-bug-report
.. _Improvements to the Codebase: https://github.com/sendgrid/python-http-client/blob/HEAD/CONTRIBUTING.md#improvements-to-the-codebase
.. _Review Pull Requests: https://github.com/sendgrid/python-http-client/blob/HEAD/CONTRIBUTING.md#code-reviews
.. _troubleshooting guide: https://github.com/sendgrid/python-http-client/blob/HEAD/TROUBLESHOOTING.md
.. _CHANGELOG: https://github.com/sendgrid/python-http-client/blob/HEAD/CHANGELOG.md
.. _birdy: https://github.com/inueni/birdy
.. _universalclient: https://github.com/dgreisen/universalclient
.. _The MIT License (MIT): https://github.com/sendgrid/python-http-client/blob/HEAD/LICENSE
.. _this is an incredible opportunity to join our #DX team: https://sendgrid.com/careers/role/1421152/?gh_jid=1421152

.. |Test and Deploy Badge| image:: https://github.com/sendgrid/python-http-client/actions/workflows/test-and-deploy.yml/badge.svg
   :target: https://github.com/sendgrid/python-http-client/actions/workflows/test-and-deploy.yml
.. |Twitter Follow| image:: https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow
   :target: https://twitter.com/sendgrid
.. |Codecov branch| image:: https://img.shields.io/codecov/c/github/sendgrid/python-http-client/main.svg?style=flat-square&label=Codecov+Coverage
   :target: https://codecov.io/gh/sendgrid/python-http-client
.. |Code Climate| image:: https://codeclimate.com/github/sendgrid/python-http-client/badges/gpa.svg
   :target: https://codeclimate.com/github/sendgrid/python-http-client
.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/python-http-client.svg
   :target: https://pypi.org/project/python-http-client
.. |PyPI Version| image:: https://img.shields.io/pypi/v/python-http-client.svg
   :target: https://pypi.org/project/python-http-client
.. |GitHub contributors| image:: https://img.shields.io/github/contributors/sendgrid/python-http-client.svg
   :target: https://github.com/sendgrid/python-http-client/graphs/contributors
.. |MIT licensed| image:: https://img.shields.io/badge/license-MIT-blue.svg
   :target: https://github.com/sendgrid/python-http-client/blob/HEAD/LICENSE



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sendgrid/python-http-client",
    "name": "python-http-client",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
    "maintainer_email": "",
    "keywords": "REST,HTTP,API",
    "author": "Elmer Thomas",
    "author_email": "help@twilio.com",
    "download_url": "https://files.pythonhosted.org/packages/56/fa/284e52a8c6dcbe25671f02d217bf2f85660db940088faf18ae7a05e97313/python_http_client-3.3.7.tar.gz",
    "platform": null,
    "description": ".. image:: https://github.com/sendgrid/sendgrid-python/raw/HEAD/twilio_sendgrid_logo.png\n   :target: https://www.sendgrid.com\n\n|Test and Deploy Badge| |Twitter Follow| |Codecov branch| |Code Climate| |Python Versions| |PyPI Version| |GitHub contributors| |MIT licensed|\n\n**The default branch name for this repository has been changed to `main` as of 07/27/2020.**\n\n**Quickly and easily access any RESTful or RESTful-like API.**\n\nIf you are looking for the Twilio SendGrid API client library, please see `this repo`_.\n\nTable of Contents\n=================\n\n-  `Installation <#installation>`__\n-  `Quick Start <#quick-start>`__\n-  `Usage <#usage>`__\n-  `How to Contribute <#how-to-contribute>`__\n-  `Local Setup of the Project <#local-setup-of-the-project>`__\n-  `Troubleshooting <#troubleshooting>`__\n-  `Announcements <#announcements>`__\n-  `Thanks <#thanks>`__\n-  `About <#about>`__\n-  `License <#license>`__\n\nInstallation\n============\n\nPrerequisites\n-------------\n\n-  Python version 2.7 or 3.4+\n\nInstall Package\n---------------\n\n.. code:: bash\n\n    pip install python_http_client\n\nor\n\n.. code:: bash\n\n    easy_install python_http_client\n\nAPI Key\n-------\n\nStore your Twilio SendGrid API key in a ``.env`` file.\n\n.. code:: bash\n\n    cp .env_sample .env\n\nEdit the ``.env`` file and add your API key.\n\nQuick Start\n===========\n\nHere is a quick example:\n\n``GET /your/api/{param}/call``\n\n.. code:: python\n\n    import python_http_client\n\n    global_headers = {\"Authorization\": \"Bearer XXXXXXX\"}\n    client = Client(host='base_url', request_headers=global_headers)\n    client.your.api._(param).call.get()\n    print(response.status_code)\n    print(response.headers)\n    print(response.body)\n\n``POST /your/api/{param}/call`` with headers, query parameters and a request body with versioning.\n\n.. code:: python\n\n    import python_http_client\n\n    global_headers = {\"Authorization\": \"Bearer XXXXXXX\"}\n    client = Client(host='base_url', request_headers=global_headers)\n    query_params = {\"hello\":0, \"world\":1}\n    request_headers = {\"X-Test\": \"test\"}\n    data = {\"some\": 1, \"awesome\": 2, \"data\": 3}\n    response = client.your.api._(param).call.post(request_body=data,\n                                                  query_params=query_params,\n                                                  request_headers=request_headers)\n    print(response.status_code)\n    print(response.headers)\n    print(response.body)\n\nUsage\n=====\n\n-  `Example Code`_\n\nHow to Contribute\n=================\n\nWe encourage contribution to our projects, please see our `CONTRIBUTING`_ guide for details.\n\nQuick links:\n\n-  `Feature Request`_\n-  `Bug Reports`_\n-  `Improvements to the Codebase`_\n-  `Review Pull Requests`_\n\nLocal Setup of the Project\n==========================\n\nThe simplest local development workflow is by using docker.\n\n1. Install Docker\n2. Run ``docker-compose build`` (this builds the container)\n3. Run ``docker-compose up`` (this runs tests by default)\n\nTroubleshooting\n===============\n\nPlease see our `troubleshooting guide`_ for any issues.\n\nAnnouncements\n=============\n\nAll updates to this project is documented in our `CHANGELOG`_.\n\nThanks\n======\n\nWe were inspired by the work done on `birdy`_ and `universalclient`_.\n\nAbout\n=====\n\n**python-http-client** is maintained and funded by Twilio SendGrid, Inc.\nThe names and logos for **python-http-client** are trademarks of Twilio SendGrid, Inc.\n\nLicense\n=======\n\n`The MIT License (MIT)`_\n\n.. _this repo: https://github.com/sendgrid/sendgrid-python\n.. _Example Code: https://github.com/sendgrid/python-http-client/tree/HEAD/examples\n.. _CONTRIBUTING: https://github.com/sendgrid/python-http-client/blob/HEAD/CONTRIBUTING.md\n.. _Feature Request: https://github.com/sendgrid/python-http-client/blob/HEAD/CONTRIBUTING.md#feature-request\n.. _Bug Reports: https://github.com/sendgrid/python-http-client/blob/HEAD/CONTRIBUTING.md#submit-a-bug-report\n.. _Improvements to the Codebase: https://github.com/sendgrid/python-http-client/blob/HEAD/CONTRIBUTING.md#improvements-to-the-codebase\n.. _Review Pull Requests: https://github.com/sendgrid/python-http-client/blob/HEAD/CONTRIBUTING.md#code-reviews\n.. _troubleshooting guide: https://github.com/sendgrid/python-http-client/blob/HEAD/TROUBLESHOOTING.md\n.. _CHANGELOG: https://github.com/sendgrid/python-http-client/blob/HEAD/CHANGELOG.md\n.. _birdy: https://github.com/inueni/birdy\n.. _universalclient: https://github.com/dgreisen/universalclient\n.. _The MIT License (MIT): https://github.com/sendgrid/python-http-client/blob/HEAD/LICENSE\n.. _this is an incredible opportunity to join our #DX team: https://sendgrid.com/careers/role/1421152/?gh_jid=1421152\n\n.. |Test and Deploy Badge| image:: https://github.com/sendgrid/python-http-client/actions/workflows/test-and-deploy.yml/badge.svg\n   :target: https://github.com/sendgrid/python-http-client/actions/workflows/test-and-deploy.yml\n.. |Twitter Follow| image:: https://img.shields.io/twitter/follow/sendgrid.svg?style=social&label=Follow\n   :target: https://twitter.com/sendgrid\n.. |Codecov branch| image:: https://img.shields.io/codecov/c/github/sendgrid/python-http-client/main.svg?style=flat-square&label=Codecov+Coverage\n   :target: https://codecov.io/gh/sendgrid/python-http-client\n.. |Code Climate| image:: https://codeclimate.com/github/sendgrid/python-http-client/badges/gpa.svg\n   :target: https://codeclimate.com/github/sendgrid/python-http-client\n.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/python-http-client.svg\n   :target: https://pypi.org/project/python-http-client\n.. |PyPI Version| image:: https://img.shields.io/pypi/v/python-http-client.svg\n   :target: https://pypi.org/project/python-http-client\n.. |GitHub contributors| image:: https://img.shields.io/github/contributors/sendgrid/python-http-client.svg\n   :target: https://github.com/sendgrid/python-http-client/graphs/contributors\n.. |MIT licensed| image:: https://img.shields.io/badge/license-MIT-blue.svg\n   :target: https://github.com/sendgrid/python-http-client/blob/HEAD/LICENSE\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "HTTP REST client, simplified for Python",
    "version": "3.3.7",
    "project_urls": {
        "Download": "https://github.com/sendgrid/python-http-client/tarball/3.3.7",
        "Homepage": "https://github.com/sendgrid/python-http-client"
    },
    "split_keywords": [
        "rest",
        "http",
        "api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "29319b360138f4e4035ee9dac4fe1132b6437bd05751aaf1db2a2d83dc45db5f",
                "md5": "2b67260ce1dff99cc99056a1bd3803b3",
                "sha256": "ad371d2bbedc6ea15c26179c6222a78bc9308d272435ddf1d5c84f068f249a36"
            },
            "downloads": -1,
            "filename": "python_http_client-3.3.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2b67260ce1dff99cc99056a1bd3803b3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
            "size": 8352,
            "upload_time": "2022-03-09T20:23:54",
            "upload_time_iso_8601": "2022-03-09T20:23:54.862406Z",
            "url": "https://files.pythonhosted.org/packages/29/31/9b360138f4e4035ee9dac4fe1132b6437bd05751aaf1db2a2d83dc45db5f/python_http_client-3.3.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "56fa284e52a8c6dcbe25671f02d217bf2f85660db940088faf18ae7a05e97313",
                "md5": "68895a699b4811fa97bbe55a2ea3d1db",
                "sha256": "bf841ee45262747e00dec7ee9971dfb8c7d83083f5713596488d67739170cea0"
            },
            "downloads": -1,
            "filename": "python_http_client-3.3.7.tar.gz",
            "has_sig": false,
            "md5_digest": "68895a699b4811fa97bbe55a2ea3d1db",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
            "size": 9377,
            "upload_time": "2022-03-09T20:23:56",
            "upload_time_iso_8601": "2022-03-09T20:23:56.386485Z",
            "url": "https://files.pythonhosted.org/packages/56/fa/284e52a8c6dcbe25671f02d217bf2f85660db940088faf18ae7a05e97313/python_http_client-3.3.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-03-09 20:23:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sendgrid",
    "github_project": "python-http-client",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "tox": true,
    "lcname": "python-http-client"
}
        
Elapsed time: 0.37099s