Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update api.py with docstring for paginate #18

Merged
merged 2 commits into from
May 20, 2023

Conversation

zlatko-minev
Copy link
Contributor

Added docstring to paginate to explain what n_max is and the function does.

    """Used for paging results of large responses using cursor paging. 
    
    OpenAlex offers two methods for paging: basic paging and cursor paging. 
    Both methods are supported by PyAlex, although cursor paging seems to be 
    easier to implement and less error-prone.

    Args:
        per_page (_type_, optional): Entries per page to return. Defaults to None.
        cursor (str, optional): _description_. Defaults to "*".
        n_max (int, optional): Number of max results (not pages) to return. 
            Defaults to 10000.

    Returns:
        CursorPaginator: Itterator
    """

Added docstring to paginate to explain what n_max is and the function does. 


        """Used for paging results of large responses using cursor paging. 
        
        OpenAlex offers two methods for paging: basic paging and cursor paging. 
        Both methods are supported by PyAlex, although cursor paging seems to be 
        easier to implement and less error-prone.

        Args:
            per_page (_type_, optional): Entries per page to return. Defaults to None.
            cursor (str, optional): _description_. Defaults to "*".
            n_max (int, optional): Number of max results (not pages) to return. 
                Defaults to 10000.

        Returns:
            CursorPaginator: Itterator
        """
@zlatko-minev zlatko-minev changed the title Update api.py Update api.py with docstring for paginate May 17, 2023
Copy link
Owner

@J535D165 J535D165 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much appreciated!

pyalex/api.py Outdated Show resolved Hide resolved
Copy link
Owner

@J535D165 J535D165 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much appreciated!

@J535D165 J535D165 merged commit 8a2c2ff into J535D165:main May 20, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants