Skip to content

Commit 9ce785c

Browse files
committed
add github build ci workflow
1 parent 2ae66cc commit 9ce785c

3 files changed

Lines changed: 35 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
id-token: write
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.11"
21+
22+
- run: python -m pip install --upgrade build
23+
- run: python -m build

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# ScreenshotMAX Python SDK
22

3+
[![build](https://github.com/screenshotmax/python-sdk/actions/workflows/build.yml/badge.svg)](https://github.com/screenshotmax/python-sdk/actions/workflows/build.yml)
34
[![test](https://github.com/screenshotmax/python-sdk/actions/workflows/test.yml/badge.svg)](https://github.com/screenshotmax/python-sdk/actions/workflows/test.yml)
45

56
This is the official Python SDK for the [ScreenshotMAX API](https://screenshotmax.com/).
@@ -18,19 +19,23 @@ Use the SDK to generate signed or unsigned URLs for screenshots, PDFs, web scrap
1819
### Screenshot example
1920
```python
2021
from screenshotmax import SDK
22+
from screenshotmax.enum import ImageFormat
2123
from screenshotmax.options import ScreenshotOptions
2224

2325
sdk = SDK("<ACCESS_KEY>", "<SECRET_KEY>")
2426

2527
# set up options
26-
opts = ScreenshotOptions(url="https://example.com")
27-
sdk.screenshot.set_options(opts)
28+
opts = ScreenshotOptions(
29+
url="https://example.com",
30+
format=ImageFormat.PNG
31+
)
2832

29-
#// generate URL (https://api.screenshotmax.com/v1/screenshot?url=https%3A%2F%2Fexample.com&image_width=1280&image_height=720&format=png&image_quality=80&access_key=<ACCESS_KEY>&signature=370f5b161bc59eed13b76........1f778635d7fc595dbab12)
30-
url = sdk.screenshot.get_url()
33+
# fetch screenshot (chaining method)
34+
result, headers = sdk.screenshot.set_options(opts).fetch()
3135

32-
# generate screenshot
33-
result, headers = sdk.screenshot.fetch()
36+
# optionnaly: generate signed URL
37+
# (https://api.screenshotmax.com/v1/screenshot?url=https%3A%2F%2Fexample.com&format=png&access_key=<ACCESS_KEY>&signature=370f5b161bc59eed13b76........1f778635d7fc595dbab12)
38+
url = sdk.screenshot.get_url()
3439
```
3540

3641
### Web scraping example

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "screenshotmax"
7-
version = "1.0.1"
7+
version = "1.0.0"
88
description = "Official Python SDK for ScreenshotMAX API"
99
readme = "README.md"
1010
requires-python = ">=3.9"

0 commit comments

Comments
 (0)