{"id":18902837,"url":"https://github.com/Ankvik-Tech-Labs/mantaray-py","last_synced_at":"2025-04-15T02:37:08.943Z","repository":{"id":241843767,"uuid":"808014477","full_name":"Ankvik-Tech-Labs/mantaray-py","owner":"Ankvik-Tech-Labs","description":"Mantaray data structure in python","archived":false,"fork":false,"pushed_at":"2024-11-18T03:12:16.000Z","size":143,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-29T04:45:53.492Z","etag":null,"topics":["data-structures","hatch","hatchling","mantaray","python","python12","python3","python310","python311","python39","virtualenv"],"latest_commit_sha":null,"homepage":"https://ankvik-tech-labs.github.io/mantaray-py/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ankvik-Tech-Labs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/funding.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["aviksaikat"],"buy_me_a_coffee":"aviksaikat","patreon":"CyberPuzzlePros","polar":"aviksaikat","custom":["https://www.paypal.me/aviksaikat007"]}},"created_at":"2024-05-30T08:03:49.000Z","updated_at":"2024-06-23T15:34:36.000Z","dependencies_parsed_at":"2024-06-27T23:02:44.106Z","dependency_job_id":null,"html_url":"https://github.com/Ankvik-Tech-Labs/mantaray-py","commit_stats":null,"previous_names":["ankvik-technologies/mantaray-py","ankvik-tech-labs/mantaray-py"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ankvik-Tech-Labs%2Fmantaray-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ankvik-Tech-Labs%2Fmantaray-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ankvik-Tech-Labs%2Fmantaray-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ankvik-Tech-Labs%2Fmantaray-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ankvik-Tech-Labs","download_url":"https://codeload.github.com/Ankvik-Tech-Labs/mantaray-py/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248995103,"owners_count":21195497,"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":["data-structures","hatch","hatchling","mantaray","python","python12","python3","python310","python311","python39","virtualenv"],"created_at":"2024-11-08T09:01:34.051Z","updated_at":"2025-04-15T02:37:08.526Z","avatar_url":"https://github.com/Ankvik-Tech-Labs.png","language":"Python","funding_links":["https://github.com/sponsors/aviksaikat","https://buymeacoffee.com/aviksaikat","https://patreon.com/CyberPuzzlePros","https://polar.sh/aviksaikat","https://www.paypal.me/aviksaikat007"],"categories":["Projects"],"sub_categories":["Libraries"],"readme":"# mantaray py\n\n\u003cp align=\"center\"\u003e\n    \u003cem\u003eMantaray data structure in Python\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n| Feature       | Value                     |\n| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Technology    | [![Python](https://img.shields.io/badge/Python-3776AB.svg?style=flat\u0026logo=Python\u0026logoColor=white)](https://www.python.org/) [![Hatch project](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5.svg)](https://github.com/pypa/hatch) [![GitHub Actions](https://img.shields.io/badge/GitHub%20Actions-2088FF.svg?style=flat\u0026logo=GitHub-Actions\u0026logoColor=white)](https://github.com/features/actions) [![Pytest](https://img.shields.io/badge/Pytest-0A9EDC.svg?style=flat\u0026logo=Pytest\u0026logoColor=white)](https://github.com/Ankvik-Tech-Labs/mantaray-py/actions/workflows/tests.yml/badge.svg)                           |\n| Type Checking | [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)                                                                                                                                                                                                                                                                                                                                                                                                                                                     |\n| CI/CD         | [![Release](https://github.com/Ankvik-Tech-Labs/mantaray-py/actions/workflows/release.yml/badge.svg)](https://github.com/Ankvik-Tech-Labs/mantaray-py/actions/workflows/build.yml) [![Tests](https://github.com/Ankvik-Tech-Labs/mantaray-py/actions/workflows/tests.yml/badge.svg)](https://github.com/Ankvik-Tech-Labs/mantaray-py/actions/workflows/tests.yml) [![Labeler](https://github.com/Ankvik-Tech-Labs/mantaray-py/actions/workflows/labeler.yml/badge.svg)](https://github.com/Ankvik-Tech-Labs/mantaray-py/actions/workflows/labeler.yml) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white)](https://github.com/pre-commit/pre-commit) [![codecov](https://codecov.io/gh/Ankvik-Tech-Labs/mantaray-py/graph/badge.svg?token=ISTIW37DO6)](https://codecov.io/gh/Ankvik-Tech-Labs/mantaray-py)                                                                                                                                                                                                           |\n| Docs          | [![Docs](https://github.com/Ankvik-Tech-Labs/mantaray-py/actions/workflows/documentation.yml/badge.svg)](https://github.com/Ankvik-Tech-Labs/mantaray-py/actions/workflows/build.yml)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\n| Package       | [![PyPI - Version](https://img.shields.io/pypi/v/mantaray-py.svg)](https://pypi.org/project/mantaray-py/) [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/mantaray-py)](https://pypi.org/project/mantaray-py/) [![PyPI - License](https://img.shields.io/pypi/l/mantaray-py)](https://pypi.org/project/mantaray-py/)                                                                                                                                                                                                                                                                                                                                                                                                        |\n| Meta          | [![GitHub license](https://img.shields.io/github/license/Ankvik-Tech-Labs/mantaray-py?style=flat\u0026color=1573D5)](https://github.com/Ankvik-Tech-Labs/mantaray-py/blob/main/LICENSE) [![GitHub last commit](https://img.shields.io/github/last-commit/Ankvik-Tech-Labs/mantaray-py?style=flat\u0026color=1573D5)](https://github.com/Ankvik-Tech-Labs/mantaray-py/commits/main) [![GitHub commit activity](https://img.shields.io/github/commit-activity/m/Ankvik-Tech-Labs/mantaray-py?style=flat\u0026color=1573D5)](https://github.com/Ankvik-Tech-Labs/mantaray-py/graphs/commit-activity) [![GitHub top language](https://img.shields.io/github/languages/top/Ankvik-Tech-Labs/mantaray-py?style=flat\u0026color=1573D5)](https://github.com/Ankvik-Tech-Labs/mantaray-py) |\n\n\u003c/div\u003e\n\n# Description\n\nWith this package you can manipulate and interpret mantaray data via `MantarayNode` and `MantarayFork` abstractions.\n\n# Installation\n\n- Install using `pip`\n```py\npip install mantaray_py\n```\n\n# Usage\n\n### Construct Mantaray\n\n```py\nfrom mantaray_py import MantarayNode, MantarayFork, init_manifest_node, gen_32_bytes\n\nnode = init_manifest_node()\naddress1 = gen_32_bytes()\naddress2 = gen_32_bytes()\naddress3 = gen_32_bytes()\naddress4 = gen_32_bytes()\naddress5 = gen_32_bytes()\naddress6 = gen_32_bytes()\n\npath1 = \"path1/valami/elso\".encode()\npath2 = \"path1/valami/masodik\".encode()\npath3 = \"path1/valami/masodik.ext\".encode()\npath4 = \"path1/valami\".encode()\npath5 = \"path2\".encode()\npath6 = \"path3/haha\".encode()\n\nnode.add_fork(path1, address1, { \"vmi\": \"elso\" })\nnode.add_fork(path2, address2)\nnode.add_fork(path3, address3)\nnode.add_fork(path4, address4, {\"vmi\": \"negy\"})\nnode.add_fork(path5, address5)\nnode.add_fork(path6, address6, {\"vmi\": \"haha\"})\nnode.remove_path(path3)\n\nprint(node)\n```\n\n### Mantaray Storage Operations\n\n```py\nfrom mantaray_py import MantarayNode\n\nnode = MantarayNode()\n\"\"\"\nhere `reference` parameter is a `Reference` type which can be a 32 or 64 of bytes\nand `load_function` is a [load_function: (address: bytes): bytes] typed function\nthat returns the serialised raw data of a MantarayNode of the given reference. See tests/integration/test_int.py file for reference.\n\"\"\"\nnode.load(load_function, reference)\n\n# Manipulate `node` object then save it again\n# (...)\n\n# save into the storage with a storage handler [save_function: (data: bytes): Reference]\n# See tests/integration/test_int.py file for reference.\nreference = node.save(save_function)\n```\n\n\n\n\u003cdetails open\u003e\n\u003csummary\u003eHow It Works\u003c/summary\u003e\n\u003cbr\u003e\n\n# node binary format\n\nThe following describes the format of a node binary format.\n\n```\n┌────────────────────────────────┐\n│    obfuscationKey \u003c32 byte\u003e    │\n├────────────────────────────────┤\n│ hash(\"mantaray:0.1\") \u003c31 byte\u003e │\n├────────────────────────────────┤\n│     refBytesSize \u003c1 byte\u003e      │\n├────────────────────────────────┤\n│       entry \u003c32/64 byte\u003e       │\n├────────────────────────────────┤\n│   forksIndexBytes \u003c32 byte\u003e    │\n├────────────────────────────────┤\n│ ┌────────────────────────────┐ │\n│ │           Fork 1           │ │\n│ ├────────────────────────────┤ │\n│ │            ...             │ │\n│ ├────────────────────────────┤ │\n│ │           Fork N           │ │\n│ └────────────────────────────┘ │\n└────────────────────────────────┘\n```\n\n## Fork\n\n```\n┌───────────────────┬───────────────────────┬──────────────────┐\n│ nodeType \u003c1 byte\u003e │ prefixLength \u003c1 byte\u003e │ prefix \u003c30 byte\u003e │\n├───────────────────┴───────────────────────┴──────────────────┤\n│                    reference \u003c32/64 bytes\u003e                   │\n│                                                              │\n└──────────────────────────────────────────────────────────────┘\n```\n\n### Fork with metadata\n\n```\n┌───────────────────┬───────────────────────┬──────────────────┐\n│ nodeType \u003c1 byte\u003e │ prefixLength \u003c1 byte\u003e │ prefix \u003c30 byte\u003e │\n├───────────────────┴───────────────────────┴──────────────────┤\n│                    reference \u003c32/64 bytes\u003e                   │\n│                                                              │\n├─────────────────────────────┬────────────────────────────────┤\n│ metadataBytesSize \u003c2 bytes\u003e │     metadataBytes \u003cvarlen\u003e     │\n├─────────────────────────────┘                                │\n│                                                              │\n└──────────────────────────────────────────────────────────────┘\n```\n\n\u003c/details\u003e\n\n\n---\n\n**Documentation**: \u003ca href=\"https://Ankvik-Tech-Labs.github.io/mantaray-py/\" target=\"_blank\"\u003ehttps://Ankvik-Tech-Labs.github.io/mantaray-py/\u003c/a\u003e\n\n**Source Code**: \u003ca href=\"https://github.com/Ankvik-Tech-Labs/mantaray-py\" target=\"_blank\"\u003ehttps://github.com/Ankvik-Tech-Labs/mantaray-py\u003c/a\u003e\n\n---\n\n\u003cdetails close\u003e\n\u003csummary\u003eDevelopment\u003c/summary\u003e\n\u003cbr\u003e\n\n## Development\n\n### Setup environment\n\nWe use [Hatch](https://hatch.pypa.io/latest/install/) to manage the development environment and production build. Ensure it's installed on your system.\n\n### Run unit tests\n\nYou can run all the tests with:\n\n```bash\nhatch run test:test\n```\n\n### Format the code\n\nExecute the following command to apply linting and check typing:\n\n```bash\nhatch run lint:lint-check\n```\n\n### Publish a new version\n\nYou can bump the version, create a commit and associated tag with one command:\n\n```bash\nhatch version patch\n```\n\n```bash\nhatch version minor\n```\n\n```bash\nhatch version major\n```\n\nYour default Git text editor will open so you can add information about the release.\n\nWhen you push the tag on GitHub, the workflow will automatically publish it on PyPi and a GitHub release will be created as draft.\n\n## Serve the documentation\n\nYou can serve the Mkdocs documentation with:\n\n```bash\nhatch run docs:docs-serve\n```\n\nIt'll automatically watch for changes in your code.\n\n\u003c/details\u003e\n\n## License\n\nThis project is licensed under the terms of the [BSD 3-Clause License](https://github.com/Ankvik-Tech-Labs/mantaray-py/blob/main/LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAnkvik-Tech-Labs%2Fmantaray-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAnkvik-Tech-Labs%2Fmantaray-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAnkvik-Tech-Labs%2Fmantaray-py/lists"}