Repository: adamgilman/furlong

Issue:
Provide a simple interface for unit conversions
Declare a unit type 

```
length = f(inches=12)

length.asCentimeters()

30.48
```

Simple and extensible 

Comments:

Patch:
diff --git a/.gitignore b/.gitignore
index 894a44c..06f9e54 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,7 +5,11 @@ __pycache__/
 
 # C extensions
 *.so
-
+bin/*
+include/*
+lib/*
+man/*
+pip-selfcheck.json
 # Distribution / packaging
 .Python
 build/
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..12231f7
--- /dev/null
+++ b/README.md
@@ -0,0 +1,34 @@
+# Hello Furlong
+Furlong aims to make units conversions easy and pythonic with a simple to understand and magical interface. Simply declare the unit and value and convert to anything you can think of. If we don't support a unit conversion, open a pull request to add it for everyone!
+
+## How it works
+Bring Furlong into your project with a simple name, f is recommended but, not required
+
+`from furlong import Furlong as f`
+
+Declare the unit and value of the base measurement
+
+`length_of_wall = f(inches=300)`
+
+Then convert to any unit you'd like!
+
+```
+length_of_wall.asCentimeters()
+30.48
+```
+
+Done!
+
+## Error handling
+
+* [TODO]
+
+## Units supported
+
+* ### Length
+    * inches
+    * centimeters
+
+* ### Volume
+
+* ### Weight
diff --git a/furlong/__init__.py b/furlong/__init__.py
new file mode 100644
index 0000000..10cb1e8
--- /dev/null
+++ b/furlong/__init__.py
@@ -0,0 +1,1 @@
+from .furlong import Furlong
\ No newline at end of file
diff --git a/furlong/furlong.py b/furlong/furlong.py
new file mode 100644
index 0000000..b23faeb
--- /dev/null
+++ b/furlong/furlong.py
@@ -0,0 +1,19 @@
+class Furlong(object):
+    conversion_table = {
+            'inches'    : ('centimeters', 2.54),
+    }
+    def __init__(self, **kwargs):
+        for key, value in kwargs.items():
+            self.unit = key
+            self.value = value
+
+        for base, conv in Furlong.conversion_table.items():
+            func_name, conv_value = Furlong.conversion_table[base]
+            func_name = "as" + func_name.title()
+            setattr(self, func_name, self._make_convertor( conv_value ))
+
+    def _make_convertor(self, conv_value):
+        def _convertor():
+            return self.value * conv_value
+        
+        return _convertor
\ No newline at end of file


Test patch:
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/tests/tests_fobject.py b/tests/tests_fobject.py
new file mode 100644
index 0000000..4196907
--- /dev/null
+++ b/tests/tests_fobject.py
@@ -0,0 +1,17 @@
+import unittest
+from furlong import Furlong as f
+
+class TestSimpleConversionTests(unittest.TestCase):
+    def test_fixed_conversion_test(self):
+        self.assertEqual( f(inches=12).asCentimeters(), 30.48 )
+
+
+class TestDyanmicFunctionNaming(unittest.TestCase):
+    def test_dyanmic_function_exists(self):
+        test_conv = {
+            'testbase'    : ('testconv', -1111),
+        }
+        f.conversion_table.update( test_conv )
+        self.assertIsInstance( f(testbase=1), f )
+        self.assertTrue( callable( f(testbase=1).asTestconv ) )
+        self.assertEqual( f(testbase=2).asTestconv(), -2222 )
\ No newline at end of file