#author #metadata #parse

cargo_author

Parse author fields (name <email> (url)) used by Cargo and npm

6 stable releases

1.0.7 Dec 8, 2023
1.0.6 Sep 3, 2022
1.0.4 Feb 1, 2021
1.0.2 Apr 18, 2019
1.0.0 Jun 15, 2018

#16 in #author

Download history 52/week @ 2023-11-02 29/week @ 2023-11-09 82/week @ 2023-11-16 143/week @ 2023-11-23 63/week @ 2023-11-30 71/week @ 2023-12-07 68/week @ 2023-12-14 46/week @ 2023-12-21 49/week @ 2023-12-28 87/week @ 2024-01-04 38/week @ 2024-01-11 33/week @ 2024-01-18 40/week @ 2024-01-25 42/week @ 2024-02-01 81/week @ 2024-02-08 289/week @ 2024-02-15

456 downloads per month
Used in 6 crates (4 directly)

Apache-2.0 OR MIT

7KB
109 lines

Parse authors in Cargo.toml and similar

This parses names in the format Name <email> (url) used in Cargo.toml metadata (also in npm).

This crate tries to parse any field in any order and to fix common errors to salvage as much data as possible.

To read the authors key from Cargo.toml you'll need cargo_toml crate. Once you have the author names, parse them by calling Author::new(string).


lib.rs:

Extract structured information from authors fields used in Cargo.toml

It's tweaked to handle actual odd/broken cases found in Cargo crates.

Strings are normalized to Unicode NFC, since some tools tend to insert decomposed names that expose rendering bugs in software.

Dependencies

~3.5–5MB
~107K SLoC