← Winnitude! Search  ·  Reader Mode (1770 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 108 LINKS

GitHub - sendgrid/python-http-client: Twilio SendGrid's Python HTTP Client for calling APIs

Repository navigation

python-http-client
Public

About

Twilio SendGrid's Python HTTP Client for calling APIs

sendgrid.com

Resources

Readme MIT license

Code of conduct

Code of conduct

Contributing

Contributing Activity Custom properties

Stars

127 stars

Watchers

155 watching

Forks

103 forks Report repository
Branches

Tags
Go to Branches page Go to Tags page

Latest commit

 

History


415 Commits
View commit history for this file.

Folders and files

Name Name Last commit message Last commit date
.github/ workflows .github/ workflows    
examples examples    
python_http_client python_http_client    
static/ img static/ img    
tests tests    
.dockerignore .dockerignore    
.env_sample .env_sample    
.gitignore .gitignore    
CHANGELOG.md CHANGELOG.md    
CODE_OF_CONDUCT.md CODE_OF_CONDUCT.md    
CONTRIBUTING.md CONTRIBUTING.md    
Dockerfile Dockerfile    
FIRST_TIMERS.md FIRST_TIMERS.md    
LICENSE LICENSE    
MANIFEST.in MANIFEST.in    
Makefile Makefile    
PULL_REQUEST_TEMPLATE.md PULL_REQUEST_TEMPLATE.md    
README.rst README.rst    
TROUBLESHOOTING.md TROUBLESHOOTING.md    
USAGE.md USAGE.md    
USE_CASES.md USE_CASES.md    
VERSION.txt VERSION.txt    
auto_generate_release_notes.sh auto_generate_release_notes.sh    
cleanup.sh cleanup.sh    
docker-compose.yml docker-compose.yml    
requirements.txt requirements.txt    
run.sh run.sh    
setup.py setup.py    
tox.ini tox.ini    
twilio_sendgrid_logo.png twilio_sendgrid_logo.png    

Repository files navigation

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

Prerequisites

  • Python version 2.7 or 3.4+

Install Package

pip install python_http_client

or

easy_install python_http_client

API Key

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

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

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.

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

How to Contribute

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

Quick links:

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)

About

Twilio SendGrid's Python HTTP Client for calling APIs

sendgrid.com

Resources

Readme MIT license

Code of conduct

Code of conduct

Contributing

Contributing Activity Custom properties

Stars

127 stars

Watchers

155 watching

Forks

103 forks Report repository

Releases

Packages

Used by

Contributors

Languages