An application for analysing the emotions in tweets from around London.
Team | User stories | Getting started | Usage | Testing | Deployment | Our approach | Contributing
As a User,
so I can pick up the moods of London,
I would like to pick a twitter topic for London
As a User,
so I can pick what I content is being examined,
I would like to be able to choose the content that is analysed
As a User,
so I can see what people feel about my topic,
I would like to be able to see the analysis
Clone the repo with git clone this_project_url.
You will need some API keys, locally, in your Travis CI and/or Heroku settings:
-
A Django SECRET_KEY - this is automatically generated on a new Django set-up, and can be a random string. Keep yours hidden as it gives admin rights for the project.
-
An API key for Watson - this can be gotten from the bluemix website.
-
You will also need a Twitter key and any other required credentials for making requests to the twitter API. Those will go into your environment as the twitter documentation instructs you.
Make sure you have python 3 and pip 3 installed. If you have python 2 installed as well change python to python3 in the code below. Do the same for pip by changing it to pip3.
Run pip install -r requirements.txt or pip3 install -r requirements.txt
Run python ./manage.py runserver or python3 ./manage.py runserver
This defaults to port 8000, so open localhost:8000 in your browser.
Please note that the app will take a short while to deploy as Holmes (see below) will take approximately 10-15 seconds to train on deployment.
At the moment whatever you type in will be analysed and the prominent mood displayed. Further progress will be shared shortly.
Holmes and Watson are two distinct sentiment analysers - find more information on them here.
The testing framework uses:
- pytest (including pytest-django and pytest-cov for coverage)
- selenium
- jasmine
As selenium is used, make sure you have Firefox installed.
Run pytest. Usually running python manage.py collectstatic --noinput/python3 manage.py collectstatic --noinput and python -m textblob.download_corpora/python3 -m textblob.download_corpora is required to pass the tests.
To run the view JavaScript Jasmine tests, open tweetmood/static/js/SpecRunner.html
To see a test coverage table run open htmlcov/index.html
To see code quality run radon cc tweetmood/*.py -a.
To use the linter run pylama.
The app uses a third-party API. Where required the tests mock calls to the API.
The application is deployed on Heroku. The first load might take a while, but it will boot up eventually. This can be used without any API keys necessary.
Read our manifesto to learn about our approach. Our Trello board is here.
Feel free to pull request any features you would like to add, however 100% code coverage is required as well as approvals from two of the founding members for it to be added.
Open up an issue here and we will try to get back to you as soon as possible.


