Skip to content

Commit

Permalink
📝 Change google docstring to reSt docstring (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
tdegeus authored Feb 7, 2024
1 parent 9305ca3 commit d114174
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions bibtexparser/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,19 @@ def parse_string(
):
"""Parse a BibTeX string.
Args:
bibtex_str (str): BibTeX string to parse
parse_stack (Optional[Iterable[Middleware]], optional): List of middleware to apply to the database after splitting. If None (default), a default stack will be used providing simple standard functionality will be used.
append_middleware (Optional[Iterable[Middleware]], optional): List of middleware to append to the default stack (ignored if a not-None parse_stack is passed).
library (Optional[Library], optional): Library to add entries to. If None (default), a new library will be created.
Returns:
Library: Parsed BibTeX database
:param bibtex_str: BibTeX string to parse
:param parse_stack:
List of middleware to apply to the database after splitting.
If ``None`` (default), a default stack will be used providing simple standard functionality.
:param append_middleware:
List of middleware to append to the default stack
(ignored if a not-``None`` parse_stack is passed).
:param library:
Library to add entries to. If ``None`` (default), a new library will be created.
:return: Library: Parsed BibTeX database
"""
splitter = Splitter(bibstr=bibtex_str)
library = splitter.split(library=library)
Expand All @@ -103,14 +108,17 @@ def parse_file(
) -> Library:
"""Parse a BibTeX file
Args:
path (str): Path to BibTeX file
parse_stack (Optional[Iterable[Middleware]], optional): List of middleware to apply to the database after splitting. If None (default), a default stack will be used providing simple standard functionality will be used.
append_middleware (Optional[Iterable[Middleware]], optional): List of middleware to append to the default stack (ignored if a not-None parse_stack is passed).
encoding: Encoding of the .bib file. Default encoding is "UTF-8".
:param path: Path to BibTeX file
:param parse_stack:
List of middleware to apply to the database after splitting.
If ``None`` (default), a default stack will be used providing simple standard functionality.
:param append_middleware:
List of middleware to append to the default stack
(ignored if a not-``None`` parse_stack is passed).
Returns:
Library: Parsed BibTeX library
:param encoding: Encoding of the .bib file. Default encoding is ``"UTF-8"``.
:return: Library: Parsed BibTeX library
"""
with open(path, encoding=encoding) as f:
bibtex_str = f.read()
Expand Down

0 comments on commit d114174

Please sign in to comment.