Skip to content

Simple filtering, sorting and pagination from query strings

License

Notifications You must be signed in to change notification settings

gabriel-schneider/pyqurl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple query string parser for LHS filtering, sorting and pagination. This project is directly based on Qurl by Hector Carballo (https://github.com/hector-co/Qurl).

Installing

$ pip install pyqurl

Usage

from pyqurl import create_query_from_string

# Name contains "john"
create_query_from_string("name[ct]=john")

# Price is greater than 20
create_query_from_string("price[gt]=20")

# Disabled_at is not null
create_query_from_string("disabled_at[nn]=true")

# Year is between 2020 and 2022
create_query_from_string("year[rng]=2020,2022")

# Color is equal to yellow
create_query_from_string("color[eq]=yellow")
# Same result if the operator is not present
create_query_from_string("color=yellow")

# Category is drama, romance or comecy
create_query_from_string("category[in]=drama,romance,comedy")

# Category is not horror or action
create_query_from_string("category[nin]=horror,action")

About

Simple filtering, sorting and pagination from query strings

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages