title: How to package a command line Python script
body: <p>I've created a python script that's intended to be used from the command line. How do I go about packaging it? This is my first python package and I've read a bit about setuptools, but I'm still not sure the best way to do this.</p>
  
  <hr>
  
  <h1>Solution</h1>
  
  <p>I ended up using <a href="http://peak.telecommunity.com/DevCenter/setuptools" rel="noreferrer">setup.py</a> with the key configurations noted below:</p>
  
  <pre><code>setup(
  ....
      entry_points="""
  [console_scripts]
  mycommand = mypackage.mymodule:main
  """,
  ....
  )
  </code></pre>
  
  <p>Here's a good <a href="http://github.com/jsmits/github-cli/blob/c5b4166976bbf94fc3f929cc369ce094bc02b88e/setup.py" rel="noreferrer">example</a> in context.</p>