main.python_writers¶
Classes¶
PythonWriters ¶
Bases: BasicInput
Python writers for generating BibTeX files with various formatting options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
options | dict[str, Any] | Configuration options for BibTeX generation. - is_sort_entry_fields (bool): Whether to sort entry fields (default: True) - is_sort_blocks (bool): Whether to sort bibliography blocks (default: True) - sort_entries_by_field_keys_reverse (bool): Reverse sort order for entries (default: True) - choose_abbr_zotero_save (str): Source selection - "abbr", "zotero", or "save" (default: "save") | required |
Attributes:
| Name | Type | Description |
|---|---|---|
choose_abbr_zotero_save | str | Selected bibliography purpose ("abbr", "zotero", or "save") |
bib_name_for_abbr | str | Filename for abbreviated bibliography (default: "abbr.bib") |
bib_name_for_zotero | str | Filename for Zotero bibliography (default: "zotero.bib") |
bib_name_for_save | str | Filename for saved bibliography (default: "save.bib") |
join_flag_in_http | str | The join flag for HTTP-related formatting (default: " | " or " |\n") |
display_www_google_connected_scite | list[str] | Display options selection from ["www", "google", "connected", "scite"] |
bibtex_format_indent | str | Indentation string for BibTeX formatting (default: " ") |
bibtex_format_trailing_comma | bool | Whether to include trailing commas in BibTeX entries (default: True) |
bibtex_format_block_separator | str | Separator between BibTeX blocks (default: "") |
Source code in pybibtexer/main/python_writers.py
Functions¶
write_to_file ¶
write_to_file(
original_data,
file_name,
write_flag="w",
path_storage=None,
check=True,
delete_first_empty=True,
delete_last_empty=True,
compulsory=False,
delete_original_file=False,
)
Write.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
original_data | Union[Library, list[Block], list[str]] | data | required |
file_name | str | file name | required |
write_flag | str = "w" | write flag | 'w' |
path_storage | Optional[str] = None | path storage | None |
check | bool = True | check | True |
delete_first_empty | bool = True | delete first empty | True |
delete_last_empty | bool = True | delete last empty | True |
compulsory | bool = False | compulsory | False |
delete_original_file | bool = False | delete original file | False |