{"id":31289213,"url":"https://github.com/talamus/python-relatable","last_synced_at":"2025-09-24T13:56:25.710Z","repository":{"id":63006535,"uuid":"562933054","full_name":"talamus/python-relatable","owner":"talamus","description":"An easier way to manipulate tabular data that has complex references.","archived":false,"fork":false,"pushed_at":"2022-11-11T10:56:04.000Z","size":47,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-24T13:56:25.028Z","etag":null,"topics":["data-structures","database","python"],"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/talamus.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}},"created_at":"2022-11-07T15:03:29.000Z","updated_at":"2022-11-29T08:42:39.000Z","dependencies_parsed_at":"2023-01-22T14:46:05.138Z","dependency_job_id":null,"html_url":"https://github.com/talamus/python-relatable","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/talamus/python-relatable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talamus%2Fpython-relatable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talamus%2Fpython-relatable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talamus%2Fpython-relatable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talamus%2Fpython-relatable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/talamus","download_url":"https://codeload.github.com/talamus/python-relatable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talamus%2Fpython-relatable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276761906,"owners_count":25700223,"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-09-24T02:00:09.776Z","response_time":97,"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":["data-structures","database","python"],"created_at":"2025-09-24T13:56:24.408Z","updated_at":"2025-09-24T13:56:25.705Z","avatar_url":"https://github.com/talamus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RelaTable\n## A relational database -like table of rows.\n\nSupports foreign key -style referencing to an another `RelaTable` or other containers.\n\n### An Example\n\n```python\nfrom relatable import RelaTable\n\ncolors = [\"red\", \"blue\", \"green\"]\npet_names = {\"dog\": \"Musti\", \"cat\": \"Mirri\"}\n\npersons = RelaTable(\n    primary_key_column=\"id\",\n    foreign_keys={\"color\": colors},\n    rows=[\n        {\"id\": 123, \"name\": \"Jaakko\", \"color\": 0},\n        {\"id\": 456, \"name\": \"Teppo\", \"color\": 1},\n    ],\n)\n\n# Insert new user in the middle of the table\npersons.insert(1, {\"id\": 789, \"name\": \"Seppo\", \"color\": 2})\n\npets = RelaTable(\n    # No primary key defined =\u003e index is used\n    foreign_keys={\"name\": pet_names, \"owner\": persons},\n    rows=[\n        {\"name\": \"cat\", \"owner\": 123},  # index 0\n        {\"name\": \"dog\", \"owner\": 456},  # index 1\n    ],\n)\n\nprint(persons)\n# Prints out:\n#   [{'id': 123, 'name': 'Jaakko', 'color': 'red'},\n#    {'id': 789, 'name': 'Seppo', 'color': 'green'},\n#    {'id': 456, 'name': 'Teppo', 'color': 'blue'}]\n\nprint(pets)\n# Prints out:\n#   [{'name': 'Mirri', 'owner': {'id': 123, 'name': 'Jaakko', 'color': 'red'}},\n#    {'name': 'Musti', 'owner': {'id': 456, 'name': 'Teppo', 'color': 'blue'}}]\n\nprint(persons[789].name)\n# Prints out:\n#   Seppo\n\nprint(pets[0].owner.color)\n# Prints out:\n#   red\n\nprint(pets[0].data())\n# Prints out the non-expanded row data:\n#   {'name': 'cat', 'owner': 123}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalamus%2Fpython-relatable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftalamus%2Fpython-relatable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalamus%2Fpython-relatable/lists"}