# drequests
declare network request
- Works with requests
- Inspired by [uplink](https://github.com/prkumar/uplink)
- more simple and flixible
just like uplink did, use Github API v3 for example:
```python
from declareq.arguments import Path, Query, UrlPrefix
from declareq.builder import Consumer
from declareq.commands import get
class Github(Consumer):
'''github v3 api'''
def __init__(self, _: UrlPrefix):
pass
@get("/users/{user}/repos")
def get_repos(self, user: Path, sort_by: Query("sort") = "created"):
'''get github repos of user'''
github = Github("https://api.github.com")
github.get_repos("prkumar", sort_by="created")
```
Raw data
{
"_id": null,
"home_page": "https://github.com/wangxiaochuang/declareq",
"name": "declareq",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6.0",
"maintainer_email": null,
"keywords": null,
"author": "wangxiaochuang",
"author_email": "jackstrawxiaoxin@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e4/d3/bcf14893dcd0c76776e4cde8cfd7596dbbb7fc28798133b421dcd74f5c64/declareq-0.1.10.tar.gz",
"platform": null,
"description": "\n# drequests\n\ndeclare network request\n\n- Works with requests\n- Inspired by [uplink](https://github.com/prkumar/uplink)\n- more simple and flixible\n\njust like uplink did, use Github API v3 for example:\n\n```python\nfrom declareq.arguments import Path, Query, UrlPrefix\nfrom declareq.builder import Consumer\nfrom declareq.commands import get\n\n\nclass Github(Consumer):\n '''github v3 api'''\n\n def __init__(self, _: UrlPrefix):\n pass\n\n @get(\"/users/{user}/repos\")\n def get_repos(self, user: Path, sort_by: Query(\"sort\") = \"created\"):\n '''get github repos of user'''\n\n\ngithub = Github(\"https://api.github.com\")\ngithub.get_repos(\"prkumar\", sort_by=\"created\")\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "declare http request over requests",
"version": "0.1.10",
"project_urls": {
"Homepage": "https://github.com/wangxiaochuang/declareq"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "304d6edd6162460b4e3e6ea68e31b96a8810bdc3a620a3589e30b8c9a91d3c87",
"md5": "6672ea1fee1c20da53dca91e168436c6",
"sha256": "d8f8fca2b5276b95ab546d4a6f6ab2387809ef4cd05766551be4345356596a8e"
},
"downloads": -1,
"filename": "declareq-0.1.10-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "6672ea1fee1c20da53dca91e168436c6",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.6.0",
"size": 10211,
"upload_time": "2024-08-23T08:45:30",
"upload_time_iso_8601": "2024-08-23T08:45:30.917576Z",
"url": "https://files.pythonhosted.org/packages/30/4d/6edd6162460b4e3e6ea68e31b96a8810bdc3a620a3589e30b8c9a91d3c87/declareq-0.1.10-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e4d3bcf14893dcd0c76776e4cde8cfd7596dbbb7fc28798133b421dcd74f5c64",
"md5": "058307dd6dd9e43dbe592cf706feb915",
"sha256": "f62a85311890550b87aa06a3cf6d8c68a356f83c00325e8a503c95089fa53b57"
},
"downloads": -1,
"filename": "declareq-0.1.10.tar.gz",
"has_sig": false,
"md5_digest": "058307dd6dd9e43dbe592cf706feb915",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6.0",
"size": 9901,
"upload_time": "2024-08-23T08:45:32",
"upload_time_iso_8601": "2024-08-23T08:45:32.595876Z",
"url": "https://files.pythonhosted.org/packages/e4/d3/bcf14893dcd0c76776e4cde8cfd7596dbbb7fc28798133b421dcd74f5c64/declareq-0.1.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-23 08:45:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "wangxiaochuang",
"github_project": "declareq",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "declareq"
}