Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single records must be called with an iterator #11

Open
mrmiguez opened this issue Mar 14, 2018 · 1 comment
Open

Single records must be called with an iterator #11

mrmiguez opened this issue Mar 14, 2018 · 1 comment

Comments

@mrmiguez
Copy link
Owner

In [2]: rec = pymods.MODSReader('FSU_ARHHouse_1018.xml')

In [3]: rec.
rec.close                      rec.makeelement
rec.copy                      rec.resolvers
rec.error_log                rec.setElementClassLookup
rec.feed                       rec.set_element_class_lookup
rec.feed_error_log        rec.target
rec.iterator                  rec.version

In [3]: mods = next(rec)

In [4]: mods.tag
Out[4]: '{http://www.loc.gov/mods/v3}mods'
@mrmiguez
Copy link
Owner Author

Implementing __index__ and __len__ would allow for testing reader size. Reader could return next(obj) if it's len is 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant