Browse files

Add readme, update docs

  • Loading branch information...
1 parent d10cd14 commit e15a093578fa0be8ab54d768b11b09fc95ae297e @bdarnell committed Jun 19, 2012
Showing with 75 additions and 3 deletions.
  1. +1 −0 MANIFEST.in
  2. +35 −0 README.rst
  3. +38 −3 docs/index.rst
  4. +1 −0 setup.py
View
1 MANIFEST.in
@@ -1 +1,2 @@
include LICENSE.txt
+include README.rst
View
35 README.rst
@@ -0,0 +1,35 @@
+CodeGenLoader
+=============
+
+CodeGenLoader is a Python import hook that transparently runs a code
+generator at import time, allowing the use of generated code without
+a separate compilation step. The package includes an extensible base
+class as well as implementations for the Protocol Buffer and
+Thrift code generators.
+
+Installation
+------------
+
+::
+
+ pip install codegenloader
+
+Prerequisites
+-------------
+
+CodeGenLoader runs on Python 2.5, 2.6, 2.7, pypy, and Jython. The base
+class does not have any external dependencies, but to use the Thrift or
+Protocol Buffer subclasses you will need the thrift or protobuf packages
+installed.
+
+Example
+-------
+
+Add the following two lines to `mypackage/proto/__init__.py`::
+
+ import codegenloader.protobuf
+ __path__ = codegenloader.protobuf.make_path(__name__, ".")
+
+Now, assuming `foo.proto` exists in in `mypackage/proto/`, you can do::
+
+ from mypackage.proto.foo_pb2 import Foo
View
41 docs/index.rst
@@ -1,5 +1,41 @@
-codegenloader Documentation
-===========================
+CodeGenLoader
+=============
+
+CodeGenLoader is a Python import hook that transparently runs a code
+generator at import time, allowing the use of generated code without
+a separate compilation step. The package includes an extensible base
+class as well as implementations for the Protocol Buffer and
+Thrift code generators.
+
+Installation
+------------
+
+::
+
+ pip install codegenloader
+
+Prerequisites
+-------------
+
+CodeGenLoader runs on Python 2.5, 2.6, 2.7, pypy, and Jython. The base
+class does not have any external dependencies, but to use the Thrift or
+Protocol Buffer subclasses you will need the thrift or protobuf packages
+installed.
+
+Example
+-------
+
+Add the following two lines to `mypackage/proto/__init__.py`::
+
+ import codegenloader.protobuf
+ __path__ = codegenloader.protobuf.make_path(__name__, ".")
+
+Now, assuming `foo.proto` exists in in `mypackage/proto/`, you can do::
+
+ from mypackage.proto.foo_pb2 import Foo
+
+Detailed docs
+-------------
.. toctree::
@@ -13,4 +49,3 @@ Indices and tables
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
-
View
1 setup.py
@@ -17,4 +17,5 @@
"codegenloader.test": ["thrift/simple.thrift"],
},
author="Ben Darnell",
+ url="https://github.com/bdarnell/codegenloader",
)

0 comments on commit e15a093

Please sign in to comment.