Skip to content

Instantly share code, notes, and snippets.

Avatar
👻
.

nikevp

👻
.
View GitHub Profile
@gbaman
gbaman / graphql_example.py
Created Nov 1, 2017
An example on using the Github GraphQL API with Python 3
View graphql_example.py
# An example to get the remaining rate limit using the Github GraphQL API.
import requests
headers = {"Authorization": "Bearer YOUR API KEY"}
def run_query(query): # A simple function to use requests.post to make the API call. Note the json= section.
request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers)
if request.status_code == 200:
@BietteMaxime
BietteMaxime / example_send_email_with_attachment.py
Created Sep 24, 2015
Simple python script to send an email with a csv attached
View example_send_email_with_attachment.py
# coding=utf-8
__author__ = 'Maxime Biette'
conf = {
'from': 'maximebiette@gmail.com',
'to': 'maximebiette+test@gmail.com',
'server': 'smtp.gmail.com',
'port': '587',
'tls': 'yes',
'login': 'maximebiette@gmail.com',
You can’t perform that action at this time.