entry()
Given a location and a metapath, return a fully-qualified Entry object or throw an error that it doesn't exist.
Industry strength
Tests now cover >80% of the codebase
Parent isn't a generator
Before, parent was returning a generator so as to facilitate for multiple parents - such as when a directory has multiple junctions. This was considered overengineering and caused superflous code throughout the library and has been distilled down to returning a single parent.
Path.set()
Path is now mutable and may be replaced/updated via a call to set(). See docstring for examples.
Suffix hints
When reading entry.text, the contents is natively unicode. Assigning the content of entry.text to an Entry object would implicitly alter its type to .string, since .string is associated with unicode.
Now, type-conversion have a hint property which may use an existing extension as hint on how to cast.
E.g. `"my string"` -> entry.text will preserve the .text suffix, whereas `True` -> entry.text will cast entry to `bool`
split() now returns suffixes
Before, split returned a pure metapath without suffixes, it is now the users responsibility to strip suffixes from split if so is required.
Suffix-independend find()
Find is supposed to "find" an entry within a directory, regardless of its suffix, and return the existing one (if one exists):
python
>>> om.find('/home/marcus', 'myentry')
'myentry.bool'
However, when a specific suffix is included, it is respected.
python
>>> om.find('/home/marcus', 'myentry.int')
None
No more name-conflicts
Prior to 0.5.3, an entry could get written under multiple suffixes:
python
om.write('/home/marcus', 'isawesome.string', 'True')
om.write('/home/marcus', 'isawesome.int', 'True')
This would produce two entries of `isawesome`, without incrementing history for the original when attempting to write to the new.
bash
$ ls
isawesome.string
isawesome.int
Names of entries MUST remain unique and so now, in 0.5.3, this is true.
python
First entry is written.
om.write('/home/marcus', 'isawesome.string', 'True')
Before writing, history is maintained for original `isawesome.string`
in addition to the original being removed.
om.write('/home/marcus', 'isawesome.int', 'True')
bash
$ ls
isawesome.int
Case-insensitivity
Open Metadata now defaults to case-insensitivity; meaning that utilities such as..
python
>>> om.find('/home/marcus', 'MynAME')
..will return identical results as..
python
>>> om.find('/home/marcus', 'myname')