{"id":28712432,"url":"https://github.com/polusai/rxiv-types","last_synced_at":"2026-02-16T10:06:09.751Z","repository":{"id":232631694,"uuid":"653312483","full_name":"PolusAI/rxiv-types","owner":"PolusAI","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-13T20:42:20.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-14T23:05:49.729Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/PolusAI.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-06-13T20:16:55.000Z","updated_at":"2023-06-13T20:16:55.000Z","dependencies_parsed_at":"2024-04-10T19:23:16.752Z","dependency_job_id":"227f477d-994a-4f83-acc4-38e8fdb3c7db","html_url":"https://github.com/PolusAI/rxiv-types","commit_stats":null,"previous_names":["polusai/rxiv-types"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PolusAI/rxiv-types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolusAI%2Frxiv-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolusAI%2Frxiv-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolusAI%2Frxiv-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolusAI%2Frxiv-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PolusAI","download_url":"https://codeload.github.com/PolusAI/rxiv-types/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolusAI%2Frxiv-types/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268757162,"owners_count":24302872,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-06-14T23:05:49.654Z","updated_at":"2025-10-04T00:02:39.904Z","avatar_url":"https://github.com/PolusAI.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# rxiv-types (v0.1.0)\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/dm/rxiv-types?style=flat-square\" /\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/l/rxiv-types?style=flat-square\"/\u003e\n    \u003cimg src=\"https://img.shields.io/pypi/v/rxiv-types?style=flat-square\"/\u003e\n    \u003ca href=\"https://github.com/tefra/xsdata-pydantic\"\u003e\n        \u003cimg alt=\"Built with: xsdata-pydantic\" src=\"https://img.shields.io/badge/Built%20with-xsdata--pydantic-blue\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://github.com/dbrgn/coverage-badge\"\u003e\n        \u003cimg src=\"./images/coverage.svg\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n## Introduction\n\nA complete implementation of the XML/JSON schema for *Rxiv preprint servers. This\ncovers arXiv, medrXiv, biorXiv, chemrXiv, and DOAJ.\n\nThis package helps to parse XML/JSON data into Pydantic models. This validates\nthe input xml data and provides typehints for working with the complex XML structures\npresent in *Rxiv data.\n\n## Why do I need this?\n\nParsing XML on its own is challenging. Add to it the feature rich data inside of each\ncitation, and you will find yourself with hours or days of navigating the XML structure.\n\nThe approach here was to autogenerate Pydantic classes to parse the XML using the\n`xsdata-pydantic` tool. This approach has the benefit of making sure every piece of data\nis parsed properly, and an error is thrown if something is missing or incorrect. Instead\nof using dictionaries to hold the data, Pydantic classes have the benefit of providing\ntype hints with tab completion for IDEs, making it easier to navigate the complex\nstructure of the citation data.\n\n## How do I use it?\n\nIt is possible to use `xsdata-pydantic` and the autogenerated classes directly to parse\nan XML file, but we provide a convenience function to easily open *rxiv XMl citations\nand PMC open access articles.\n\n### Example 1: Parse ChemRxiv Data\n\n```python\nfrom pathlib import Path\n\nimport requests\n\nfrom rxiv_types import chemrxiv_records\n\nchemrxiv_url = \"https://chemrxiv.org/engage/chemrxiv/public-api/v1/oai?verb=ListRecords\u0026metadataPrefix=oai_dc\u0026from=2000-01-01\"\n\n# 1. Get some chemrxiv data from the API\nresult = requests.get(chemrxiv_url)\ndestination = Path(f\"downloads/data/chemrxiv.xml\")\ndestination.parent.mkdir(parents=True, exist_ok=True)\nwith open(destination, \"wb\") as fw:\n    fw.write(result.content)\n\n# 2. Parse the data, and display the first article title\nresult = chemrxiv_records(destination)\n\n# 3. Print some information about the first record\nprint(\"Paper 1:\")\nprint(f\"Title: {''.join(result.list_records.record[0].metadata.dc.title)}\")\nprint(f\"Authors: {'; '.join(result.list_records.record[0].metadata.dc.creator)}\")\nprint(f\"Abstract: {''.join(result.list_records.record[0].metadata.dc.description)}\")\n```\n\nOutput:\n\n```bash\nPaper 1:\nTitle: Excitonics: A universal set of binary gates for molecular exciton processing and signaling\nAuthors: Nicolas, Sawaya; Dmitrij, Rappoport; Daniel, Tabor; Alan, Aspuru-Guzik\nAbstract: The ability to regulate energy transfer pathways through materials is an\n important goal of nanotechnology, as a greater degree of control is \ncrucial for developing sensing, solar energy, and bioimaging \napplications. Such control necessitates a toolbox of actuation methods \nthat can direct energy transfer based on user input. Here we propose a \nnovel molecular exciton gate, analogous to a traditional transistor, for\n controlling exciton migration in chromophoric systems. The gate may be \nactivated with an input of light or an input flow of excitons. Unlike \nprevious gates and switches that control exciton transfer, our proposal \ndoes not require isomerization or molecular rearrangement, instead \nrelying on excitation migration via the second singlet (S2) state of the\n gate molecule--hence the system is named an \"S2 exciton gate.\" After \npresenting a set of system properties required for proper function of \nthe S2 exciton gate, we show how one would overcome the two possible \nchallenges: short-lived excited states and suppression of false \npositives. Precision and error rates are studied computationally in a \nmodel system with respect to excited-state decay rates and variations in\n molecular orientation. Finally, we demonstrate that the S2 exciton gate\n gate can be used to produce binary logical AND, OR, and NOT operations,\n providing a universal excitonic computation platform with a range of \npotential applications, including e.g. in signal processing for \nmicroscopy.\n```\n\n## FAQ\n\n### Why are the return structures so complicated?\n\nThe return structures are a direct reflection of the XML format defined by OAI and any\ncustomizations from the hosting preprint servers. In the future some utility classes\nmight be made for common components (title, authors, etc), but for now this is intended\nto be an unbiased way of parsing the XML.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolusai%2Frxiv-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolusai%2Frxiv-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolusai%2Frxiv-types/lists"}