bids2cite package

Submodules

bids2cite.authors module

Deal with authors.

bids2cite.authors.affiliation_from_orcid(orcid_record: dict[str, Any]) str | None[source]

Get affiliation the most recent employment (top of the list).

bids2cite.authors.authors_for_citation(authors: list[dict[str, str | None]]) list[dict[str, str | None]][source]

Return authors formatted for citation.cff.

bids2cite.authors.authors_for_desc(authors: list[dict[str, str | None]]) list[str][source]

Return authors formatted for dataset_description.json.

bids2cite.authors.choose_from_new_authors(authors_file: Path, author_idx: int) dict[str, str | None][source]

Choose author from new authors file.

bids2cite.authors.display_new_authors(authors_file: Path | None = None) int[source]

Display new authors from authors file.

bids2cite.authors.first_name_from_orcid(orcid_record: dict[str, Any]) str[source]

Return first name from ORCID record.

bids2cite.authors.get_author_info_from_orcid(orcid: str) dict[str, Any][source]

Get author info from ORCID.

bids2cite.authors.last_name_from_orcid(orcid_record: dict[str, Any]) str[source]

Return last name from ORCID record.

bids2cite.authors.manually_add_author() str[source]

Manually add author.

bids2cite.authors.parse_author(author: str) dict[str, str | None][source]

Parse author string to get first name, last name, affiliation and ORCID.

bids2cite.authors.rm_empty_authors(authors: list[dict[str, str | None]]) list[dict[str, str | None]][source]

Remove empty authors.

bids2cite.authors.update_authors(ds_desc: dict[str, Any], skip_prompt: bool = False, authors_file: Path | None = None) list[dict[str, str | None]][source]

Update authors.

bids2cite.bids2cite module

Add a datacite to your BIDS dataset.

details on the format of datacite for GIN: https://gin.g-node.org/G-Node/Info/wiki/DOIfile

class bids2cite.bids2cite.MuhParser(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=<class 'argparse.HelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True)[source]

Bases: ArgumentParser

Parser for the main script.

bids2cite.bids2cite.bids2cite(bids_dir: Path, output_format: str, description: str | None = None, keywords: list[str] | None = None, license: str | None = None, skip_prompt: bool = False, authors_file: Path | None = None) None[source]

Create a datacite.yml file for a BIDS dataset.

bids2cite.bids2cite.cli(argv: Any = ['/home/docs/checkouts/readthedocs.org/user_builds/bids2cite/envs/stable/lib/python3.8/site-packages/sphinx/__main__.py', '-T', '-E', '-b', 'html', '-d', '_build/doctrees', '-D', 'language=en', '.', '_build/html']) None[source]

Execute the main script for CLI.

bids2cite.bids2cite.common_parser() MuhParser[source]

Execute the main script.

bids2cite.bids2cite.update_bidsignore(bids_dir: Path) None[source]

Update the .bidsignore file.

bids2cite.bids2cite.update_description(description: str | None = None, skip_prompt: bool = False) str[source]

Update the description of the dataset.

bids2cite.bids2cite.update_funding(ds_desc: dict[str, Any], skip_prompt: bool = False) list[str][source]

Update the funding of the dataset.

bids2cite.bids2cite.update_keywords(keywords: list[Any] | None = None, skip_prompt: bool = False) list[str][source]

Update the keywords of the dataset.

bids2cite.license module

Deals with license information.

bids2cite.license.add_license_file(license_type: str, output_dir: Path) None[source]

Add a license file to the dataset directory.

bids2cite.license.identify_license(ds_desc: dict[str, Any]) tuple[str, str][source]

Identify the license of the dataset.

bids2cite.license.manually_add_license(bids_dir: Path, output_dir: Path, ds_desc: dict[str, Any], skip_prompt: bool = False) tuple[str, str][source]

Prompt user for what license to add.

bids2cite.license.supported_licenses() dict[str, dict[str, str | list[str | None]]][source]

Return a list of supported licenses.

bids2cite.license.update_license(bids_dir: Path, output_dir: Path, ds_desc: dict[str, Any], skip_prompt: bool = False, force: bool = False) tuple[str, str][source]

Update the license of the dataset.

bids2cite.references module

Deal with references.

bids2cite.references.get_reference_details(reference: str) dict[str, str][source]

Get reference details.

bids2cite.references.get_reference_id(reference: str) str[source]

Find the reference DOI or PMID.

bids2cite.references.get_reference_info_from_doi(doi: str) dict[str, Any] | None[source]

Get reference info from DOI.

bids2cite.references.get_reference_info_from_pmid(pmid: str) None | dict[str, Any][source]

Get reference info from PubMed.

bids2cite.references.references_for_citation(references: list[dict[str, str]]) list[dict[str, str]][source]

Return authors formatted for citation.cff files.

bids2cite.references.references_for_datacite(references: list[dict[str, str]]) list[str][source]

Return authors formatted for datacite files.

bids2cite.references.update_references(ds_desc: dict[str, Any], skip_prompt: bool = False) list[dict[str, str]][source]

Update references based on dataset description.

bids2cite.utils module

Misc.

bids2cite.utils.bids2cite_log(name: str | None = None) logging.Logger[source]

Create log.

Parameters

name (_type_, optional) – _description_, defaults to None

Returns

_description_

Return type

_type_

bids2cite.utils.default_log_level() str[source]

Return default log level.

bids2cite.utils.log_levels() list[str][source]

Return a list of log levels.

bids2cite.utils.print_ordered_list(msg: str, items: list[Any]) None[source]

Print an unordered list.

bids2cite.utils.prompt_format(msg: str) str[source]

Format prompt message.

Module contents