{"id":16672826,"url":"https://github.com/brcontainer/html2canvas-python-proxy","last_synced_at":"2025-04-09T19:53:22.170Z","repository":{"id":17768968,"uuid":"20631524","full_name":"brcontainer/html2canvas-python-proxy","owner":"brcontainer","description":"Python Proxy for html2canvas work with Django, Flask and CGI","archived":false,"fork":false,"pushed_at":"2017-10-03T21:53:49.000Z","size":24,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-23T21:51:55.208Z","etag":null,"topics":["html2canvas","html2canvas-proxy","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brcontainer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-09T01:56:51.000Z","updated_at":"2024-11-16T21:22:29.000Z","dependencies_parsed_at":"2022-09-05T05:21:09.092Z","dependency_job_id":null,"html_url":"https://github.com/brcontainer/html2canvas-python-proxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brcontainer%2Fhtml2canvas-python-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brcontainer%2Fhtml2canvas-python-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brcontainer%2Fhtml2canvas-python-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brcontainer%2Fhtml2canvas-python-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brcontainer","download_url":"https://codeload.github.com/brcontainer/html2canvas-python-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103914,"owners_count":21048245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html2canvas","html2canvas-proxy","python"],"created_at":"2024-10-12T12:07:26.560Z","updated_at":"2025-04-09T19:53:22.156Z","avatar_url":"https://github.com/brcontainer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"html2canvas-python-proxy 0.1.0\n========================\n\nPython Proxy for html2canvas (tested in Python 2.7.3)\n\nAlthough I have just added an example with \"Flask\" is library works with any \"Python Web framework.\" Soon I'll add examples with other frameworks.\n\n### Others scripting language ###\n\nYou do not use PHP, but need html2canvas working with proxy, see other proxies:\n\n* [html2canvas proxy in php](https://github.com/brcontainer/html2canvas-php-proxy)\n* [html2canvas proxy in asp.net (csharp)](https://github.com/brcontainer/html2canvas-csharp-proxy)\n* [html2canvas proxy in asp classic (vbscript)](https://github.com/brcontainer/html2canvas-asp-vbscript-proxy)\n\n### Provisional documentation:\n\nModule | Description\n--- | ---\n`html2canvasproxy([callback get param], [url get param])` | Config html2canvasproxy\n`html2canvasproxy.enable_crossdomain()` | Enable the use of [\"Data URI scheme\"](http://en.wikipedia.org/wiki/Data_URI_scheme)\n`html2canvasproxy.useragent([user agent])` | Config webbrowser user-agent\n`html2canvasproxy.hostname([url])` | Config current URL (requires scheme and port)\n`html2canvasproxy.referer([referer])` | Config referer page (If needed)\n`html2canvasproxy.route([real path], [virtual path])` | Config \"route\" for images and real path (folder to save images). Note: \"real path\" is absolute path eg. `/home/user/project1/images`, \"virtual path\" should be as you want it to appear in the \"address bar\", eg. `/images`\n`html2canvasproxy.debug_vars()` | Get variables values for DEBUG\n`html2canvasproxy.result()` | Run proxy/Get response and mime-type by proxy.\n`html2canvasproxy.resource([real path], [image])` | Get resource saved and mime-type by proxy \"real path\" is same in `html2canvas.route([real path], [virtual path])`. Read [Get resources with proxy](https://github.com/brcontainer/html2canvas-python-proxy#get-results-with-proxy)\n\n### How to use\nA simple example of usage\n\n```python\nfrom html2canvasproxy import * #Load html2canvasproxy\n\n#Set GET variables\nh2c = html2canvasproxy(request.args.get(\"callback\"), request.args.get(\"url\"))\n\n#Uncomment next line to enable \"data URI scheme\" (optional)\n#h2c.enable_crossDomain()\n\n#Set user-aget browser\nif request.headers['user_agent']:\n    h2c.useragent(request.headers['user_agent'])\nelse:\n    h2c.useragent('Mozilla/5.0')\n\n#Set current page\nh2c.hostname(request.url)\n\n#Set referer (If needed)\nif request.referer:\n    h2c.referer(request.referer)\n\n#Set route (real path and virtual path)\nh2c.route('/home/guilherme/projects/site/images', '/images')\n\n#Results\nprint 'Debug:'\nprint h2c.debug_vars()\nprint '---------'\n\nresult = h2c.result()\n\nprint 'mime: ' + result['mime']\nprint 'data: ' + result['data']\nprint '=========\\n'\n```\n\n### Get results with proxy\nRun proxy/Get response and mime-type by proxy (returns `application/javascript`)\n\n```python\nr = h2c.result()\n\nprint r['mime']\nprint r['data']\n```\n\n### Get resources with proxy\nGet resource saved and mime-type by proxy (returns images or html)\n\n```python\nres = html2canvasproxy.resource(real_path, image)\n\nprint res['mime']\nprint res['data']\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrcontainer%2Fhtml2canvas-python-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrcontainer%2Fhtml2canvas-python-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrcontainer%2Fhtml2canvas-python-proxy/lists"}