-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
281 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
language: python | ||
|
||
python: | ||
- '2.7' | ||
|
||
before_install: | ||
- pip install nose | ||
- pip install mock | ||
- pip install coverage | ||
- pip install coveralls | ||
|
||
install: pip install -r requirements.txt | ||
|
||
script: make test | ||
|
||
after_script: coveralls | ||
|
||
notifications: | ||
email: | ||
recipients: | ||
- bbengfort@districtdatalabs.com | ||
- tojeda@districtdatalabs.com | ||
- rbilbro@districtdatalabs.com | ||
|
||
on_success: change | ||
on_failure: always |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Social networks are not new, even though websites like Facebook and Twitter might make you want to believe they are; and trust me- I’m not talking about Myspace! Social networks are extremely interesting models for human behavior, whose study dates back to the early twentieth century. However, because of those websites, data scientists have access to much more data than the anthropologists who studied the networks of tribes! | ||
|
||
Because networks take a relationship-centered view of the world, the data structures that we will analyze model real world behaviors and community. Through a suite of algorithms derived from mathematical Graph theory we are able to compute and predict behavior of individuals and communities through these types of analyses. Clearly this has a number of practical applications from recommendation to law enforcement to election prediction, and more. | ||
|
||
Tribe is a utility that will allow you to extract a network (a graph) from a communication network that we all use often - our email. Tribe is designed to read an email mbox (a native format for email in Python)and write the resulting graph to a GraphML file on disk. This utility is generally used for District Data Labs' Graph Analytics with Python and NetworkX course, but can be used for anyone interested in studying networks. | ||
|
||
For more, please see the full documentation at: http://ddl-tribe.readthedocs.org/en/latest/ |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,134 @@ | ||
#!/usr/bin/env python | ||
# setup | ||
# Setup script for installing tribe | ||
# | ||
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com> | ||
# Created: Fri Mar 11 14:57:10 2016 -0500 | ||
# | ||
# Copyright (C) 2016 District Data Labs | ||
# For license information, see LICENSE.txt and NOTICE.md | ||
# | ||
# ID: setup.py [] benjamin@bengfort.com $ | ||
|
||
""" | ||
Setup script for installing tribe. | ||
See http://bbengfort.github.io/programmer/2016/01/20/packaging-with-pypi.html | ||
""" | ||
|
||
########################################################################## | ||
## Imports | ||
########################################################################## | ||
|
||
import os | ||
import re | ||
import codecs | ||
|
||
from setuptools import setup | ||
from setuptools import find_packages | ||
|
||
########################################################################## | ||
## Package Information | ||
########################################################################## | ||
|
||
## Basic information | ||
NAME = "tribe" | ||
DESCRIPTION = "An graph extraction tool for email MBox files" | ||
AUTHOR = "Benjamin Bengfort" | ||
EMAIL = "bbengfort@districtdatalabs.com" | ||
LICENSE = "MIT" | ||
REPOSITORY = "https://github.com/DistrictDataLabs/tribe" | ||
PACKAGE = "tribe" | ||
|
||
## Define the keywords | ||
KEYWORDS = ('graph', 'networkx', 'data science', 'analysis', 'social network') | ||
|
||
## Define the classifiers | ||
## See https://pypi.python.org/pypi?%3Aaction=list_classifiers | ||
CLASSIFIERS = ( | ||
'Development Status :: 4 - Beta', | ||
'Environment :: Console', | ||
'Intended Audience :: Developers', | ||
'License :: OSI Approved :: MIT License', | ||
'Natural Language :: English', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 2.7', | ||
'Topic :: Software Development', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
'Topic :: Utilities', | ||
) | ||
|
||
## Important Paths | ||
PROJECT = os.path.abspath(os.path.dirname(__file__)) | ||
REQUIRE_PATH = "requirements.txt" | ||
VERSION_PATH = os.path.join(PACKAGE, "version.py") | ||
PKG_DESCRIBE = "DESCRIPTION.txt" | ||
|
||
## Directories to ignore in find_packages | ||
EXCLUDES = ( | ||
"tests", "bin", "docs", "fixtures", "register", "notebooks", | ||
) | ||
|
||
########################################################################## | ||
## Helper Functions | ||
########################################################################## | ||
|
||
def read(*parts): | ||
""" | ||
Assume UTF-8 encoding and return the contents of the file located at the | ||
absolute path from the REPOSITORY joined with *parts. | ||
""" | ||
with codecs.open(os.path.join(PROJECT, *parts), 'rb', 'utf-8') as f: | ||
return f.read() | ||
|
||
|
||
def get_version(path=VERSION_PATH): | ||
""" | ||
Reads the __init__.py defined in the VERSION_PATH to find the get_version | ||
function, and executes it to ensure that it is loaded correctly. | ||
""" | ||
namespace = {} | ||
exec(read(path), namespace) | ||
return namespace['get_version']() | ||
|
||
|
||
def get_requires(path=REQUIRE_PATH): | ||
""" | ||
Yields a generator of requirements as defined by the REQUIRE_PATH which | ||
should point to a requirements.txt output by `pip freeze`. | ||
""" | ||
for line in read(path).splitlines(): | ||
line = line.strip() | ||
if line and not line.startswith('#'): | ||
yield line | ||
|
||
########################################################################## | ||
## Define the configuration | ||
########################################################################## | ||
|
||
config = { | ||
"name": NAME, | ||
"version": get_version(), | ||
"description": DESCRIPTION, | ||
"long_description": read(PKG_DESCRIBE), | ||
"license": LICENSE, | ||
"author": AUTHOR, | ||
"author_email": EMAIL, | ||
"maintainer": AUTHOR, | ||
"maintainer_email": EMAIL, | ||
"url": REPOSITORY, | ||
"download_url": "{}/tarball/v{}".format(REPOSITORY, get_version()), | ||
"packages": find_packages(where=PROJECT, exclude=EXCLUDES), | ||
"install_requires": list(get_requires()), | ||
"classifiers": CLASSIFIERS, | ||
"keywords": KEYWORDS, | ||
"zip_safe": False, | ||
"scripts": ['bin/baleen'], | ||
} | ||
|
||
########################################################################## | ||
## Run setup script | ||
########################################################################## | ||
|
||
if __name__ == '__main__': | ||
raise NotImplementedError("Setup has not been created yet.") | ||
setup(**config) |
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
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
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
Oops, something went wrong.