Debian Codegraph @

wordcloud/__main__.py

raw
1 # -*- coding: utf-8 -*-
2 """Command line tool to generate word clouds
3
4 The name ``__main__.py`` is important as it enables execution
5 of the module using ``python -m wordcloud`` syntax.
6
7 Usage:
8
9 * using ``wordcloud_cli`` executable::
10
11 $ cat word.txt | wordcloud_cli
12
13 $ wordcloud_cli --text=words.txt --stopwords=stopwords.txt
14
15 * using ``wordcloud`` module::
16
17 $ cat word.txt | python -m wordcloud
18
19 $ python -m wordcloud --text=words.txt --stopwords=stopwords.txt
20 """
21
22 import sys
23
24 from .wordcloud_cli import main as wordcloud_cli_main
25 from .wordcloud_cli import parse_args as wordcloud_cli_parse_args
26
27
28 def main():
29 """The main entry point to wordcloud_cli``.
30
31 This is installed as the script entry point.
32 """
33 wordcloud_cli_main(*wordcloud_cli_parse_args(sys.argv[1:]))
34
35
36 if __name__ == '__main__': # pragma: no cover
37 main()