DSL for Django
Project description
django-dsl
==========
|Licence| |Version|
+------------------+--------------------+
| Status | Operating system |
+==================+====================+
| |Build_Status| | Linux x86\_64 |
+------------------+--------------------+
Requirements
------------
- PLY
- Django
Installation
------------
::
pip install django-domain-specific-language
Usage
-----
Allows you to search by specifying the name of the column of the
database.
Characters allowed:
* Key (column name) : `A-Za-z0-9_.`
* Value : A-Za-z0-9_~*.^$?{}[]|!\/+-éèàû
Query Parser Syntax:
* Wildcard Searches: *
* *\test : All that ends by test
* test\* : All that starts by test
* *\test\* : All that contains test
* `Regex`_ Searches: ~
* ~\W+ : Matches any character which is not a word character.
* Boolean Operators: AND OR NOT
* Grouping: ( )
Example
-------
Your database:
.. figure:: https://raw.githubusercontent.com/treussart/django-dsl/master/example-db.png
:alt: DB image
DB image
The possible researches:
* Country:India AND Product:Ice-cream
* Country:\*a\* AND NOT Product:~.*e$
In your code:
::
from django_dsl.run import compile
result = compile(request.GET['expression'])
.. _Regex: https://docs.python.org/3/library/re.html
.. |Build_Status| image:: https://travis-ci.org/treussart/django-dsl.svg?branch=master
:target: https://travis-ci.org/treussart/django-dsl
.. |Version| image:: https://img.shields.io/github/tag/treussart/django-dsl.svg
.. |Licence| image:: https://img.shields.io/github/license/treussart/django-dsl.svg
==========
|Licence| |Version|
+------------------+--------------------+
| Status | Operating system |
+==================+====================+
| |Build_Status| | Linux x86\_64 |
+------------------+--------------------+
Requirements
------------
- PLY
- Django
Installation
------------
::
pip install django-domain-specific-language
Usage
-----
Allows you to search by specifying the name of the column of the
database.
Characters allowed:
* Key (column name) : `A-Za-z0-9_.`
* Value : A-Za-z0-9_~*.^$?{}[]|!\/+-éèàû
Query Parser Syntax:
* Wildcard Searches: *
* *\test : All that ends by test
* test\* : All that starts by test
* *\test\* : All that contains test
* `Regex`_ Searches: ~
* ~\W+ : Matches any character which is not a word character.
* Boolean Operators: AND OR NOT
* Grouping: ( )
Example
-------
Your database:
.. figure:: https://raw.githubusercontent.com/treussart/django-dsl/master/example-db.png
:alt: DB image
DB image
The possible researches:
* Country:India AND Product:Ice-cream
* Country:\*a\* AND NOT Product:~.*e$
In your code:
::
from django_dsl.run import compile
result = compile(request.GET['expression'])
.. _Regex: https://docs.python.org/3/library/re.html
.. |Build_Status| image:: https://travis-ci.org/treussart/django-dsl.svg?branch=master
:target: https://travis-ci.org/treussart/django-dsl
.. |Version| image:: https://img.shields.io/github/tag/treussart/django-dsl.svg
.. |Licence| image:: https://img.shields.io/github/license/treussart/django-dsl.svg
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file django_domain_specific_language-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: django_domain_specific_language-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5852cacbd484449d90b6144a4e8b781e1a11d1ed6389798f0888b1b632bc2b4b |
|
MD5 | f5e26ebda577e2edd7c945cc2e71ef0c |
|
BLAKE2b-256 | d90eae8f3b530ff6aeab56d759d2864419e25afaa1bc4a1e7e812c15e25458ba |