Created
January 27, 2016 02:18
-
-
Save ryantuck/fd8a6c8f47d469b54a7f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arrow | |
import pprint | |
start = '2015-01-01' | |
end = '2015-01-02' | |
s = arrow.get(start) | |
e = arrow.get(end) | |
print s | |
print e | |
num_days = (e-s).days | |
def chunks(l,n): | |
for i in xrange(0, len(l), n): | |
yield l[i:i+n] | |
date_chunks = list(chunks(range(0,num_days), 10)) | |
d = 0 | |
diff = 10 | |
while d < num_days: | |
tmp_start = d | |
tmp_end = min((d+diff), num_days) | |
print tmp_start, '/', tmp_end | |
print s.replace(days=+tmp_start).format('YYYY-MM-DD') | |
print s.replace(days=+tmp_end).format('YYYY-MM-DD') | |
d += diff |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment