__init__.py 803 B

123456789101112131415161718192021222324252627282930313233343536
  1. # -*- coding: utf-8 -*-
  2. # Natural Language Toolkit: Twitter
  3. #
  4. # Copyright (C) 2001-2020 NLTK Project
  5. # Author: Ewan Klein <ewan@inf.ed.ac.uk>
  6. # URL: <http://nltk.org/>
  7. # For license information, see LICENSE.TXT
  8. """
  9. NLTK Twitter Package
  10. This package contains classes for retrieving Tweet documents using the
  11. Twitter API.
  12. """
  13. try:
  14. import twython
  15. except ImportError:
  16. import warnings
  17. warnings.warn(
  18. "The twython library has not been installed. "
  19. "Some functionality from the twitter package will not be available."
  20. )
  21. else:
  22. from nltk.twitter.util import Authenticate, credsfromfile
  23. from nltk.twitter.twitterclient import (
  24. Streamer,
  25. Query,
  26. Twitter,
  27. TweetViewer,
  28. TweetWriter,
  29. )
  30. from nltk.twitter.common import json2csv