objectrest


Nameobjectrest JSON
Version 2.0.0 PyPI version JSON
download
home_pagehttps://github.com/nwithan8/objectrest
SummaryA Python package to handle REST API requests, JSON parsing, and pydantic object generation.
upload_time2022-10-02 08:36:48
maintainer
docs_urlNone
authorNate Harris
requires_python>=3.7
licenseGNU General Public License v3 (GPLv3)
keywords api rest objects pydantic json requests oauth2 token
VCS
bugtrack_url
requirements requests requests-oauthlib httpx oauthlib proxlist
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ObjectREST
[![PyPi](https://img.shields.io/pypi/dm/objectrest?color=green&label=PyPI&logo=pypi&logoColor=yellow&style=flat-square)](https://pypi.org/project/objectrest)
[![License](https://img.shields.io/pypi/l/tautulli?color=orange&style=flat-square)](https://github.com/nwithan8/objectrest/blob/master/LICENSE)

[![Tests](https://github.com/nwithan8/objectrest/workflows/Tests/badge.svg)](https://github.com/nwithan8/objectrest/actions?query=workflow%3ATests)
[![Open Issues](https://img.shields.io/github/issues-raw/nwithan8/objectrest?color=gold&style=flat-square)](https://github.com/nwithan8/objectrest/issues?q=is%3Aopen+is%3Aissue)
[![Closed Issues](https://img.shields.io/github/issues-closed-raw/nwithan8/objectrest?color=black&style=flat-square)](https://github.com/nwithan8/objectrest/issues?q=is%3Aissue+is%3Aclosed)
[![Latest Release](https://img.shields.io/github/v/release/nwithan8/objectrest?color=red&label=latest%20release&logo=github&style=flat-square)](https://github.com/nwithan8/objectrest/releases)

[![Discord](https://img.shields.io/discord/472537215457689601?color=blue&logo=discord&style=flat-square)](https://discord.gg/7jGbCJQ)
[![Twitter](https://img.shields.io/twitter/follow/nwithan8?label=%40nwithan8&logo=twitter&style=flat-square)](https://twitter.com/nwithan8)

A Python package to handle REST API requests, JSON parsing, and pydantic object generation.

# Installation
From PyPi: ``python -m pip install objectrest``

From GitHub ``python -m pip install git+https://github.com/nwithan8/objectrest.git``

# Usage
This package acts as a middle-man between the user and the Requests library.

Users can call to methods directly, or use the RequestHandler class to set universal parameters (i.e. API tokens), universal headers and/or a universal base URL for all requests

Users can retrieve the raw request, the JSON data from a request, or have the JSON data automatically parsed into a Pydantic model.

Example:
```python
from objectrest import RequestHandler

requests = RequestHandler(base_url="http://rootoftheapi", universal_parameters={'api_key': "thisisanapikey"})

my_object = requests.get_object(url="/object", model=MyObjectClass, params={"limit": 10})
```

# Documentation

Documentation available on [ReadTheDocs](https://objectrest.readthedocs.io/en/latest/documentation.html)



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nwithan8/objectrest",
    "name": "objectrest",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "API,REST,objects,pydantic,JSON,requests,OAuth2,token",
    "author": "Nate Harris",
    "author_email": "n8gr8gbln@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/fb/c0/dbd92b095e254e738326c8e89531b36cf1ed137790a21ef9b5aa4be4235f/objectrest-2.0.0.tar.gz",
    "platform": null,
    "description": "# ObjectREST\n[![PyPi](https://img.shields.io/pypi/dm/objectrest?color=green&label=PyPI&logo=pypi&logoColor=yellow&style=flat-square)](https://pypi.org/project/objectrest)\n[![License](https://img.shields.io/pypi/l/tautulli?color=orange&style=flat-square)](https://github.com/nwithan8/objectrest/blob/master/LICENSE)\n\n[![Tests](https://github.com/nwithan8/objectrest/workflows/Tests/badge.svg)](https://github.com/nwithan8/objectrest/actions?query=workflow%3ATests)\n[![Open Issues](https://img.shields.io/github/issues-raw/nwithan8/objectrest?color=gold&style=flat-square)](https://github.com/nwithan8/objectrest/issues?q=is%3Aopen+is%3Aissue)\n[![Closed Issues](https://img.shields.io/github/issues-closed-raw/nwithan8/objectrest?color=black&style=flat-square)](https://github.com/nwithan8/objectrest/issues?q=is%3Aissue+is%3Aclosed)\n[![Latest Release](https://img.shields.io/github/v/release/nwithan8/objectrest?color=red&label=latest%20release&logo=github&style=flat-square)](https://github.com/nwithan8/objectrest/releases)\n\n[![Discord](https://img.shields.io/discord/472537215457689601?color=blue&logo=discord&style=flat-square)](https://discord.gg/7jGbCJQ)\n[![Twitter](https://img.shields.io/twitter/follow/nwithan8?label=%40nwithan8&logo=twitter&style=flat-square)](https://twitter.com/nwithan8)\n\nA Python package to handle REST API requests, JSON parsing, and pydantic object generation.\n\n# Installation\nFrom PyPi: ``python -m pip install objectrest``\n\nFrom GitHub ``python -m pip install git+https://github.com/nwithan8/objectrest.git``\n\n# Usage\nThis package acts as a middle-man between the user and the Requests library.\n\nUsers can call to methods directly, or use the RequestHandler class to set universal parameters (i.e. API tokens), universal headers and/or a universal base URL for all requests\n\nUsers can retrieve the raw request, the JSON data from a request, or have the JSON data automatically parsed into a Pydantic model.\n\nExample:\n```python\nfrom objectrest import RequestHandler\n\nrequests = RequestHandler(base_url=\"http://rootoftheapi\", universal_parameters={'api_key': \"thisisanapikey\"})\n\nmy_object = requests.get_object(url=\"/object\", model=MyObjectClass, params={\"limit\": 10})\n```\n\n# Documentation\n\nDocumentation available on [ReadTheDocs](https://objectrest.readthedocs.io/en/latest/documentation.html)\n\n\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v3 (GPLv3)",
    "summary": "A Python package to handle REST API requests, JSON parsing, and pydantic object generation.",
    "version": "2.0.0",
    "split_keywords": [
        "api",
        "rest",
        "objects",
        "pydantic",
        "json",
        "requests",
        "oauth2",
        "token"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "19dff47ada5fe8183bfeafd64440e646",
                "sha256": "aedcdc35d8e8288522ebe6d3c44d2691c4ee22f3c9e1e05c78bedfb603873277"
            },
            "downloads": -1,
            "filename": "objectrest-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "19dff47ada5fe8183bfeafd64440e646",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 27813,
            "upload_time": "2022-10-02T08:36:46",
            "upload_time_iso_8601": "2022-10-02T08:36:46.364961Z",
            "url": "https://files.pythonhosted.org/packages/07/2a/dbc10e57eeb0c84068d4824e4080dba2872b79fdeb46e43158385834e885/objectrest-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "669ef63acc0232e3bb950540424c1081",
                "sha256": "0426aa36e88a44971d995633b75d466ea293062715df18005dc10d9aac2b3d85"
            },
            "downloads": -1,
            "filename": "objectrest-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "669ef63acc0232e3bb950540424c1081",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 24651,
            "upload_time": "2022-10-02T08:36:48",
            "upload_time_iso_8601": "2022-10-02T08:36:48.121961Z",
            "url": "https://files.pythonhosted.org/packages/fb/c0/dbd92b095e254e738326c8e89531b36cf1ed137790a21ef9b5aa4be4235f/objectrest-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-10-02 08:36:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "nwithan8",
    "github_project": "objectrest",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "requests",
            "specs": [
                [
                    ">=",
                    "2.27.1"
                ]
            ]
        },
        {
            "name": "requests-oauthlib",
            "specs": [
                [
                    ">=",
                    "1.3.0"
                ]
            ]
        },
        {
            "name": "httpx",
            "specs": [
                [
                    "==",
                    "0.23.*"
                ]
            ]
        },
        {
            "name": "oauthlib",
            "specs": [
                [
                    "==",
                    "3.2.1"
                ]
            ]
        },
        {
            "name": "proxlist",
            "specs": [
                [
                    "~=",
                    "0.5.0"
                ]
            ]
        }
    ],
    "tox": true,
    "lcname": "objectrest"
}
        
Elapsed time: 0.05748s