{
"info": {
"author": "Philip Olson",
"author_email": "philip.olson@pm.me",
"bugtrack_url": null,
"classifiers": [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7"
],
"description": "# Another Linked List\n\n\n\n
\n\n\n\n**Table of Contents**\n\n- [What is it?](#what-is-it)\n- [Why create it?](#why-create-it)\n- [Simple usage](#simple-usage)\n- [Api](#api)\n - [class LinkedList([a list of elements])](#class-linkedlista-list-of-elements)\n - [Attributes](#attributes)\n - [Methods](#methods)\n - [node](#node)\n- [Test](#test)\n\n\n\n
\n\n### What is it?\n\n- An incomprehensive implementation of a doubly-linked list\n\n
\n\n### Why create it?\n\n- I didn't like the api or documentation of other linked lists. I'm also new\n to python so this was a good way to learn.\n\n
\n\n### Simple usage\n\n```py\nfrom another_linked_list import LinkedList\n\n# create a list with three nodes\nll = LinkedList([\"a\", \"b\", \"d\"])\n\n# get the node with element \"b\"\nbNode = ll.findFirstNode(\"b\")\n\n# insert \"c\" after bNode\nll.insertAfter(bNode, \"c\")\n\nprint(list(ll))\n# prints ['a', 'b', 'c', 'd']\n```\n\n
\n\n### Api\n\n#### class LinkedList([a list of elements])\n- the linked list holds a list of [nodes](#node). Each node holds an element\n (the value) along with pointers to the previous and next nodes. For the most\n part the methods are intended to allow you to work with the elements moreso\n than the nodes because that was my use-case. This design decision may change\n in the future to be more focused around the nodes.\n- all methods return `self` unless specified otherwise\n- all methods which take a list argument also accept an instance of LinkedList\n- in all code examples below, assume `ll` starts with `LinkedList([\"a\", \"c\"])`\n- the internal methods implemented are\n - \\_\\_copy\\_\\_\n - \\_\\_iter\\_\\_ (iterates over the elements, **not** the nodes)\n - \\_\\_len\\_\\_\n - \\_\\_reversed\\_\\_\n\n
\n\n#### Attributes\n\n##### firstNode: [node](#node)\n```py\nprint(ll.firstNode.element) # a\n```\n##### lastNode: [node](#node)\n```py\nprint(ll.lastNode.element) # c\n```\n\n
\n\n#### Methods\n\n##### append(element)\n```py\nll.append('d')\nprint(list(ll)) # ['a', 'c', 'd']\n```\n\n##### copy() => LinkedList\n\n##### appendAll(list)\n```py\nll.appendAll(['d', 'e'])\nprint(list(ll)) # ['a', 'c', 'd', 'e']\n```\n\n##### findFirstNode(element) => [node](#node)\n```py\ncNode = ll.findFirstNode(['c'])\nprint(cNode.element) # c\n```\n\n##### insertAfter([node](#node), element)\n```py\nll.insertAfter(ll.firstNode, 'b')\nprint(list(ll)) # ['a', 'b', 'c']\n```\n\n##### insertAllAfter([node](#node), list)\n```py\nll.insertAllAfter(ll.firstNode, ['b', 'd'])\nprint(list(ll)) # ['a', 'b', 'd', 'c']\n```\n\n##### insertAllBefore([node](#node), list)\n```py\nll.insertAllBefore(ll.lastNode, ['b', 'd'])\nprint(list(ll)) # ['a', 'b', 'd', 'c']\n```\n\n##### insertBefore([node](#node), element)\n```py\nll.insertBefore(ll.lastNode, 'b')\nprint(list(ll)) # ['a', 'b', 'c']\n```\n\n##### prepend(element)\n```py\nll.prepend('z')\nprint(list(ll)) # ['z', 'a', 'c']\n```\n\n##### prependAll(list)\n```py\nll.prependAll(['y', 'z'])\nprint(list(ll)) # ['y', 'z', 'a', 'c']\n```\n\n##### removeFirstElement(element)\n```py\nll.removeFirstElement('c')\nprint(list(ll)) # ['a']\n```\n\n##### removeNode([node](#node))\n```py\nll.removeNode(ll.firstNode)\nprint(list(ll)) # ['c']\n```\n\n
\n\n#### node\n- a node is just an instance of SimpleNamespace with three attributes\n - **element**: <can be anything>\n - **next_**: node\n - **previous**: node\n\n```py\nprint(ll.firstNode.element) # a\nprint(ll.firstNode.next_.element) # c\nprint(ll.lastNode.previous.element) # a\nprint(ll.firstNode.previous is None) # True\n```\n\n
\n\n### Test\n\n```sh\n#\n# you must have poetry installed\n#\n$ poetry shell\n$ poetry install\n$ python runTests.py\n```\n",
"description_content_type": "text/markdown",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/olsonpm/py_another-linked-list",
"keywords": "",
"license": "",
"maintainer": "Philip Olson",
"maintainer_email": "philip.olson@pm.me",
"name": "another-linked-list",
"package_url": "https://pypi.org/project/another-linked-list/",
"platform": "",
"project_url": "https://pypi.org/project/another-linked-list/",
"project_urls": {
"Homepage": "https://github.com/olsonpm/py_another-linked-list",
"Repository": "https://github.com/olsonpm/py_another-linked-list"
},
"release_url": "https://pypi.org/project/another-linked-list/0.1.1/",
"requires_dist": null,
"requires_python": ">=3.7,<4.0",
"summary": "A linked list with an api and documentation more to my liking",
"version": "0.1.1"
},
"last_serial": 5289459,
"releases": {
"0.1.0": [
{
"comment_text": "",
"digests": {
"md5": "69638d4de7854c92bee3634c0c9e4b8d",
"sha256": "b9c494a3c6b7de124a9ac1d9fd92e20c7dc608c12dc659a6acfef81b097b56cc"
},
"downloads": -1,
"filename": "another_linked_list-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "69638d4de7854c92bee3634c0c9e4b8d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 30531,
"upload_time": "2019-01-21T07:51:50",
"url": "https://files.pythonhosted.org/packages/63/5c/47b7d8fffc7158ac327ef726807ab85703e6818286e0ee541fbc89813b9d/another_linked_list-0.1.0-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "355a028c9e17dcd09f2a8efd156fc539",
"sha256": "1201c487a3752fb36bad5d17d917431c04105b453c51eac07a0ab5b84ef7479b"
},
"downloads": -1,
"filename": "another_linked_list-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "355a028c9e17dcd09f2a8efd156fc539",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 10172,
"upload_time": "2019-01-21T07:51:52",
"url": "https://files.pythonhosted.org/packages/9a/c0/b298521ab2939c1b9e3783465a4d5bde33c40276f7a782c6398f6874ef3f/another_linked_list-0.1.0.tar.gz"
}
],
"0.1.1": [
{
"comment_text": "",
"digests": {
"md5": "fb45f34adee46eb033c3a1ec30e3dfeb",
"sha256": "ccc2d2a7336b07443830bd50e0d9f47d6760b8bbd2e60b8c1b947f1d75aeb97d"
},
"downloads": -1,
"filename": "another_linked_list-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fb45f34adee46eb033c3a1ec30e3dfeb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 427810,
"upload_time": "2019-05-19T20:24:05",
"url": "https://files.pythonhosted.org/packages/a1/65/34d2c1c1eda9239d37fbbbe879b92d0b8d12cc7e629346e6b7294bdcdd58/another_linked_list-0.1.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "b79b45bf65a6bea3bab4ce48211daa2a",
"sha256": "15af2f29a24c71e6b6027fd1b048a56c8aa2fdc58e5e89f435a80c2851e5abeb"
},
"downloads": -1,
"filename": "another_linked_list-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "b79b45bf65a6bea3bab4ce48211daa2a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 362424,
"upload_time": "2019-05-19T20:24:07",
"url": "https://files.pythonhosted.org/packages/f6/7d/a35354a043cdc7d6141d84dca518b50649fed98162a2831143192ce9e2fe/another_linked_list-0.1.1.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "fb45f34adee46eb033c3a1ec30e3dfeb",
"sha256": "ccc2d2a7336b07443830bd50e0d9f47d6760b8bbd2e60b8c1b947f1d75aeb97d"
},
"downloads": -1,
"filename": "another_linked_list-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fb45f34adee46eb033c3a1ec30e3dfeb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 427810,
"upload_time": "2019-05-19T20:24:05",
"url": "https://files.pythonhosted.org/packages/a1/65/34d2c1c1eda9239d37fbbbe879b92d0b8d12cc7e629346e6b7294bdcdd58/another_linked_list-0.1.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "b79b45bf65a6bea3bab4ce48211daa2a",
"sha256": "15af2f29a24c71e6b6027fd1b048a56c8aa2fdc58e5e89f435a80c2851e5abeb"
},
"downloads": -1,
"filename": "another_linked_list-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "b79b45bf65a6bea3bab4ce48211daa2a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 362424,
"upload_time": "2019-05-19T20:24:07",
"url": "https://files.pythonhosted.org/packages/f6/7d/a35354a043cdc7d6141d84dca518b50649fed98162a2831143192ce9e2fe/another_linked_list-0.1.1.tar.gz"
}
]
}