| Name | openjsoncanvas JSON |
| Version |
3.0.0
JSON |
| download |
| home_page | None |
| Summary | A python implementation of the JsonCanvas format: https://github.com/obsidianmd/jsoncanvas/blob/main/spec/1.0.md |
| upload_time | 2024-04-16 23:05:41 |
| maintainer | None |
| docs_url | None |
| author | Alyce Osbourne |
| requires_python | None |
| license | None |
| keywords |
|
| VCS |
 |
| bugtrack_url |
|
| requirements |
No requirements were recorded.
|
| Travis-CI |
No Travis.
|
| coveralls test coverage |
No coveralls.
|
# JsonCanvas Python Implementation
This project provides a Python implementation of the [JsonCanvas format](https://github.com/obsidianmd/jsoncanvas/blob/main/spec/1.0.md), designed to facilitate the creation, manipulation, and visualization of a structured canvas using objects and relations. It leverages Python's `pydantic` library to ensure data validation and management, supporting a range of node and edge types for comprehensive canvas construction.
## Features
- Robust model definitions for canvas elements (Nodes and Edges) with comprehensive validation and default settings via `pydantic`.
- Dynamic addition and manipulation of various node types including Text, File, Link, Group, and Edge elements.
- Enhanced canvas operations allowing easy addition of nodes and edges with automated type handling.
- Serialize canvas structures to standard Python dictionaries for easy integration with other systems.
## Installation
```bash
pip install openjsoncanvas
```
## Usage
### Creating a Canvas
Instantiate and manipulate a canvas with various nodes and edges:
```python
from openjsoncanvas import Canvas
canvas = Canvas()
canvas.create_text_node(id='1', x=0, y=0, width=100, height=100, text='Hello, World!')
canvas.create_file_node(id='2', x=100, y=100, width=100, height=100, file='example.md')
canvas.create_link_node(id='3', x=200, y=200, width=100, height=100, url='https://example.com')
canvas.create_group_node(id='4', x=300, y=300, width=100, height=100)
canvas.create_edge(id='5', fromNode='1', toNode='2', fromEnd='arrow', toEnd='arrow', color='red', label='Edge')
# you can save and load the canvas to/from a file
canvas.to_file('my_canvas.canvas')
canvas = Canvas.from_file('my_canvas.canvas')
```
Raw data
{
"_id": null,
"home_page": null,
"name": "openjsoncanvas",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Alyce Osbourne",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/f5/2a/18bb1ae0f4ace3326acc726f04f423c8dfc2ae3b55adf3235c063c121821/openjsoncanvas-3.0.0.tar.gz",
"platform": null,
"description": "\n# JsonCanvas Python Implementation\n\nThis project provides a Python implementation of the [JsonCanvas format](https://github.com/obsidianmd/jsoncanvas/blob/main/spec/1.0.md), designed to facilitate the creation, manipulation, and visualization of a structured canvas using objects and relations. It leverages Python's `pydantic` library to ensure data validation and management, supporting a range of node and edge types for comprehensive canvas construction.\n\n## Features\n\n- Robust model definitions for canvas elements (Nodes and Edges) with comprehensive validation and default settings via `pydantic`.\n- Dynamic addition and manipulation of various node types including Text, File, Link, Group, and Edge elements.\n- Enhanced canvas operations allowing easy addition of nodes and edges with automated type handling.\n- Serialize canvas structures to standard Python dictionaries for easy integration with other systems.\n\n## Installation\n\n```bash\npip install openjsoncanvas\n```\n\n## Usage\n\n### Creating a Canvas\n\nInstantiate and manipulate a canvas with various nodes and edges:\n\n```python\nfrom openjsoncanvas import Canvas\n\ncanvas = Canvas()\n\ncanvas.create_text_node(id='1', x=0, y=0, width=100, height=100, text='Hello, World!')\ncanvas.create_file_node(id='2', x=100, y=100, width=100, height=100, file='example.md')\ncanvas.create_link_node(id='3', x=200, y=200, width=100, height=100, url='https://example.com')\ncanvas.create_group_node(id='4', x=300, y=300, width=100, height=100)\ncanvas.create_edge(id='5', fromNode='1', toNode='2', fromEnd='arrow', toEnd='arrow', color='red', label='Edge')\n\n# you can save and load the canvas to/from a file\ncanvas.to_file('my_canvas.canvas')\ncanvas = Canvas.from_file('my_canvas.canvas')\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "A python implementation of the JsonCanvas format: https://github.com/obsidianmd/jsoncanvas/blob/main/spec/1.0.md",
"version": "3.0.0",
"project_urls": {
"Home": "https://github.com/AlyceOsbourne/openjsoncanvas"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d144f0fccb73d59f94b7723e7f96612c4c36c70b6e70d293dfe03c7eea5d6fc2",
"md5": "41d521321af35d44a4cc24bc083e6f69",
"sha256": "cbe7feb5d241586cab24fe51343c18d558d2fe62042bdfcff73b642cfc31b62c"
},
"downloads": -1,
"filename": "openjsoncanvas-3.0.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "41d521321af35d44a4cc24bc083e6f69",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 4810,
"upload_time": "2024-04-16T23:05:35",
"upload_time_iso_8601": "2024-04-16T23:05:35.363477Z",
"url": "https://files.pythonhosted.org/packages/d1/44/f0fccb73d59f94b7723e7f96612c4c36c70b6e70d293dfe03c7eea5d6fc2/openjsoncanvas-3.0.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f52a18bb1ae0f4ace3326acc726f04f423c8dfc2ae3b55adf3235c063c121821",
"md5": "3b42f4a3ee51e2a7ca8a7b46f6b69e6e",
"sha256": "90d4cedc3a2eb4c87426e3b4522cbf9e1535879ca999adbad3f3d8b329b69b45"
},
"downloads": -1,
"filename": "openjsoncanvas-3.0.0.tar.gz",
"has_sig": false,
"md5_digest": "3b42f4a3ee51e2a7ca8a7b46f6b69e6e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4347,
"upload_time": "2024-04-16T23:05:41",
"upload_time_iso_8601": "2024-04-16T23:05:41.189786Z",
"url": "https://files.pythonhosted.org/packages/f5/2a/18bb1ae0f4ace3326acc726f04f423c8dfc2ae3b55adf3235c063c121821/openjsoncanvas-3.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-16 23:05:41",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AlyceOsbourne",
"github_project": "openjsoncanvas",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "openjsoncanvas"
}