-
Notifications
You must be signed in to change notification settings - Fork 13
Technical Design
Holly Becker edited this page Jan 11, 2016
·
3 revisions
-
Store information in a sqlite DB (possibly in memory) to make querying for an object/metadata easier
-
Allow for lazy parsing so we don't have to load the whole file into memory and keep it there
-
Original discussion here https://docs.google.com/document/d/1hJ9KrmnpRU-aQBD07dC7n21njN1bwYq-MxK0RUpHhV0/edit# (Access restricted)
For attributes directly corresponding to XML elements, use python style naming (rights_basis) or XML style (rightsBasis) ?
- Python
-
- consistent with python styling
-
- consistent with anything that doesn’t directly map to elements
-
- inconsistent with the actual XML, have to do mental mapping between the two
- XML
-
- easy to see relation between attribute and originating tag
-
- mismatches with rest of python code
Access things via dict (foo[‘value’]) or by attribute (foo.value) ?
- dict-style
-
- use .get(value, None) to get default values if it may not exist
-
- easier to give access to (probably using dict internally anyway, just use wrapper for
__get__
)
- easier to give access to (probably using dict internally anyway, just use wrapper for
- attribute
-
- less typing
-
- probably harder to populate (maybe use @property?)