{"id":29051479,"url":"https://github.com/giacomomarchioro/pywadm","last_synced_at":"2025-06-26T22:10:39.006Z","repository":{"id":221508518,"uuid":"672780269","full_name":"giacomomarchioro/pyWADM","owner":"giacomomarchioro","description":"This is a Python module built for easing the construction of JSON object compliant with the Web Annotation Data Model in a production environment.","archived":false,"fork":false,"pushed_at":"2023-07-31T07:33:30.000Z","size":147,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-02-08T12:32:43.380Z","etag":null,"topics":["annotation","json-ld","w3c","web","web-annotation","web-annotation-wg"],"latest_commit_sha":null,"homepage":"","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/giacomomarchioro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-07-31T06:41:13.000Z","updated_at":"2024-02-08T12:32:52.261Z","dependencies_parsed_at":"2024-02-08T12:42:57.805Z","dependency_job_id":null,"html_url":"https://github.com/giacomomarchioro/pyWADM","commit_stats":null,"previous_names":["giacomomarchioro/pywadm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/giacomomarchioro/pyWADM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giacomomarchioro%2FpyWADM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giacomomarchioro%2FpyWADM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giacomomarchioro%2FpyWADM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giacomomarchioro%2FpyWADM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/giacomomarchioro","download_url":"https://codeload.github.com/giacomomarchioro/pyWADM/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/giacomomarchioro%2FpyWADM/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262150132,"owners_count":23266835,"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":["annotation","json-ld","w3c","web","web-annotation","web-annotation-wg"],"created_at":"2025-06-26T22:10:38.232Z","updated_at":"2025-06-26T22:10:38.999Z","avatar_url":"https://github.com/giacomomarchioro.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyWDAM\n\n----------------\nThis is a Python module built for easing the construction of JSON object compliant with the [Web Annotation Data Model](https://www.w3.org/TR/annotation-model/) in a production environment.\n\n## Installation\nThe library uses only standard libraries and can be installed using `pip`.\n\nDevelopment :\n\n    pip install git+https://github.com/giacomomarchioro/pyWADM\n\n## Basic usage\nThe module maps the API structure to Python classes. The user `set_` objects that can have only one value (e.g. `id`) and `add_` objects that can have multiple entities (e.g. `labels`).\n\nThe easiest way to get started is to have a look at the examples in the [Recommendation](https://www.w3.org/TR/annotation-model/) and modify the example in the `examples`` folder in this repository. For instance:\n\n```python\n# EXAMPLE 1: Basic Annotation Model\nfrom wadm import WADM\nanno = WADM.Annotation()\nanno.set_id(\"http://example.org/anno1\")\nanno.set_body(\"http://example.org/post1\")\nanno.set_target(\"http://example.com/page1\")\nanno.to_json()\n```\nIf `set_` or `add_` require a specific Class they can be left with no arguments, they will return an instance of the class needed to be populated.\n```python\n# EXAMPLE 40: Annotation Collection with Embedded Page\nfrom wadm import WADM\nanno = WADM.AnnotationCollection()\nanno.set_id(\"http://example.org/collection1\")\nanno.add_label(\"Two Annotations\")\nanno.set_total(2)\nannop = anno.set_first()\nannop.set_id(\"http://example.org/page1\")\nannop.set_startIndex(0)\na1 = annop.add_annotation_to_items()\na1.set_id(\"http://example.org/anno1\")\na1.set_body(\"http://example.net/comment1\")\na1.set_target(\"http://example.com/book/chapter1\")\na2 = annop.add_annotation_to_items()\na2.set_target(\"http://example.com/book/chapter2\")\na2.set_body(\"http://example.net/comment2\")\na2.set_id(\"http://example.org/anno2\")\nanno.to_json()\n```\n\n## Debug the object\nWhen you are populating a new WADM object from scratch some helpful functions can be\nused for spotting errors.\n\n`.inspect()` method returns a JSON representation of the object where the\nrecommended and required fields are shown:\n\n```python\nfrom wadm import WADM\nanno = WADM.Annotation()\nanno.inspect()\n```\n\n`.show_errors_in_browser()` method open a new browser tab highlighting the \nrequired and recommended fields.\n\n```python\nanno.show_errors_in_browser()\n```\n\n## Acknowledgements\nThe package is provided by the [Laboratorio di Studi Medievali e Danteschi](https://sites.hss.univr.it/laboratori_integrati/laboratorio-lamedan/) of the [University of Verona](https://www.univr.it/en/home)\n\n\u003cimg src=\"https://i.ibb.co/tcTNXRP/layerlores.png\" alt=\"LaMeDan Logo\" width=\"250\"\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiacomomarchioro%2Fpywadm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiacomomarchioro%2Fpywadm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiacomomarchioro%2Fpywadm/lists"}