Run program with python rolodex.py [file_name]
- python rolodex test_input.txt
will show a working example
Run tests with python -m unittest discover -v
# http://docs.python-requests.org/en/latest/ | |
import requests | |
from datetime import datetime, timedelta | |
domain_name = 'domain' | |
username = 'username' | |
password = 'password' | |
# lookup past 3 days along with today in case someone left a timer running | |
today = datetime.now() |
# -*- coding: utf-8 -*- | |
""" | |
Calculates the following 'Developer Focus' metric using | |
data from the Pivotal Tracker API: | |
# unique developers actively working on active projects / | |
Open stories ("started" state) from active projects | |
For this first pass, the IDs of active projects and | |
developers are set as environment variables. | |
In the future, it may be possible to determine these |
#!/bin/bash | |
# installs virtualenvwrapper and adds initialization logic for .bashrc file | |
# change RC_FILE value as needed | |
RC_FILE=~/.bashrc | |
# global install of virtualenvwrapper | |
sudo pip install virtualenvwrapper | |
# creation of directory to store Python virtual environments |
from model_mommy import generators | |
MOMMY_CUSTOM_FIELDS_GEN = { | |
'easy_thumbnails.fields.ThumbnailerImageField': generators.gen_image_field, | |
'model_utils.fields.AutoCreatedField': generators.gen_datetime, | |
'model_utils.fields.AutoLastModifiedField': generators.gen_datetime, | |
'django_extensions.db.fields.AutoSlugField': generators.gen_slug, | |
} |
" Initialize pathogen for flake8 | |
execute pathogen#infect() | |
syntax on | |
filetype plugin indent on | |
" remove trailing spaces in Python & Markdown | |
autocmd BufWritePre *.py :%s/\s\+$//e | |
autocmd BufWritePre *.md :%s/\s\+$//e | |
" call flake8 at every save |
class OrganizationImportExportResource(ModelResource): | |
types = widgets.ManyToManyWidget(model=graph_models.OrganizationType, | |
field='name') | |
class Meta: | |
model = Organization | |
fields = [ | |
'name', | |
] | |
import_id_fields = ['name'] |
class StudenAdmin(admin.ModelAdmin): | |
inlines = (StudentRecordInline,) |
import csv | |
from sys import argv | |
import requests | |
def transform_user_file(filename: str) -> []: | |
user_file = open(filename, 'r') | |
user_data = csv.reader(user_file) | |
# skip first row |