odata-pretty-printer
Pretty printer for OData filter expressions.
This is an example of using oppen-pretty-print to create a pretty-printer for OData filter expressions.
This is not a robust program, just a bench tool that's used occasionally to pretty-print complex OData filters that would otherwise be unreadable. The input filter is expected to be grammatically correct, just untidy. Pretty error reporting is non-existent!
Usage
pip install odata-pretty-printer
odata-printer "ShowOnSite eq true and PublicationDate le 2020-04-29T08:49:33Z \
and PublicationDate ge 2019-04-29T08:49:33Z and ChannelId eq 23 \
and (ExpiryDate eq null or ExpiryDate ge 2020-04-29T08:49:33Z) and \
IsAdvisor eq true and (FundCodeList/any(fundcode: fundcode eq 'ITSMT') \
or SectorCodeList/any(sectorcode: sectorcode eq 'T:IG') \
or GroupCodeList/any(groupcode: groupcode eq 'BAIL'))"
odata-printer -f tmp/filter_example.txt
Output:
ShowOnSite eq true
and PublicationDate le 2020-04-29T08:49:33Z
and PublicationDate ge 2019-04-29T08:49:33Z
and ChannelId eq 23
and (ExpiryDate eq null or ExpiryDate ge 2020-04-29T08:49:33Z)
and IsAdvisor eq true
and (FundCodeList/any(fundcode: fundcode eq 'ITSMT')
or SectorCodeList/any(sectorcode: sectorcode eq 'T:IG')
or GroupCodeList/any(groupcode: groupcode eq 'BAIL'))
Documentation
Head over to the README for more details.
Contributing
The source code for odata-pretty-printer is available on GitHub. If you find a bug or something is unclear, we encourage you to raise an issue. We also welcome contributions, to contribute, fork the repository and open a pull request.
Metadata
Release files for odata-pretty-printer 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| odata-pretty-printer-0.1.1.tar.gz | 6.9 kB | Without provenance | Details for odata-pretty-printer-0.1.1.tar.gz |
Release files / odata-pretty-printer-0.1.1.tar.gz
| Download URL | odata-pretty-printer-0.1.1.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e4e8a0b8547190003e35e875a4397c64a719961d53a4d3a4be8d64a4854ff726
|
|
BLAKE2b-256 checksum How to use checksums |
d780ec55bf48c842e0a6e02088e94250eb4071701ae2a803b72e4f23154f9464
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.3.1.post20200515 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|
Security for odata-pretty-printer 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.