tryggvib/datapackage — pull request #17 by jhamrick (2014-08-12 06:14:29+00:00)
Title: [WIP] Resource object

I am working on developing a separate class specifically for resources, which will handle things like smart loading of data files depending on their type (e.g. json, csv, etc.), as well as computing file size and hash and verifying those are consistent when the data is loaded.

This is still a work in progress, but I figured I would commit what I had so you could see what I've been working on. So far:

* I realized that `sources` and `licenses` are pretty much identical properties both for the whole datapackage and for individual resources. So, I moved the relevant code into two new files for sources and licenses specifically, so that the datapackage and resource objects can share that code.

* The resources object will behave a lot like the datapackage object, I think. Currently it just has a bunch of getters, as well as some methods to compute the file size and md5 hash.

* Currently the resources object isn't actually being used anything, but I think when it is ready it will be able to replace the `get_resources` method of the `DataPackage` class. That is, rather than returning a dictionary of resources, it will return a list of `Resource` objects (or maybe a dictionary, to make it easier to access resources by name).

This pull request relies on #15 and #16 so github is listing all those commits here, but when those are merged or dealt with then I'll rebase so this pull request only includes the relevant commits (as of right now, 01e53b6 and on).