Command Line Interface¶
The euring CLI exposes decode/validate/lookup helpers plus JSON dumps and format conversion.
Commands:
decodeDecode a EURING record string.validateValidate a EURING record and return errors only.lookupLook up EURING codes (ringing_scheme, species, place).dumpDump one or more code tables as JSON.convertConvert EURING2000, EURING2000+, and EURING2020 records.
Examples:
# Decode a EURING record
euring decode "DERA0CD...5206514ZZ1877018770N0ZUFF02U-----120719760----SV55+584200+01348000101030100202301739"
# Decode a EURING record as JSON (includes a _meta.generator block)
euring decode --json --pretty "DERA0CD...5206514ZZ1877018770N0ZUFF02U-----120719760----SV55+584200+01348000101030100202301739"
# Validate a EURING record (errors only)
euring validate "ESA|A0|Z.....6408|1|4|ZZ|12430|12430|N|0|Z|U|U|U|0|0|U|--|--|-|11082006|0|----|ES14|+420500-0044500|0|0|99|0|4|00280|241|00097|63.5||U|10|U|U|||||||||3|E||0|||||||||"
# Validate a file of EURING records
euring validate --file euring_records.psv
# Look up codes (verbose by default)
euring lookup place GR83
# Short lookup output
euring lookup place GR83 --short
# Lookup output as JSON (includes a _meta.generator block)
euring lookup --json --pretty place GR83
# Dump code tables as JSON (includes a _meta.generator block)
euring dump --pretty age
# Dump all code tables to a directory
euring dump --all --output-dir ./code_tables
# Convert records between EURING2000, EURING2000+, and EURING2020
euring convert --to euring2020 "DERA0CD...5206501ZZ1877018770N0ZUFF22U-----081019710----DECK+502400+00742000820030000000000000"
euring convert --from euring2020 --to euring2000plus --force "GBB|A0|1234567890|0|1|ZZ|00010|00010|N|0|M|U|U|U|2|2|U|01012024|0|0000|AB00||A|9|99|0|4|00000|000|00000|||||52.3760|4.9000||"
euring convert --file euring_records.txt --to euring2020 --output converted_records.txt
# Decode a file of EURING records to JSON (enriched output)
euring decode --file euring_records.txt --json --output decoded_records.json
Options:
decode--jsonOutput JSON instead of text.--prettyPretty-print JSON output (use with--json).--formatForce format:euring2000,euring2000plus, oreuring2020.--fileRead records from a text file.--outputWrite output to a file.validate--jsonOutput JSON instead of text.--prettyPretty-print JSON output (use with--json).--formatForce format:euring2000,euring2000plus, oreuring2020.--fileRead records from a text file.--outputWrite output to a file.lookup--shortShow concise output.--jsonOutput JSON instead of text.--prettyPretty-print JSON output (use with--json).convert--fromSource format (optional):euring2000,euring2000plus, oreuring2020.--toTarget format:euring2000,euring2000plus, oreuring2020(default:euring2020).--forceAllow lossy mappings when downgrading fromeuring2020.--fileRead records from a text file.--outputWrite converted output to a file.dump--outputWrite JSON to a file.--output-dirDirectory to write JSON code tables.--prettyPretty-print JSON output.--forceOverwrite existing files.--allDump all code tables (requires--output-dir).
JSON structure¶
decode --json (single record) returns:
{
"record": {
"format": "EURING2000+"
},
"fields": {
"ringing_scheme": {"name": "Ringing Scheme", "value": "ESA", "order": 0},
"primary_identification_method": {"name": "Primary Identification Method", "value": "A0", "order": 1}
},
"errors": {
"record": [],
"fields": []
},
"_meta": {
"generator": {"name": "euring", "version": "X.Y.Z", "url": "https://github.com/observation/euring"}
}
}
decode --file --json returns:
{
"records": [/* decode --json objects */],
"_meta": {"generator": {"name": "euring", "version": "X.Y.Z", "url": "https://github.com/observation/euring"}}
}
validate --json returns:
{
"format": "EURING2000+",
"errors": {"record": [], "fields": []},
"_meta": {"generator": {"name": "euring", "version": "X.Y.Z", "url": "https://github.com/observation/euring"}}
}