pydocという機能を使うと、Javadocのようなものが作れるらしい。

先日のtwc.pyに書き足してみる

"""
This is a command line tool of watching twitter timelines
"""
__author__  = 'Kameko Kamekame<kame@kamekokamekame.net>'
__status__  = "production"
__version__ = "0.1.0"
__date__    = "11 Apr 2015"

Pythonのインタプリタで実行

$ python
>>> help()
help> twc

おお!表示された!!

Help on module twc:
NAME
    twc - This is a command line tool of watching twitter timelines
FILE
    /Users/kaz/git/twitter-cli/twc.py
FUNCTIONS
    post_tweet(oauth, args)
    show_home_timeline(oauth)
    show_user_timeline(oauth, args)
        # Get someone's timeline
DATA
    AS = 'XXXXXXXXXXXXXXX'
    AT = 'XXXXXXXXXXXXXXX'
    CK = 'XXXXXXXXXXXXXXX'
    CS = 'XXXXXXXXXXXXXXX'
    HOME_TIME_LINE_URL = 'https://api.twitter.com/1.1/statuses/home_timeli...
    POST_STATUS_UPDATE = 'https://api.twitter.com/1.1/statuses/update.json...
    USER_TIME_LINE_URL = 'https://api.twitter.com/1.1/statuses/user_timeli...
    __author__  = 'Kameko Kamekame<kame@kamekokamekame.net>'
    __date__ = '11 Apr 2015'
    __status__ = 'production'
    __version__ = '0.1.0'
    config = 'twitter_key:\n    CK: XXXXXXXXXXXXXXX  ... https:/...
    data = {'twitter_key': {'AS': 'XXXXXXXXXXXXXXX...
    tz_tokyo = <DstTzInfo 'Asia/Tokyo' JST+9:00:00 STD>
VERSION
    0.1.0
DATE
    11 Apr 2015
AUTHOR
    Kameko Kamekame <kame@kamekokamekame.net>