We use Tock to track our time. You can read more about Tock in this blog post about its features.
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 requests | |
import os | |
select_url = raw_input("Which Tock API endpoint would you like to access? Type the number that corresponds with your choice:\n 1 = ...projects.json \n 2 = ...timecards_bulk.csv \n 3 = ...users.json \n \n >>>") | |
print "Gathering data..." | |
if select_url == "1": | |
url = "https://tock.18f.gov/api/projects.json" | |
fmt = "json" | |
elif select_url == "2": | |
url = "https://tock.18f.gov/api/timecards_bulk.csv" | |
fmt = "csv" |
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 json | |
import datetime | |
from random import randint | |
from django.contrib.auth.models import User | |
from employees.models import EmployeeGrade | |
def create_obj(): | |
objects = User.objects.filter() | |
for o in objects: |
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 os | |
import json | |
from projects.models import Project | |
from django.contrib.auth.models import User | |
from django.core.exceptions import ValidationError | |
""" | |
For data structure: | |
[ | |
{ |
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
// The route to Holden. | |
var holden_route = 'https://yourdomain/api/_incoming' | |
// The URL location of the source workbook, as a string. | |
var source_wb_url = 'https://docs.google.com/spreadsheets/...' | |
// The SheetID value of the sheet within the source workbook that holds | |
// additional execution information, as a string. | |
var exec_sheet_id = '123456778' | |
// For testing purposes, an integer <= that represents the percentage of each workbook | |
// you wish to consume. 1 == 100%. | |
var hunger_level = 1 |
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
#! /usr/bin/env python | |
import requests | |
import os, json | |
import datetime as dt | |
class DataSet: | |
def __init__(self): | |
self.created = dt.datetime.now() | |
self.data = [] |
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
# Let's say we wanted to print an array of the strings "p" and "q" that is | |
# 10 wide by 10 tall that looks like this: | |
""" | |
p q q q q q q q q q | |
p q q q q q q q q q | |
p q q q q q q q q q | |
p q q q q q q q q q | |
p q q q q q q q q q | |
p q q q q q q q q q | |
p q q q q q q q q q |
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 geojson | |
import geojsonio | |
import csv, os | |
# Requires mapshaper, a Node package. See https://github.com/mbloch/mapshaper/wiki/Introduction-to-the-Command-Line-Tool. | |
def load_map_data(filename): | |
with open(filename) as infile: | |
return geojson.loads(infile.read()) |
OlderNewer