forked from pro4bib/handbuch-it-in-bibliotheken
-
Notifications
You must be signed in to change notification settings - Fork 0
/
metadata.pl
executable file
·41 lines (36 loc) · 1.05 KB
/
metadata.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env perl
use v5.14;
use YAML::PP qw(LoadFile Dump);
use JSON::PP;
use utf8;
binmode( STDOUT, ":utf8" );
my ($meta) = LoadFile("metadata.yml");
my ($contributors) = LoadFile("contributors.yml");
my $cff = {
'cff-version' => '1.2.0',
url => "https://it-in-bibliotheken.de/",
type => "dataset",
title => $meta->{book}{title},
abstract => $meta->{book}{description},
license => "CC-BY-4.0",
authors => [
map {
my @names = split ' ', $_->{name};
$a = {
'family-names' => pop(@names),
'given-names' => join( ' ', @names )
};
$a->{orcid} = $_->{orcid} if $_->{orcid};
$a->{email} = $_->{email} if $_->{email};
$a;
} @{ $contributors->{contributor} }
],
# version =>
# keywords =>
# references =>
# 'date-released' =>
# identifiers =>
'repository-code' =>
"https://github.com/pro4bib/handbuch-it-in-bibliotheken"
};
say Dump($cff);