Skip to content

Latest commit

 

History

History
67 lines (48 loc) · 1.04 KB

README.md

File metadata and controls

67 lines (48 loc) · 1.04 KB

cargomedia_social_graph

Small tests for CargoMedia Social Graph using different approaches and technologies

Python and mongoDB Example

Requirements for Python-mongDB sample

  • Python
  • mongoDB
  • pymongo

Usage

Get Usage Information:

python social_graph.py --help

python social_graph.py -h

Load JSON file data into mongoDB:

python social_graph.py --load [JSON_FILE]

python social_graph.py -l data.json

Get UserId (1) information:

python social_graph.py --info [USER_ID]

python social_graph.py -i 1

Get UserId (1) friends:

python social_graph.py --friends [USER_ID]

python social_graph.py -f 1

Get UserId (1) friends of friends:

python social_graph.py --friends_of_friends [USER_ID]

python social_graph.py -o 1

Get UserId (1) suggested friends:

python social_graph.py --suggested_friends [USER_ID]

python social_graph.py -s 1

Tests

Run tests using:

python -m doctest social_graph.py

Or:

python -m doctest -v social_graph.py