Publishing on PyPI
diff --git a/.gitignore b/.gitignore
index 54885c871d..93c5066e1b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,6 +17,10 @@ ben_cairo_test.py
 media
 manim.sublime-project
 manim.sublime-workspace
+.eggs/
+build/
+dist/
+manim.egg-info/
 
 primes.py
 /media_dir.txt
diff --git a/.travis.yml b/.travis.yml
index 9cb9f96324..528f4b889a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,4 +14,12 @@ before_script:
   # exit-zero treats all errors as warnings.  The GitHub editor is 127 chars wide
   - flake8 manimlib/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
 script:
-  - true  # add other tests here
+  - python setup.py test
+  - python setup.py bdist_wheel
+deploy:
+  provider: pypi
+  user: swegener
+  on:
+    tags: true
+  password:
+    secure: ONfT0jmsqfoYzxg6U7o0tRRxK9pa7dEhN4LS79Li1+ZjJx5zw+aQMzGwSteFmZSnLEzGM1fldXbr18VOKxtjL+TYt8c/FvsZAoWVhabDesh1coO/Jp22LTXc7G9jHXef2Q8RInhyUdwVFopySv5xBgWUXZAVK8wabVbbxhqQyHUbM4Ag1lvHPIAylTPCeYptVhBUNM5Q6E7D4BnmScOM5eo/H8t3QGCDh0SNKjw9hD8ySBEFREwu+IBnu8c8ZIqcdFb8VYA0tccsMBSlTOLsVnxmMfHyZWmZb83NAO6cwZknoMPntRzTpF1Gk9cWrfMU0eHMymaqMACPxGgfyCiBx/VSP/5fCx7DQK7ZVygsiq3CuKD5PqyplDqqwpvfHQ/U+MLUedJqIINi6P1yHZLUF+cP/KYsWHz9vMumoGxQ5IuF8kUgmTl5e0mrYG9cKEVmgtPI+WBjVM1ZY9nkGf1t0SBptZT+cLoPi92+m5+QlPLc/6+cOvMBuU+vUYRqRTJpnXRs6CZcbtIAO9GKPrDAcLRpX7MMvkDnG4dLapX4Lig3BFH9hCXnsBtNXz+qc7qnG8HJqZ2Acv0GuFYUn5qFirUXIsmVotFCh9lqVX47L8hl5bZYeY8/g3wXPOhZ5np2XSKztun8kq2Wnz0TLwxNTC4InPGr9jFp01QK08ihtw8=
diff --git a/README.md b/README.md
index cb0596c023..7df99e8c9c 100644
--- a/README.md
+++ b/README.md
@@ -6,30 +6,32 @@
 Manim is an animation engine for explanatory math videos. It's used to create precise animations programmatically, as seen in the videos at [3Blue1Brown](https://www.3blue1brown.com/).
 
 ## Installation
-Manim runs on python 3.7. You can install the Python requirements with
-`python3 -m pip install -r requirements.txt`. System requirements are
-[cairo](https://www.cairographics.org), [ffmpeg](https://www.ffmpeg.org), [sox](http://sox.sourceforge.net), [latex](https://www.latex-project.org) (optional, if you want to use LaTeX).
+Manim runs on python 3.7. You can install it from PyPI via pip
 
-### Directly
-Clone this repository and in that directory execute:
 ```sh
-# Install python requirements
-python3 -m pip install -r requirements.txt
+pip3 install manimlib
+```
 
-# Try it out
-python3 -m manim example_scenes.py SquareToCircle -pl
+System requirements are [cairo](https://www.cairographics.org), [ffmpeg](https://www.ffmpeg.org), [sox](http://sox.sourceforge.net), [latex](https://www.latex-project.org) (optional, if you want to use LaTeX).
+
+You can now use it via the `manim` command. For example:
+
+```sh
+manim my_project.py MyScene
 ```
 
-### Installing into your system
-For the previous "direct" method you always have to have this git repository. alternatively you can install it permanently in your system and run it on your own scene files:
+For more options, take a look at the “Using manim“ sections further below.
+
+### Directly
+
+If you want to hack on manimlib itself, clone this repository and in that directory execute:
 
 ```sh
-# Inside repository - Install manim (also installs Python requirements)
-python3 -m pip install .
+# Install python requirements
+python3 -m pip install -r requirements.txt
 
-# Now you don't need the repository anymore and can run it in other directories
-cd anywhere
-manim.py example_scenes.py SquareToCircle -pl
+# Try it out
+python3 -m manim example_scenes.py SquareToCircle -pl
 ```
 
 ### Directly (Windows)
diff --git a/manim.py b/manim.py
index dfcc45ff7f..2f659056b2 100644
--- a/manim.py
+++ b/manim.py
@@ -1,17 +1,7 @@
 #!/usr/bin/env python
-import manimlib.config
-import manimlib.extract_scene
-import manimlib.stream_starter
+import manimlib
 
 if __name__ == "__main__":
-    args = manimlib.config.parse_cli()
-    if not args.livestream:
-        config = manimlib.config.get_configuration(args)
-        manimlib.extract_scene.main(config)
-    else:
-        manimlib.stream_starter.start_livestream(
-            to_twitch=args.to_twitch,
-            twitch_key=args.twitch_key,
-        )
+    manimlib.main()
 else:
     manimlib.stream_starter.start_livestream()
diff --git a/manimlib/__init__.py b/manimlib/__init__.py
new file mode 100644
index 0000000000..3d3d6490d0
--- /dev/null
+++ b/manimlib/__init__.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+import manimlib.config
+import manimlib.extract_scene
+import manimlib.stream_starter
+
+
+def main():
+    args = manimlib.config.parse_cli()
+    if not args.livestream:
+        config = manimlib.config.get_configuration(args)
+        manimlib.extract_scene.main(config)
+    else:
+        manimlib.stream_starter.start_livestream(
+            to_twitch=args.to_twitch,
+            twitch_key=args.twitch_key,
+        )
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000000..2b2b8391e8
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,20 @@
+[metadata]
+name = manimlib
+author = Grant Sanderson
+author-email= grant@3blue1brown.com
+summary = Animation engine for explanatory math videos
+description-file = README.md
+description-content-type = text/markdown; charset=UTF-8
+home-page = https://github.com/3b1b/manim
+project_urls =
+    Bug Tracker = https://github.com/3b1b/manim/issues
+    Documentation = https://github.com/3b1b/manim
+    Source Code = https://github.com/3b1b/manim
+license = MIT
+
+[files]
+packages = manimlib
+
+[entry_points]
+console_scripts =
+    manim = manimlib:main
\ No newline at end of file
diff --git a/setup.py b/setup.py
index 301b274291..aa2d8a0194 100644
--- a/setup.py
+++ b/setup.py
@@ -1,25 +1,8 @@
-from setuptools import setup, find_namespace_packages
+#!/usr/bin/env python
 
+from setuptools import setup
 
-setup(name='manim',
-      version='0.1.0',
-      description='Animation engine for explanatory math videos',
-      author='Grant Sanderson',
-      author_email='grant@3blue1brown.com',
-      url='https://github.com/3b1b/manim',
-      license='MIT',
-      packages=find_namespace_packages(),
-      install_requires=[
-         'colour',
-         'numpy',
-         'Pillow',
-         'progressbar',
-         'scipy',
-         'tqdm',
-         'opencv-python',
-         'pycairo',
-         'pydub',
-      ],
-      scripts=['manim.py', 'stage_scenes.py'],
-      package_data={'manimlib': ['*.tex', 'files/**']},
+setup(
+    setup_requires=['pbr'],
+    pbr=True,
 )

These changes enable **automatic publishing of manim** to http://pypi.org. You just need to set a **git tag** - that's it!

```
git tag v0.1.4
git push --tags
```
(I've created some tags to test while developing this feature, so the version on PyPI is now on v0.1.3)

It does so by using the "deploy" task of travis. To demonstrate it, I've checked in the credentials of my PyPI account. It probably won't work after merging, since the credentials are encrypted for my travis account. Please, tell me your PyPI user accounts, so I'll give you full owner permissions for https://pypi.org/project/manimlib/ (@eulertour , @3b1b).

After creating your accounts, please install travis-cli and login

```
sudo gem install travis
travis login
```

Then, change the travis section to add your credentials, by executing this inside the project directory:

```
travis encrypt your-password-here --add deploy.password
```

(More exhaustive documentation at https://docs.travis-ci.com/user/deployment/pypi/)

Also note that I made some changes to `setup.py`. I'm using [pbr](https://docs.openstack.org/pbr/latest/). It automatically sets the right version of the package by looking at the git tags. Also, it uses the `requirements.txt` file, so we don't need to maintain a second dependency list inside `setup.py`

<s>The big_ol_pile_of_manim_imports was moved in large parts to `manimlib/shortcuts.py`. The "scripts" section in setup.py is meant to be for scripts you can use from the command line and can't be used to import stuff from. So I needed to move the shortcuts inside the manimlib package. To maintain compatibility, I'm importing in the big_ol_pile everything from `manimlib/shortcuts.py`</s>

Just saw that you created `manimlib/imports.py`. I'm removing my shortcuts, give me a second.