urlbox / urlbox-python Goto Github PK
View Code? Open in Web Editor NEWThe Urlbox Python package provides easy access to the Urlbox API and saves you from having to do this 👇
Home Page: https://urlbox.io/screenshot-api/python
License: MIT License
The Urlbox Python package provides easy access to the Urlbox API and saves you from having to do this 👇
Home Page: https://urlbox.io/screenshot-api/python
License: MIT License
e.g.
{"url":"example.com", "header":["x-my-first-header=somevalue","x-my-second-header=someothervalue"]}
should go to query string like
url=example.com&header=x-my-first-header%3Dsomevalue&header=x-my-second-header%3Dsomeothervalue
Here’s a question…
I think:
options = {"full_page": True, "width": 300}
response = urlbox_client.get(url, format=format, options=options)
is a better, clearer, more intuitive, interface than:
options = {"url": "http://example.com/", "full_page": True, "width": 300}
response = urlbox_client.get(format=format, options=options)
I mean, urlbox_client.get(url, rest_of_params…) is so clear…
CLIENT, GET a URL.
Means that the other calls the Python API implements to get to existing API parity, can be: urlbox_client.post(url, …), urlbox_client.head(url, …) etc… Something along those lines…
But it does then break slightly with how the current/ direct API works, where the url is included in the options param: https://urlbox.io/docs/getting-started
I do think it will make the python API so much clearer to have it this way…
Is that cool?
Test:
# TODO: need to get the server and client hashing working in sync
# Should test that the hexdigest of the sha256 hash of the payload passes/fails
# when the signature passed in is the correct/incorrect hexdigest respectively
# def test_call_invalid_hash():
# header_signature = f"t={timestamp_one_minute_ago},sha256={fake.pystr()}"
# with pytest.raises(InvalidHeaderSignatureError) as exception:
# webhook_validator.call(header_signature, payload, api_secret)
# assert "" in str(exception.value)
I notice that the requirements are for requests 2:26.0
I've got another library in a project which needs >= 2:28.0 so it would be good to update this if possible.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.