Name | restfull JSON |
Version |
1.0.13
JSON |
| download |
home_page | None |
Summary | Python REST API Frontend |
upload_time | 2024-10-30 15:59:37 |
maintainer | None |
docs_url | None |
author | Michael Minichino |
requires_python | <4,>=3.8 |
license | None |
keywords |
utilities
rest
api
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# restfull 1.0.13
## Installing
```
$ pip install restfull
```
# Usage Examples
Basic API GET:
```
auth = BasicAuth("username", "password")
rest = RestAPI(auth, "example.com")
endpoint = "/api/users/1"
data = rest.get(endpoint).validate().as_json().record()
assert data.get("data", {}).get("id") == 1
```
Get record with paged API (specifically getting page 2)
```
auth = BasicAuth("username", "password")
rest = RestAPI(auth, "example.com")
endpoint = "/api/users"
data = rest.get_by_page(endpoint, page=2).validate().as_json("data").list_item(2)
assert data.get("id") == 9
```
Get all records from paged API (assumes records are in an array assigned to the "data" key):
```
auth = BasicAuth("username", "password")
rest = RestAPI(auth, "example.com")
endpoint = "/api/users"
data = rest.get_paged(endpoint).validate().json_list()
assert data.size == 12
```
Raw data
{
"_id": null,
"home_page": null,
"name": "restfull",
"maintainer": null,
"docs_url": null,
"requires_python": "<4,>=3.8",
"maintainer_email": null,
"keywords": "utilities, rest, api",
"author": "Michael Minichino",
"author_email": "info@unix.us.com",
"download_url": "https://files.pythonhosted.org/packages/92/d8/103c73be283eb0763f1abf71b11d1680ce0459a0f02e40d05b3859ad1816/restfull-1.0.13.tar.gz",
"platform": null,
"description": "# restfull 1.0.13\n\n## Installing\n```\n$ pip install restfull\n```\n\n# Usage Examples\n\nBasic API GET:\n```\nauth = BasicAuth(\"username\", \"password\")\nrest = RestAPI(auth, \"example.com\")\nendpoint = \"/api/users/1\"\ndata = rest.get(endpoint).validate().as_json().record()\nassert data.get(\"data\", {}).get(\"id\") == 1\n```\n\nGet record with paged API (specifically getting page 2)\n```\nauth = BasicAuth(\"username\", \"password\")\nrest = RestAPI(auth, \"example.com\")\nendpoint = \"/api/users\"\ndata = rest.get_by_page(endpoint, page=2).validate().as_json(\"data\").list_item(2)\nassert data.get(\"id\") == 9\n```\n\nGet all records from paged API (assumes records are in an array assigned to the \"data\" key):\n```\nauth = BasicAuth(\"username\", \"password\")\nrest = RestAPI(auth, \"example.com\")\nendpoint = \"/api/users\"\ndata = rest.get_paged(endpoint).validate().json_list()\nassert data.size == 12\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Python REST API Frontend",
"version": "1.0.13",
"project_urls": {
"Homepage": "https://github.com/mminichino/restfull"
},
"split_keywords": [
"utilities",
" rest",
" api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "eb3688e7b120a21df24dbcb124fc15cb4a64d86457d24c18e64ca7bbae461e54",
"md5": "64cd394d67b469a986d12e77e1b88e10",
"sha256": "bb2831d594b991585bbc464db1fb5fe1d17168c945bc031d29562e91c4b0a826"
},
"downloads": -1,
"filename": "restfull-1.0.13-py3-none-any.whl",
"has_sig": false,
"md5_digest": "64cd394d67b469a986d12e77e1b88e10",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4,>=3.8",
"size": 8066,
"upload_time": "2024-10-30T15:59:35",
"upload_time_iso_8601": "2024-10-30T15:59:35.748476Z",
"url": "https://files.pythonhosted.org/packages/eb/36/88e7b120a21df24dbcb124fc15cb4a64d86457d24c18e64ca7bbae461e54/restfull-1.0.13-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "92d8103c73be283eb0763f1abf71b11d1680ce0459a0f02e40d05b3859ad1816",
"md5": "b2f10f56780d09cef5fc0b93f160e370",
"sha256": "b6a62941bbf73b43abee1cb33bbc8f84f82ae5e1ed751c1ecc6cec69ddd6c1e8"
},
"downloads": -1,
"filename": "restfull-1.0.13.tar.gz",
"has_sig": false,
"md5_digest": "b2f10f56780d09cef5fc0b93f160e370",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4,>=3.8",
"size": 7229,
"upload_time": "2024-10-30T15:59:37",
"upload_time_iso_8601": "2024-10-30T15:59:37.225271Z",
"url": "https://files.pythonhosted.org/packages/92/d8/103c73be283eb0763f1abf71b11d1680ce0459a0f02e40d05b3859ad1816/restfull-1.0.13.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-30 15:59:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mminichino",
"github_project": "restfull",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "restfull"
}