title: Clean way to perform operations like sorting, filtering and pagination in Flask
body: <p>I wish to provide below options in the rest APIs, I am writing for a flask app.</p>
  
  <ul>
  <li>Filter</li>
  </ul>
  
  <blockquote>
    <p>GET /posts?title=json-server&amp;author=typicode</p>
  </blockquote>
  
  <ul>
  <li>Paginate</li>
  </ul>
  
  <blockquote>
    <p>GET /posts?_page=7</p>
  </blockquote>
  
  <ul>
  <li>Sort</li>
  </ul>
  
  <blockquote>
    <p>GET /posts?_sort=views&amp;_order=asc</p>
  </blockquote>
  
  <ul>
  <li>Slice</li>
  </ul>
  
  <blockquote>
    <p>GET /posts?_start=20&amp;_end=30</p>
  </blockquote>
  
  <ul>
  <li>text search</li>
  </ul>
  
  <blockquote>
    <p>GET /posts?q=internet</p>
  </blockquote>
  
  <p>Although these operations are easy to implement in python, I am confused about the clean way, like using a single wrapper or response builder, to implement them.</p>
  
  <p>What should be the clean structure of implementing these operation?</p>