Skip to content

Instantly share code, notes, and snippets.

View jonathanmorgan's full-sized avatar

Jonathan Morgan jonathanmorgan

View GitHub Profile
@jonathanmorgan
jonathanmorgan / queryset_iterators.py
Created May 6, 2011 05:40 — forked from dbrgn/queryset_generators.py
queryset_generator and queryset_list_generator
'''
queryset_generator and queryset_list_generator based on:
https://gist.github.com/897894
'''
#===============================================================================
# imports (in alphabetical order by package, then by name)
#===============================================================================
# python standard libraries
@jonathanmorgan
jonathanmorgan / queryset_generators.py
Created March 10, 2012 21:29 — forked from mlissner/queryset_generators.py
Adds a date-based queryset generator
from datetime import datetime
from datetime import timedelta
def queryset_generator(queryset, chunksize=1000):
"""
Iterate over a Django Queryset ordered by the primary key
This method loads a maximum of chunksize (default: 1000) rows in its
memory at the same time while django normally would load all rows in its
memory. Using the iterator() method only causes it to not preload all the
@jonathanmorgan
jonathanmorgan / class2-test_drive.ipynb
Last active August 29, 2015 14:13
IPython Notebook with brief tests for software we'll use in class, to make sure it is installed correctly and working.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonathanmorgan
jonathanmorgan / class3-bash_ipython_design.ipynb
Last active August 29, 2015 14:13
IPython Notebook that goes over bash shell, IPython, IPython Notebook, and Software Design
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonathanmorgan
jonathanmorgan / Intro_to_python.ipynb
Last active November 14, 2016 18:02
class4-Intro_to_python.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonathanmorgan
jonathanmorgan / Good_programming_habits.ipynb
Last active March 24, 2017 16:50
Good programming habits
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonathanmorgan
jonathanmorgan / directory_help.ipynb
Last active January 12, 2017 11:31
Directory help.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonathanmorgan
jonathanmorgan / Data_and_databases.ipynb
Last active January 12, 2017 11:31
Data and databases - SQL and Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonathanmorgan
jonathanmorgan / APIs-getting_storing_using_data.ipynb
Last active January 12, 2017 11:31
APIs - getting, storing and using data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jonathanmorgan
jonathanmorgan / Scraping_information_from_the_web.ipynb
Last active January 12, 2017 11:31
Scraping_information_from_the_web
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.