Skip to content

Instantly share code, notes, and snippets.

from graphene_pydantic import PydanticObjectType
class GraphQLFlight(PydanticObjectType):
class Meta:
model = Flight
type Flight {
origin: String
destination: String
departure: DateTime
}
In [0]: Flight(origin="DCA", destination="ORD", departure="hurrah")
ValidationError: 1 validation error
departure
invalid datetime format (type=type_error.datetime)
from datetime import datetime
from pydantic import BaseModel
class Flight(BaseModel):
origin: str
destination: str
departure: datetime
# https://gist.github.com/unbracketed/3380407
"""
Exports Issues from a specified repository to a CSV file
Uses basic authentication (Github username + password) to retrieve Issues
from a repository that username has access to. Supports Github API v3.
"""
import sys
import csv
import requests
@necaris
necaris / keybase.md
Created November 9, 2014 23:09
keybase proof

Keybase proof

I hereby claim:

  • I am necaris on github.
  • I am necaris (https://keybase.io/necaris) on keybase.
  • I have a public key whose fingerprint is 3BF7 81AD 3BD9 B5EF 67C8 E0DE EA69 CB29 A08D 8FD1

To claim this, I am signing this object:

Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/usr/local/lib/python2.7/site-packages/pip/req.py", line 1435, in install
requirement.install(install_options, global_options, *args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/pip/req.py", line 671, in install
self.move_wheel_files(self.source_dir, root=root)
File "/usr/local/lib/python2.7/site-packages/pip/req.py", line 901, in move_wheel_files
#!/usr/bin/env python
#-*-coding: utf-8-*-
"""
Simple script to dump documents out of a CouchDB database and straight into
a Couchbase instance.
"""
# Copyright (c) 2013, Rami Chowdhury
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#!/usr/bin/env python
#-*-coding: utf-8-*-
"""
Fake CouchDB replication endpoint that copies documents into Couchbase.
"""
# Copyright (c) 2013, Rami Chowdhury
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
@necaris
necaris / couchdb2cb.py
Last active December 2, 2017 09:55
Simple script to transfer data from CouchDB to Couchbase
#-*-coding: utf-8-*-
"""
Simple script to dump documents out of a CouchDB database and straight into
a Couchbase instance.
"""
import time
import sys
import argparse