Importer¶
The Importer app is concerned with getting corpus data into the database. It defines a number of Django management commands for making this easier.
Commands¶
-
class
msgvis.apps.importer.management.commands.import_corpus.
Command
[source]¶ Import a corpus of message data into the database.
$ python manage.py import_corpus <file_path>
-
class
msgvis.apps.importer.management.commands.import_twitter_languages.
Command
[source]¶ Import supported languages from the Twitter API into the database. If the languages already exist in the database, they will not be duplicated.
Note
Requires the tweepy Twitter API library:
pip install tweepy
Example:
$ python manage.py import_twitter_languages
-
class
msgvis.apps.importer.management.commands.import_twitter_timezones.
Command
[source]¶ Obtains a mapping of the Twitter-supported timezones from the Ruby on Rails TimeZone class.
Get the mapping dictionary from https://github.com/rails/rails/blob/master/activesupport/lib/active_support/values/time_zone.rb
Note
Requires Ruby on Rails to be installed:
gem install rails
.Example:
$ python manage.py import_twitter_timezones setup/time_zone_mapping.rb
Twitter Integration¶
Utilities for working with Twitter.
Models¶
-
msgvis.apps.importer.models.
create_an_instance_from_json
(json_str, dataset_obj)[source]¶ Given a dataset object, imports a tweet from json string into the dataset.