{"id":25946916,"url":"https://github.com/cheeksthegeek/pyjsoncanvas","last_synced_at":"2025-03-04T10:17:23.365Z","repository":{"id":228898034,"uuid":"775230625","full_name":"CheeksTheGeek/PyJSONCanvas","owner":"CheeksTheGeek","description":"A simple library for working with JSON Canvas (previously known as Obsidian Canvas) files.","archived":false,"fork":false,"pushed_at":"2024-09-03T20:34:35.000Z","size":20,"stargazers_count":51,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T09:44:30.952Z","etag":null,"topics":["canvas","diagramming","diagrams","json","markdown","obsidian","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/PyJSONCanvas/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CheeksTheGeek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-21T01:56:16.000Z","updated_at":"2025-02-24T18:42:18.000Z","dependencies_parsed_at":"2024-03-21T02:06:24.982Z","dependency_job_id":"4976c425-b3cd-491d-8029-984d80e3f00c","html_url":"https://github.com/CheeksTheGeek/PyJSONCanvas","commit_stats":null,"previous_names":["cheeksthegeek/pyjsoncanvas"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CheeksTheGeek%2FPyJSONCanvas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CheeksTheGeek%2FPyJSONCanvas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CheeksTheGeek%2FPyJSONCanvas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CheeksTheGeek%2FPyJSONCanvas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CheeksTheGeek","download_url":"https://codeload.github.com/CheeksTheGeek/PyJSONCanvas/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241827168,"owners_count":20026601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["canvas","diagramming","diagrams","json","markdown","obsidian","python"],"created_at":"2025-03-04T10:17:22.321Z","updated_at":"2025-03-04T10:17:23.356Z","avatar_url":"https://github.com/CheeksTheGeek.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyJSONCanvas\n\nPyJSONCanvas is a Python library for working with JSON Canvas (previously known as Obsidian Canvas) files. It provides a simple and intuitive API for creating, editing, and manipulating canvas objects, nodes, and edges.\n\n## Features\n\n- Create, load, and save canvas files in JSON format\n- Add, remove, and modify nodes (text, file, link, group)\n- Add, remove, and modify edges with various styles and colors\n- Validate canvas, nodes, and edges for integrity\n- Get connections and adjacent nodes for a given node\n- Extensive error handling and helpful exception messages\n\n## Installation\n\nYou can install PyJSONCanvas using pip:\n\n```\npip install PyJSONCanvas\n```\n\n## Usage\n\nHere's a basic example of how to use PyJSONCanvas:\n\n```python\nfrom pyjsoncanvas import (\n    Canvas,\n    TextNode,\n    FileNode,\n    LinkNode,\n    GroupNode,\n    GroupNodeBackgroundStyle,\n    Edge,\n    Color,\n)\n\n# Create a new canvas\ncanvas = Canvas(nodes=[], edges=[])\n\n# Add some nodes\ntext_node = TextNode(x=100, y=100, width=200, height=100, text=\"Hello, world!\")\ncanvas.add_node(text_node)\n\nfile_node = FileNode(x=300, y=100, width=100, height=100, file=\"/path/to/file.png\")\ncanvas.add_node(file_node)\n\n# Add an edge\nedge = Edge(\n    fromNode=text_node.id,\n    fromSide=\"bottom\",\n    toNode=file_node.id,\n    toSide=\"top\",\n    color=Color(\"#FF0000\"),\n    label=\"Edge 1\",\n)\ncanvas.add_edge(edge)\n\n# Save the canvas as JSON\njson_str = canvas.to_json()\n\n# Load the canvas from JSON\nloaded_canvas = Canvas.from_json(json_str)\n\n# Get a node\nnode = loaded_canvas.get_node(text_node.id)\n\n# Get connections for a node\nconnections = loaded_canvas.get_connections(text_node.id)\n```\n\n## Documentation\n\nFor full documentation, please see the [PyJSONCanvas Documentation](docs/PyJSONCanvas.md).\n\n## Contributing\n\nWe welcome contributions to PyJSONCanvas! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the [GitHub repository](https://github.com/cheeksthegeek/PyJSONCanvas).\n\n## License\n\nPyJSONCanvas is released under the [MIT License](https://opensource.org/licenses/MIT).\n\n## Support\n\nIf you have any questions or need further assistance, please open an issue on the [GitHub repository](https://github.com/cheeksthegeek/PyJSONCanvas) or contact the maintainers.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheeksthegeek%2Fpyjsoncanvas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheeksthegeek%2Fpyjsoncanvas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheeksthegeek%2Fpyjsoncanvas/lists"}