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

Handle tags in an order-preserving manner #128

Open
UmbrellaDish opened this issue Jan 31, 2019 · 2 comments
Open

Handle tags in an order-preserving manner #128

UmbrellaDish opened this issue Jan 31, 2019 · 2 comments

Comments

@UmbrellaDish
Copy link

As your code reads and we experienced in tests, entries for the tag file are parsed into a dictionary. As the IETF recommendation reads, however ...

The "bag-info.txt" file is a tag file that contains metadata elements
describing the bag and the payload. The metadata elements contained
in the "bag-info.txt" file are intended primarily for human use. All
metadata elements are OPTIONAL and MAY be repeated. Because "bag-
info.txt" is intended for human reading and editing, ordering MAY be
significant and the ordering of metadata elements MUST be preserved.

Source: BagIt File Format Specification, v1.0

..., contents of that file, by the way being for human-use only should be saved in an order-preserving tuple, so for instance as to enable users to save multiple organizations where each requires a bunch of metadata items which in consequence will have to be kept together in a bunch. Otherwise, with strict alphabetical ordering as it is now, you cannot know with certainty which Source-Organization, Organization-Address, Contact-Email etc. belongs to each other.

@acdha
Copy link
Member

acdha commented Jan 31, 2019

This is only true when running on Python 2. We could have a patch which switches to collections.OrderedDict on Python 2.7 but there's an argument which says we should just say anyone who needs this should upgrade to Python since 2.x has an end of life coming soon anyway.

@UmbrellaDish
Copy link
Author

UmbrellaDish commented Feb 1, 2019 via email

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

2 participants