stripe/stripe-python — pull request #51 by narced133 (2013-12-02 09:42:05+00:00)
Title: WIP: Refactor of Python bindings

On recent planes and trains I've undertaken to refactor the Python bindings to make them more readable and maintainable. The primary changes are to:

* Improve testing with unit tests and further functional tests
* Make the code more Pythonic in structure and PEP8 compliant
* Abstract out HTTP client logic
* Make `StripeObject` a dict subclass and expunge direct access to `__dict__`

The goal was to avoid making significant backwards incompatible changes so that this wouldn't need to be a major version change. Several things were deprecated but the only incompatibilities should be:

* The `to_dict` and `values` methods on resources no longer recursively convert objects to plain dicts (but objects are now themselves dicts).
* The `previous_metadata` attribute on resources is now private.
* Timezone aware `datetime` objects passed to the API will now be encoded in a way that does not depend on the local system time. This may change the value passed to the API.

Questions for the reviewer:

* Are you happy with the delineation between modules?
* Are you concerned about any of the backwards incompatible changes? (especially w.r.t. TZ aware datetimes)

There are some outstanding items:

- [ ] Refactor, deprecate or remove `bin/stripe`
- [ ] Extend functional test coverage to 100% of resources
- [ ] Implement integration test for app engine urlfetch
- [ ] Implement unit test for Pycurl
- [ ] Unit test `http_client.new_default_http_client` fallback logic