# CRUDs
[![Python appliction](https://github.com/johnbrandborg/cruds/workflows/Python%20application/badge.svg)](https://github.com/johnbrandborg/cruds/actions?query=workflow%3A%22Python+application%22)
[![PyPI version](https://badge.fury.io/py/cruds.svg)](https://pypi.org/project/cruds/)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=johnbrandborg_cruds&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=johnbrandborg_cruds)
CRUDs is a simple high level library for Humans, inspired by [Python Requests](https://requests.readthedocs.io/en/latest/)
```python
>>> import cruds
>>> catfact_ninja = cruds.Client(host="https://catfact.ninja/")
>>> data = catfact_ninja.read("fact")
```
Interact with RESTful API using Create, Read, Update and Delete requests.
Focus on using Python data types instead of worrying about serialization.
Authentication, timeouts, retries, and rate limit back-off are all built in
and can be adjusted.
### Installation
You can install the client using PIP like so.
```bash
pip install cruds
```
### Logging
If you want to see logging set the level using the standard logging interface.
DEBUG will show you URLLib3, but INFO will give you general information from
the cruds.
``` python
>>> import logging
>>> import cruds
>>> logging.basicConfig(level=logging.INFO)
```
### Extensibility
The library has been created with extensibility in mind. You can Sub Class Client
for example and add the logic requirements needed to make the requests.
```python
from cruds import Client
class CatFactNinja(Client):
"""Cat Fact Ninja Interface"""
_fact_uri = "fact"
def __init__(self, **kwargs):
host = "http://catfact.ninja/"
super().__init__(host=host, **kwargs)
@property
def fact(self):
""" Get a Fact about Cats"""
return self.read(self._fact_uri)
cat = CatFactNinja()
print(cat.fact)
```
## Todo List
- [ ] OAuth Client for Authentication
## License
cruds is released under the MIT License. See the bundled LICENSE file for details.
## Credits
* [URLLib3 Team](https://github.com/urllib3)
Raw data
{
"_id": null,
"home_page": "https://github.com/johnbrandborg/cruds",
"name": "cruds",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "rest api crud http https",
"author": "John Brandborg",
"author_email": "john.brandborg+pypi@pm.me",
"download_url": "https://files.pythonhosted.org/packages/af/44/35581df20ea1b4bc9a8007485bae03bf6d2cc83cd5ec28a7fb1a34258b53/cruds-1.0.2.tar.gz",
"platform": "unix",
"description": "# CRUDs\n[![Python appliction](https://github.com/johnbrandborg/cruds/workflows/Python%20application/badge.svg)](https://github.com/johnbrandborg/cruds/actions?query=workflow%3A%22Python+application%22)\n[![PyPI version](https://badge.fury.io/py/cruds.svg)](https://pypi.org/project/cruds/)\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=johnbrandborg_cruds&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=johnbrandborg_cruds)\n\nCRUDs is a simple high level library for Humans, inspired by [Python Requests](https://requests.readthedocs.io/en/latest/)\n\n```python\n>>> import cruds\n>>> catfact_ninja = cruds.Client(host=\"https://catfact.ninja/\")\n>>> data = catfact_ninja.read(\"fact\")\n```\n\nInteract with RESTful API using Create, Read, Update and Delete requests.\nFocus on using Python data types instead of worrying about serialization.\nAuthentication, timeouts, retries, and rate limit back-off are all built in\nand can be adjusted.\n\n### Installation\n\nYou can install the client using PIP like so.\n\n```bash\npip install cruds\n```\n\n### Logging\n\nIf you want to see logging set the level using the standard logging interface.\nDEBUG will show you URLLib3, but INFO will give you general information from\nthe cruds.\n\n``` python\n>>> import logging\n>>> import cruds\n>>> logging.basicConfig(level=logging.INFO)\n```\n\n### Extensibility\n\nThe library has been created with extensibility in mind. You can Sub Class Client\nfor example and add the logic requirements needed to make the requests.\n\n```python\nfrom cruds import Client\n\nclass CatFactNinja(Client):\n \"\"\"Cat Fact Ninja Interface\"\"\"\n\n _fact_uri = \"fact\"\n\n def __init__(self, **kwargs):\n host = \"http://catfact.ninja/\"\n super().__init__(host=host, **kwargs)\n\n @property\n def fact(self):\n \"\"\" Get a Fact about Cats\"\"\"\n return self.read(self._fact_uri)\n\ncat = CatFactNinja()\nprint(cat.fact)\n```\n\n## Todo List\n- [ ] OAuth Client for Authentication\n\n## License\ncruds is released under the MIT License. See the bundled LICENSE file for details.\n\n## Credits\n* [URLLib3 Team](https://github.com/urllib3)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "CRUDs is a simple high level library for Humans, inspired by Python Requests",
"version": "1.0.2",
"project_urls": {
"Homepage": "https://github.com/johnbrandborg/cruds",
"Source": "https://github.com/johnbrandborg/cruds",
"Tracker": "https://github.com/johnbrandborg/cruds/issues"
},
"split_keywords": [
"rest",
"api",
"crud",
"http",
"https"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "807a1476293dbb4c89c970b75a8b6b627fe24980ee0ecdf5010563f0ff60e4c3",
"md5": "b12265ed1505ea169ee33236e92d1d9f",
"sha256": "08b59e276da4632be800a1b167f0b1f2523e8b8fef0b24a802fd5fac26533afd"
},
"downloads": -1,
"filename": "cruds-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b12265ed1505ea169ee33236e92d1d9f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 8724,
"upload_time": "2024-04-11T19:50:22",
"upload_time_iso_8601": "2024-04-11T19:50:22.320949Z",
"url": "https://files.pythonhosted.org/packages/80/7a/1476293dbb4c89c970b75a8b6b627fe24980ee0ecdf5010563f0ff60e4c3/cruds-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "af4435581df20ea1b4bc9a8007485bae03bf6d2cc83cd5ec28a7fb1a34258b53",
"md5": "96d752ce1d4a92282e57103f8c0d1be6",
"sha256": "b1e7aa7b66d4d0cb18a9143bf60b83ef09c23d77aab07f18656bb3c7a4873bd9"
},
"downloads": -1,
"filename": "cruds-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "96d752ce1d4a92282e57103f8c0d1be6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 7696,
"upload_time": "2024-04-11T19:50:24",
"upload_time_iso_8601": "2024-04-11T19:50:24.005186Z",
"url": "https://files.pythonhosted.org/packages/af/44/35581df20ea1b4bc9a8007485bae03bf6d2cc83cd5ec28a7fb1a34258b53/cruds-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-11 19:50:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "johnbrandborg",
"github_project": "cruds",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cruds"
}