No project description provided
Project description
Web Valueist
Fetches a value from the web, compares it with a given value and exits with zero exit code if the condition is satisfied
Setup
While in project directory:
./install.sh
Installation
You can install web-valueist from PyPI using your preferred package manager:
pip:
pip install web-valueist
Poetry:
poetry add web-valueist
uv:
uv pip install web-valueist
pipenv:
pipenv install web-valueist
Usage:
web_valueist [-h] [--debug] [--json] url parser_name [quantifier] selector operator_name value
positional arguments:
url
parser_name
quantifier Optional: ANY or EVERY (default: ANY)
selector
operator_name
value
options:
-h, --help show this help message and exit
--debug Show debug logs including found values
--json Output input and result as JSON
Sample Usage
By default, web_valueist is silent and communicates success or failure via the exit code.
Sample success
python -m web_valueist https://www.ikea.com.cy/en/products/fjallhavre-duvet-warm-240x220-cm/70458057/ int span.price__integer ">" 240
( you can also use gt instead of ">")
Exit Code: 0
Sample failure
python -m web_valueist https://www.ikea.com.cy/en/products/fjallhavre-duvet-warm-240x220-cm/70458057/ int span.price__integer "<" 240
( you can also use lt instead of "<")
Exit Code: 1
Debugging
Use the --debug flag to see the values fetched from the web.
python -m web_valueist https://www.ikea.com.cy/en/products/fjallhavre-duvet-warm-240x220-cm/70458057/ int span.price__integer ">" 240 --debug
Output:
DEBUG:web_valueist.lib:Found value ['245']
JSON Output
Use the --json flag to get a structured output.
python -m web_valueist http://example.com str h1 "eq" "Example Domain" --json
Output:
{"args": {"url": "http://example.com", "parser_name": "str", "quantifier": "ANY", "selector": "h1", "operator_name": "eq", "value": "Example Domain"}, "result": {"success": true, "value": "Example Domain"}}
Using Quantifiers
When a selector matches multiple elements, you can use ANY or EVERY.
- ANY (default): At least one selector match needs to satisfy the condition.
- EVERY: All selector matches need to satisfy the condition.
Example using EVERY:
python -m web_valueist https://example.com int EVERY .price ">" 100
If no quantifier is specified, ANY is used by default.
Sample cron job
*/30 * * * * web_valueist "https://www.bazaraki.com/car-motorbikes-boats-and-parts/cars-trucks-and-vans/mazda/mazda-mx5/year_min---71/?ordering=cheapest&lat=35.01804869361969&lng=34.04709596563199&radius=5000&price_max=30000" int .advert__content-price._not-title "<" 22500 &&message="Some fancy car matching your criteria was found" &&if command -v notify-send >/dev/null 2>&1 ; then notify-send "$message"; else say "$message"; fi
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file web_valueist-1.0.0.tar.gz.
File metadata
- Download URL: web_valueist-1.0.0.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b64aa7ab757c7495e9a63441e0a2ef4f641679be058d3228fa3ceaac881e84e8
|
|
| MD5 |
89464f1171e565523c8cfd9c9e994222
|
|
| BLAKE2b-256 |
356fb572a1490f65cbb856da6f8c25e0f3c4d4add68d0a3adb9786a33d4eda1f
|
Provenance
The following attestation bundles were made for web_valueist-1.0.0.tar.gz:
Publisher:
pypi-publish.yml on agalazis/web-valueist
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
web_valueist-1.0.0.tar.gz -
Subject digest:
b64aa7ab757c7495e9a63441e0a2ef4f641679be058d3228fa3ceaac881e84e8 - Sigstore transparency entry: 1154317764
- Sigstore integration time:
-
Permalink:
agalazis/web-valueist@b2d8c458437b5f6728605c33d92ec1c44f5b7e7f -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/agalazis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@b2d8c458437b5f6728605c33d92ec1c44f5b7e7f -
Trigger Event:
release
-
Statement type:
File details
Details for the file web_valueist-1.0.0-py3-none-any.whl.
File metadata
- Download URL: web_valueist-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4dfb58e9267e4066e94b7da2c030eb4e18f9fbb54c87fe271d23d05d365c8f1a
|
|
| MD5 |
9738e7df7b1331e833b4dd5a4a4f00af
|
|
| BLAKE2b-256 |
c2d94cd464aeb386e2aa6f13443317f1b03ababad828f2c1e78324b81db0536e
|
Provenance
The following attestation bundles were made for web_valueist-1.0.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on agalazis/web-valueist
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
web_valueist-1.0.0-py3-none-any.whl -
Subject digest:
4dfb58e9267e4066e94b7da2c030eb4e18f9fbb54c87fe271d23d05d365c8f1a - Sigstore transparency entry: 1154317766
- Sigstore integration time:
-
Permalink:
agalazis/web-valueist@b2d8c458437b5f6728605c33d92ec1c44f5b7e7f -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/agalazis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@b2d8c458437b5f6728605c33d92ec1c44f5b7e7f -
Trigger Event:
release
-
Statement type: