# NexusMaker
## Simply Generate Nexus Files
```
from nexusmaker import NexusMaker, Record
data = [
Record(Language="A", Word="eye", Item="", Cognate="1"),
Record(Language="A", Word="leg", Item="", Cognate="1"),
Record(Language="A", Word="arm", Item="", Cognate="1"),
Record(Language="B", Word="eye", Item="", Cognate="1"),
Record(Language="B", Word="leg", Item="", Cognate="2"),
Record(Language="B", Word="arm", Item="", Cognate="2"),
Record(Language="C", Word="eye", Item="", Cognate="1"),
# No ReCord for C 'leg'
Record(Language="C", Word="arm", Item="", Cognate="3"),
Record(Language="D", Word="eye", Item="", Cognate="1", loan=True),
Record(Language="D", Word="leg", Item="", Cognate="1"),
Record(Language="D", Word="leg", Item="", Cognate="2"),
Record(Language="D", Word="arm", Item="", Cognate="2,3"),
]
maker = NexusMaker(data)
maker = NexusMakerAscertained(data) # adds Ascertainment bias character
maker = NexusMakerAscertainedWords(data) # adds Ascertainment character per word
nex = maker.make()
maker.write(nex, filename="output.nex")
```
### Version History:
* 2.0.4: add `unique_ids` parameter
* 2.0.3: handle CLDF datasets
* 2.0.2: add tool to filter combining cognates
* 2.0.1: minor bugfixes.
* 2.0: major refactor of testing and other components.
* 1.5: do more validation of cognate sets to detect possibly broken combined cognate sets.
* 1.4: normalise order of cognates (i.e. so 1,54 == 54,1).
* 1.3: handle cognates of form '1a'.
* 1.2: initial release.
Raw data
{
"_id": null,
"home_page": "https://github.com/SimonGreenhill/NexusMaker",
"name": "nexusmaker",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "language-phylogenies phylolinguistics",
"author": "Simon J. Greenhill",
"author_email": "simon@simon.net.nz",
"download_url": "https://files.pythonhosted.org/packages/c2/41/8e8aa3554f32016f925c2813b247bc0b8fdaa0d347619e46488cd13d536a/nexusmaker-2.0.5.tar.gz",
"platform": "any",
"description": "# NexusMaker\n\n## Simply Generate Nexus Files\n\n```\nfrom nexusmaker import NexusMaker, Record\n\n\ndata = [\n Record(Language=\"A\", Word=\"eye\", Item=\"\", Cognate=\"1\"),\n Record(Language=\"A\", Word=\"leg\", Item=\"\", Cognate=\"1\"),\n Record(Language=\"A\", Word=\"arm\", Item=\"\", Cognate=\"1\"),\n \n Record(Language=\"B\", Word=\"eye\", Item=\"\", Cognate=\"1\"),\n Record(Language=\"B\", Word=\"leg\", Item=\"\", Cognate=\"2\"),\n Record(Language=\"B\", Word=\"arm\", Item=\"\", Cognate=\"2\"),\n \n Record(Language=\"C\", Word=\"eye\", Item=\"\", Cognate=\"1\"),\n # No ReCord for C 'leg'\n Record(Language=\"C\", Word=\"arm\", Item=\"\", Cognate=\"3\"),\n\n Record(Language=\"D\", Word=\"eye\", Item=\"\", Cognate=\"1\", loan=True),\n Record(Language=\"D\", Word=\"leg\", Item=\"\", Cognate=\"1\"),\n Record(Language=\"D\", Word=\"leg\", Item=\"\", Cognate=\"2\"),\n Record(Language=\"D\", Word=\"arm\", Item=\"\", Cognate=\"2,3\"),\n]\n\nmaker = NexusMaker(data)\n\nmaker = NexusMakerAscertained(data) # adds Ascertainment bias character\n\nmaker = NexusMakerAscertainedWords(data) # adds Ascertainment character per word\nnex = maker.make()\nmaker.write(nex, filename=\"output.nex\")\n\n\n```\n\n### Version History:\n\n* 2.0.4: add `unique_ids` parameter \n* 2.0.3: handle CLDF datasets\n* 2.0.2: add tool to filter combining cognates\n* 2.0.1: minor bugfixes.\n* 2.0: major refactor of testing and other components.\n* 1.5: do more validation of cognate sets to detect possibly broken combined cognate sets.\n* 1.4: normalise order of cognates (i.e. so 1,54 == 54,1).\n* 1.3: handle cognates of form '1a'.\n* 1.2: initial release.\n",
"bugtrack_url": null,
"license": "BSD-2-Clause",
"summary": "nexusmaker - Nexus file maker for language phylogenies",
"version": "2.0.5",
"split_keywords": [
"language-phylogenies",
"phylolinguistics"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f9b445db6fcf22755cb6b49fc388435b60c85291d402260bb5416da29d208b99",
"md5": "3b8abbb1686d863ba383e4fca28398d0",
"sha256": "caa2eb8884f3f80c2036f059d0fb85b022c3cd06e8df884ca833ffac875d948a"
},
"downloads": -1,
"filename": "nexusmaker-2.0.5-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "3b8abbb1686d863ba383e4fca28398d0",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.7",
"size": 25647,
"upload_time": "2023-01-11T01:01:40",
"upload_time_iso_8601": "2023-01-11T01:01:40.037874Z",
"url": "https://files.pythonhosted.org/packages/f9/b4/45db6fcf22755cb6b49fc388435b60c85291d402260bb5416da29d208b99/nexusmaker-2.0.5-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c2418e8aa3554f32016f925c2813b247bc0b8fdaa0d347619e46488cd13d536a",
"md5": "dc47fbabab1deab56d2cdb5a9c3a2c2e",
"sha256": "d252ec92656b295560903786f2ed25707b4c610d55a96b68c6ac0bbd10b2dc0b"
},
"downloads": -1,
"filename": "nexusmaker-2.0.5.tar.gz",
"has_sig": false,
"md5_digest": "dc47fbabab1deab56d2cdb5a9c3a2c2e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 20042,
"upload_time": "2023-01-11T01:01:42",
"upload_time_iso_8601": "2023-01-11T01:01:42.063682Z",
"url": "https://files.pythonhosted.org/packages/c2/41/8e8aa3554f32016f925c2813b247bc0b8fdaa0d347619e46488cd13d536a/nexusmaker-2.0.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-11 01:01:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "SimonGreenhill",
"github_project": "NexusMaker",
"travis_ci": true,
"coveralls": true,
"github_actions": false,
"requirements": [
{
"name": "python-nexus",
"specs": []
}
],
"tox": true,
"lcname": "nexusmaker"
}