]> jfr.im git - z_archive/twitter.git/blame - twitter/__init__.py
bandaid unicode/str.encode-related crash bug
[z_archive/twitter.git] / twitter / __init__.py
CommitLineData
7364ea65 1"""
2The minimalist yet fully featured Twitter API and Python toolset.
3
24950891
MV
4The Twitter and TwitterStream classes are the key to building your own
5Twitter-enabled applications.
5f47b302 6
7364ea65 7"""
8
a6a7f763
MV
9from textwrap import dedent
10
f7e63802 11from .api import Twitter, TwitterError, TwitterHTTPError, TwitterResponse
24950891 12from .auth import NoAuth, UserPassAuth
c2176d4e
MV
13from .oauth import (
14 OAuth, read_token_file, write_token_file,
15 __doc__ as oauth_doc)
16from .oauth2 import (
17 OAuth2, read_bearer_token_file, write_bearer_token_file,
18 __doc__ as oauth2_doc)
dd648a25 19from .stream import TwitterStream
c2176d4e 20from .oauth_dance import oauth_dance, oauth2_dance
24950891 21
ede8b119 22__doc__ = __doc__ or ""
24950891
MV
23
24__doc__ += """
25The Twitter class
51e0b8f1 26-----------------
24950891 27"""
ede8b119 28__doc__ += dedent(Twitter.__doc__ or "")
24950891
MV
29
30__doc__ += """
31The TwitterStream class
51e0b8f1 32-----------------------
24950891 33"""
ede8b119 34__doc__ += dedent(TwitterStream.__doc__ or "")
24950891
MV
35
36
37__doc__ += """
38Twitter Response Objects
51e0b8f1 39------------------------
24950891 40"""
ede8b119 41__doc__ += dedent(TwitterResponse.__doc__ or "")
24950891
MV
42
43
44__doc__ += """
a6a7f763 45Authentication
51e0b8f1 46--------------
24950891
MV
47
48You can authenticate with Twitter in three ways: NoAuth, OAuth, or
c2176d4e 49OAuth2 (app-only). Get help() on these classes to learn how to use them.
24950891 50
c2176d4e 51OAuth and OAuth2 are probably the most useful.
24950891 52
24950891 53
a6a7f763 54Working with OAuth
51e0b8f1 55------------------
24950891
MV
56"""
57
ede8b119 58__doc__ += dedent(oauth_doc or "")
a6a7f763 59
c2176d4e
MV
60__doc__ += """
61Working with OAuth2
62-------------------
63"""
64
65__doc__ += dedent(oauth2_doc or "")
66
67__all__ = [
68 "NoAuth",
69 "OAuth",
70 "OAuth2",
71 "oauth2_dance",
72 "oauth_dance",
73 "read_bearer_token_file",
74 "read_token_file",
75 "Twitter",
76 "TwitterError",
77 "TwitterHTTPError",
78 "TwitterResponse",
79 "TwitterStream",
80 "UserPassAuth",
81 "write_bearer_token_file",
82 "write_token_file",
83 ]