Skip to content

Instantly share code, notes, and snippets.

View androiddrew's full-sized avatar
🎯
Focusing

Drew androiddrew

🎯
Focusing
  • AndroidDrew
  • Michigan
View GitHub Profile
@androiddrew
androiddrew / apistar_util.py
Last active August 14, 2019 17:16
Apistar 0.4 Extended JSON Response, SQLAlchemy Component, and SQLAlchemy Hook
import datetime as dt
import decimal
import typing
from apistar import types
from apistar.http import JSONResponse, Response
from apistar.server.components import Component
from sqlalchemy.engine import Engine
from sqlalchemy.orm import sessionmaker, Session, scoped_session
@androiddrew
androiddrew / app.py
Created January 30, 2018 19:48
An example using apistar-mail and apistar_dramatiq for async mail sending
from apistar import Include, Route
from apistar.frameworks.wsgi import WSGIApp as App
from apistar.http import QueryParams
from apistar_mail import mail_component, Mail, Message
from apistar_dramatiq import actor
settings = {
'MAIL': {
'MAIL_SERVER': 'smtp.example.com',
'MAIL_USERNAME': 'me@example.com',
@androiddrew
androiddrew / util.py
Last active November 6, 2017 22:07
Flask PulleyMethodView
# -*- coding: utf-8 -*-
"""
pulley.util
~~~~~~~~~~~
:copyright: (c) 2016 by Andrew Bednar.
"""
from flask.views import MethodView
from flask import request