{"action":"created","issue":{"url":"https://api.github.com/repos/okfn/jsontableschema-py/issues/28","labels_url":"https://api.github.com/repos/okfn/jsontableschema-py/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/okfn/jsontableschema-py/issues/28/comments","events_url":"https://api.github.com/repos/okfn/jsontableschema-py/issues/28/events","html_url":"https://github.com/okfn/jsontableschema-py/pull/28","id":111063893,"number":28,"title":"[wip] typecasting changes","user":{"login":"joetsoi","id":241130,"avatar_url":"https://avatars.githubusercontent.com/u/241130?v=3","gravatar_id":"","url":"https://api.github.com/users/joetsoi","html_url":"https://github.com/joetsoi","followers_url":"https://api.github.com/users/joetsoi/followers","following_url":"https://api.github.com/users/joetsoi/following{/other_user}","gists_url":"https://api.github.com/users/joetsoi/gists{/gist_id}","starred_url":"https://api.github.com/users/joetsoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joetsoi/subscriptions","organizations_url":"https://api.github.com/users/joetsoi/orgs","repos_url":"https://api.github.com/users/joetsoi/repos","events_url":"https://api.github.com/users/joetsoi/events{/privacy}","received_events_url":"https://api.github.com/users/joetsoi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-12T22:00:37Z","updated_at":"2015-10-13T08:30:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/okfn/jsontableschema-py/pulls/28","html_url":"https://github.com/okfn/jsontableschema-py/pull/28","diff_url":"https://github.com/okfn/jsontableschema-py/pull/28.diff","patch_url":"https://github.com/okfn/jsontableschema-py/pull/28.patch"},"body":"This is all currently work in progress, infer and models are broken from this.\r\n\r\n`cast` now either returns a converted value or raises an InvalidCastError, the different JTSTypes will raises different InvalidCastErrors in the exception.Heirarchy, hopefully this will give a library user more info about what when wrong as opposed to just true/false.\r\n\r\n`can_cast`/test (I'm not sure about either names `if StringType.test(value)` doesn't tell me what's happening returns True/False values\r\n\r\ncurrency symbols are now build from the 'Sc' unicode group, it still won't cover all the symbols see( https://en.wikipedia.org/wiki/Currency_symbol#List_of_presently-circulating_currency_symbols)\r\n\r\nNumbers will attempt to accept actual numbers or strings\r\n\r\nuuid module used to check uuids\r\nrfc3987 lib used to check uris\r\nwe might consider using isodate for isodates, but I've left date formatting,\r\n\r\nI've removed the DD/MM/YYYY style formats as the json table schema spec only mentions python/c style string formats\r\n\r\nfixed time parsing to return time type instead of struct_time\r\n\r\nThere is a weird edge case in the spec where a the empty string null value '' is a valid null value, but if the required constraint is set, you end up in a situation where '' counts as missing.\r\n\r\ngeojson still needs implementing.\r\nsome class variables should probably be changed to instance variables\r\nI've added a bunch of tests but I still need to fill in the remaining test cases too get higher coverage\r\nneed to remove allow ints 1 and 0 as valid boolean values (misread spec)\r\n\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/okfn/jsontableschema-py/issues/comments/147646935","html_url":"https://github.com/okfn/jsontableschema-py/pull/28#issuecomment-147646935","issue_url":"https://api.github.com/repos/okfn/jsontableschema-py/issues/28","id":147646935,"user":{"login":"pwalsh","id":791678,"avatar_url":"https://avatars.githubusercontent.com/u/791678?v=3","gravatar_id":"","url":"https://api.github.com/users/pwalsh","html_url":"https://github.com/pwalsh","followers_url":"https://api.github.com/users/pwalsh/followers","following_url":"https://api.github.com/users/pwalsh/following{/other_user}","gists_url":"https://api.github.com/users/pwalsh/gists{/gist_id}","starred_url":"https://api.github.com/users/pwalsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwalsh/subscriptions","organizations_url":"https://api.github.com/users/pwalsh/orgs","repos_url":"https://api.github.com/users/pwalsh/repos","events_url":"https://api.github.com/users/pwalsh/events{/privacy}","received_events_url":"https://api.github.com/users/pwalsh/received_events","type":"User","site_admin":false},"created_at":"2015-10-13T08:30:53Z","updated_at":"2015-10-13T08:30:53Z","body":"@joetsoi note that, as this work, we'll try to integrate `typecast` as a dep, as well as push changes down into it in co-ordination with @pudo. So, see the current date handling there (which essentially comes from messy tables): https://github.com/pudo/typecast/blob/master/typecast/formats.py\r\n\r\nSo, don't invest too much into all the various possibilities with date, just ensure that our existing functionality is kept."}}