New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fastapi-lowlevel-pagination

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastapi-lowlevel-pagination

A fastapi lowlevel pagination system

  • 0.0.1
  • PyPI
  • Socket score

Maintainers
1

Fast Pagination

Description

A lowlevel, fast and easy to use package for creating and managing your own pagination system while FastAPI.

Keeping the pagination system simple was the main goal of this package.
You provide your own database querying logic and the pagination system will handle the rest.

Example

Imports

import fast_pagination as pg

Routes

@router.get(..., response_model=pg.generate_response_schema(SomeModel))
async def some_route(
    pagination: pg.Pagination[SomeModel] = Depends(
        pg.get_pagination_dependency(offset_kwargs={...},
                                     limit_kwargs={...},
                                     filter_kwargs={...})
    ),
    ...  # additional route dependencies goes here
):
    return await pagination.paginate(
        func=db_query_func,
        ...  # func kwargs goes here
    )

Services

async def db_query_func(page_request: PageRequest, **extra_kwargs) -> dict:
    ...  # db query logic goes here

    return {
        'results': results,
        'total_items': total_items
    }

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc