# schemaser
Converts a Python class or method to a JSON schema.
## Install
```
pip install schemaser
```
## Example
```py
import schemaser
class MyClass():
def __init__(self, string:str=None, integer:int=None, float:float=None):
pass
# Custom magic method for custom schemas
# def __schema__(self):
# return {}
def MyMethod(value:str, **kw:cls):
pass
def func1(string:str, integer:int, float:float, tuple:list[str,int], array:list[str|int], object:MyClass, func:MyMethod):
pass
# Convert func1 method to JSON Schema.
dat = schemaser.to_schema(func1)
print(dat)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/legopitstop/schemaser",
"name": "schemaser",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "json,jsonschema,schema,class,method",
"author": "Legopitstop",
"author_email": "officiallegopitstop@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/04/8d/ad5c36a848bb7d79ed772b5d11b5fbd6f2c05aeb87c50d21c5f656a5ce4c/schemaser-1.0.1.tar.gz",
"platform": null,
"description": "# schemaser\r\nConverts a Python class or method to a JSON schema.\r\n\r\n## Install\r\n```\r\npip install schemaser\r\n```\r\n\r\n## Example\r\n```py\r\nimport schemaser\r\n\r\nclass MyClass():\r\n def __init__(self, string:str=None, integer:int=None, float:float=None):\r\n pass\r\n\r\n # Custom magic method for custom schemas\r\n # def __schema__(self):\r\n # return {}\r\n\r\ndef MyMethod(value:str, **kw:cls):\r\n pass\r\n\r\ndef func1(string:str, integer:int, float:float, tuple:list[str,int], array:list[str|int], object:MyClass, func:MyMethod):\r\n pass\r\n\r\n# Convert func1 method to JSON Schema.\r\ndat = schemaser.to_schema(func1)\r\nprint(dat)\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Converts a Python class or method to a JSON schema.",
"version": "1.0.1",
"project_urls": {
"Homepage": "https://github.com/legopitstop/schemaser"
},
"split_keywords": [
"json",
"jsonschema",
"schema",
"class",
"method"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "048dad5c36a848bb7d79ed772b5d11b5fbd6f2c05aeb87c50d21c5f656a5ce4c",
"md5": "57bd242a969ba4cbb64b7a95bbc25434",
"sha256": "a25f576dce7615e2817422772b19fe6d007017bebc271577235383edb6ec8e14"
},
"downloads": -1,
"filename": "schemaser-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "57bd242a969ba4cbb64b7a95bbc25434",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 3741,
"upload_time": "2023-06-23T22:12:11",
"upload_time_iso_8601": "2023-06-23T22:12:11.798995Z",
"url": "https://files.pythonhosted.org/packages/04/8d/ad5c36a848bb7d79ed772b5d11b5fbd6f2c05aeb87c50d21c5f656a5ce4c/schemaser-1.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-23 22:12:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "legopitstop",
"github_project": "schemaser",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "schemaser"
}