A highly user-friendly, kid-friendly automation framework using Chrome DevTools Protocol (CDP).
Project description
pyquality 🎈
A kid-friendly, yet exceptionally powerful automation framework for Python driven directly by the Chrome DevTools Protocol (CDP).
pyquality is designed to be as simple as possible. Want to close the browser? Just call b.bye(). Want to navigate? b.go_to("https://...")
Under the hood, it retains uncompromising power. Advanced users have unfiltered access to all 40+ raw Chromium DevTools domains (DOM, Network, Page, etc.) auto-generated from the official Google spec!
🚀 Installation (Source)
If you are developing locally:
git clone https://github.com/santoshtvk-new/Pyquality.git
cd pyquality
pip install -e .
🛠️ Installation (PIP)
(When published to PyPi)
pip install pyquality
📖 Quick Start
from pyquality.browser import Browser
# 1. Start it up
b = Browser(headless=False)
# 2. Go somewhere
b.go_to("https://example.com")
# 3. Validation is easy
b.should_be_seen("h1")
# 4. Say goodbye
b.bye()
✨ The Kid-Friendly Aliases
pyquality dynamically binds methods defined in METHOD_ALIASES.yml so you can use vocabulary that makes sense to you.
Navigation
navigate(url)->go_to,open_websitereload()->refresh,reload_pageclose()->close_browser,byego_back()->step_back,previous_pagego_forward()->step_forward,next_page
Interaction
click_element(selector)->click_this,taptype_text(selector, text)->type_in,write_thishover_element(selector)->point_at,hover_over
APIs & Data
API.get(endpoint)->fetch_data,grabAPI.post(endpoint, json)->create_data,send_new
⚡ Raw CDP Power (Advanced)
If you need capabilities beyond the simple wrappers, pyquality has raw auto-generated bindings for EVERY CDP Domain. They are attached natively to the browser instance:
from pyquality.browser import Browser
b = Browser()
# Use raw 'Page' domain to capture a PDF
b.page.printToPDF()
# Use raw 'Network' domain to throttle connection
b.network.emulateNetworkConditions(
offline=False,
latency=200,
downloadThroughput=1000,
uploadThroughput=1000
)
# Use raw 'DOM' domain to get node information
b.dom.getDocument(depth=-1)
📦 Deploying Initial PIP Package
To package this framework and upload it to PyPi:
-
Install build tools:
pip install build twine
-
Generate Native Wrappers: Ensure your CDP protocol bindings are up-to-date:
python src/pyquality/generate_cdp_wrappers.py -
Build wheels:
python -m build
This generates
.tar.gzand.whlfiles in the/distfolder. -
Upload to PyPi (Requires Account):
python -m twine upload dist/*
-
Done! Users can now run
pip install pyquality.
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 py4quality-0.1.0.tar.gz.
File metadata
- Download URL: py4quality-0.1.0.tar.gz
- Upload date:
- Size: 68.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dec2f55d2280ae43389daeed6588c20657c99c0ac81670009fe2d66c1528713d
|
|
| MD5 |
d0ad810477727c7ab43d5c5550a4ff4e
|
|
| BLAKE2b-256 |
80613296a33d49afde4dd124ff257ad6662a8403d89e7f94b10f801e2ad120da
|
File details
Details for the file py4quality-0.1.0-py3-none-any.whl.
File metadata
- Download URL: py4quality-0.1.0-py3-none-any.whl
- Upload date:
- Size: 86.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa8513a8d8a415ab4990ad593e5d57c1d666562d0e0ac0144bca6fbe565df984
|
|
| MD5 |
5e47e9ab0100f1a6aff95c32a076df10
|
|
| BLAKE2b-256 |
3186de27119fe3e05ee22238b351f4620042a3b891f6459f2648cc4a45f08c1d
|