Metadata-Version: 2.1
Name: playwright-apirequest-builder
Version: 1.0.0
Summary: Playwright APIRequest builder
Home-page: https://github.com/w13b3/playwright-apirequest-builder
Author: Wiebe
Author-email: wiebe@email.com
License: Mozilla Public License Version 2.0
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Typing :: Typed
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8.0, <4
Description-Content-Type: text/markdown
License-File: LICENSE


:performing_arts: [Playwright] [APIRequest] builder
===

[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)


Documented
---
Read it here [:link: documentation](./doc)  
Read more about the _builder pattern_ on [:link: refactoring.guru](https://refactoring.guru/design-patterns/builder/python/example#lang-features)


Example
---

```python
# sync example
from playwright.sync_api import sync_playwright
from playwright_request.sync_builder import RequestBuilder

with sync_playwright() as p:
    builder = RequestBuilder(p, base_url='https://playwright.dev/')
    request = builder.get("python/docs/intro").create_request()
    response = request()
    print(response.text())
```

```python
# async example
import asyncio
from playwright.async_api import async_playwright
from playwright_request.async_builder import RequestBuilder

async def main():
    async with async_playwright() as p:
        builder = RequestBuilder(p, base_url='https://playwright.dev/')
        request = builder.get("python/docs/intro").create_request()
        response = await request()
        print(await response.text())

asyncio.run(main())
```


Requirements
---
Python3  
Playwright >= 1.26.0


[Playwright]: https://playwright.dev/python/
[APIRequest]: https://playwright.dev/python/docs/api/class-apirequest
[`max_redirects`]: https://playwright.dev/python/docs/api/class-apirequestcontext#api-request-context-delete-option-max-redirects
