Adding fields in order

93 views
Skip to first unread message

Geoffrey Spear

unread,
Aug 1, 2012, 9:11:58 AM8/1/12
to pym...@googlegroups.com
Before creating a fork and trying to implement this myself, I thought I'd ask for confirmation that I'm not missing something...

Is it possible to add new fields to a pymarc.Record and have them placed in the correct order in the record, rather than at the end? (I'm looking for functionality like perl MARC::Record's 
insert_fields_ordered() function).

--
Geoffrey Spear
Metadata Manager
Health Sciences Library System
University of Pittsburgh

Mark A. Matienzo

unread,
Aug 1, 2012, 9:19:29 AM8/1/12
to pym...@googlegroups.com
Hi Geoffrey,

On Wed, Aug 1, 2012 at 9:11 AM, Geoffrey Spear <geoff...@gmail.com> wrote:
> Is it possible to add new fields to a pymarc.Record and have them placed in
> the correct order in the record, rather than at the end? (I'm looking for
> functionality like perl MARC::Record's
> insert_fields_ordered() function).

What do you mean by "the correct order"? To my knowledge, there isn't
an comparable method to MARC::Record's insert_field_ordered()
function, which if I recall correctly depends on the
insert_fields_before() function.

Mark A. Matienzo <ma...@matienzo.org>
Digital Archivist, Manuscripts and Archives, Yale University Library
Technical Architect, ArchivesSpace

Geoffrey Spear

unread,
Aug 1, 2012, 9:39:28 AM8/1/12
to pym...@googlegroups.com
On Wed, Aug 1, 2012 at 9:19 AM, Mark A. Matienzo
<mark.m...@gmail.com> wrote:
> Hi Geoffrey,
>
> On Wed, Aug 1, 2012 at 9:11 AM, Geoffrey Spear <geoff...@gmail.com> wrote:
>> Is it possible to add new fields to a pymarc.Record and have them placed in
>> the correct order in the record, rather than at the end? (I'm looking for
>> functionality like perl MARC::Record's
>> insert_fields_ordered() function).
>
> What do you mean by "the correct order"? To my knowledge, there isn't
> an comparable method to MARC::Record's insert_field_ordered()
> function, which if I recall correctly depends on the
> insert_fields_before() function.

For instance, in the project I'm working on at the moment, I'm loading
MARC records from a file and adding an 050 field to each record. I'd
like them to appear after the 049 field and before the 060 (for
example; the fields vary in each record), rather than at the end of
the record, i.e., where our catalogers would put them manually if I
hadn't offered to try to automate this :).

Mark A. Matienzo

unread,
Aug 1, 2012, 10:40:47 AM8/1/12
to pym...@googlegroups.com
On Wed, Aug 1, 2012 at 9:39 AM, Geoffrey Spear <geoff...@gmail.com> wrote:

> For instance, in the project I'm working on at the moment, I'm loading
> MARC records from a file and adding an 050 field to each record. I'd
> like them to appear after the 049 field and before the 060 (for
> example; the fields vary in each record), rather than at the end of
> the record, i.e., where our catalogers would put them manually if I
> hadn't offered to try to automate this :).

Yes, in that case there's no way to do that out of the box. The code
in MARC::Record seems like it wouldn't be terribly difficult to port,
and if you've got the time/resources, we'd love to see a patch with
tests. If not, I can't guarantee how soon we'd get to it.

Mark
Reply all
Reply to author
Forward
0 new messages