{"id":24797238,"url":"https://github.com/plotlabs/esgetfamily-python","last_synced_at":"2025-10-04T07:51:14.610Z","repository":{"id":50205516,"uuid":"130975150","full_name":"plotlabs/esgetfamily-python","owner":"plotlabs","description":"Get parent and children documents from Elasticsearch using a single query. ","archived":false,"fork":false,"pushed_at":"2022-12-08T01:00:16.000Z","size":18,"stargazers_count":7,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-01T11:56:28.479Z","etag":null,"topics":["elasticsearch","python"],"latest_commit_sha":null,"homepage":"https://www.plotlabs.io","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/plotlabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-25T08:30:18.000Z","updated_at":"2025-02-06T14:19:10.000Z","dependencies_parsed_at":"2023-01-24T09:31:03.714Z","dependency_job_id":null,"html_url":"https://github.com/plotlabs/esgetfamily-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/plotlabs/esgetfamily-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotlabs%2Fesgetfamily-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotlabs%2Fesgetfamily-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotlabs%2Fesgetfamily-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotlabs%2Fesgetfamily-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plotlabs","download_url":"https://codeload.github.com/plotlabs/esgetfamily-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plotlabs%2Fesgetfamily-python/sbom","scorecard":{"id":738037,"data":{"date":"2025-08-11","repo":{"name":"github.com/plotlabs/esgetfamily-python","commit":"17312aaa447b5b2877203bb6475d428baa6191c1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/13 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"12 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2022-42986 / GHSA-43fp-rhv2-5gv8","Warn: Project is vulnerable to: PYSEC-2023-135 / GHSA-xqr8-7jwr-rhp7","Warn: Project is vulnerable to: GHSA-34jh-p97f-mpxf","Warn: Project is vulnerable to: PYSEC-2023-212 / GHSA-g4mx-q9vg-27p4","Warn: Project is vulnerable to: PYSEC-2023-207 / GHSA-gwvm-45gx-3cf8","Warn: Project is vulnerable to: PYSEC-2019-133 / GHSA-mh33-7rrq-662w","Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v","Warn: Project is vulnerable to: PYSEC-2019-132 / GHSA-r64q-w8jr-g9qp","Warn: Project is vulnerable to: PYSEC-2023-192 / GHSA-v845-jxx5-vc9f","Warn: Project is vulnerable to: PYSEC-2020-148 / GHSA-wqvq-5m8c-6g24","Warn: Project is vulnerable to: PYSEC-2018-32 / GHSA-www2-v7xj-xrc6","Warn: Project is vulnerable to: PYSEC-2021-108"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-22T16:29:21.178Z","repository_id":50205516,"created_at":"2025-08-22T16:29:21.179Z","updated_at":"2025-08-22T16:29:21.179Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278283455,"owners_count":25961311,"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-10-04T02:00:05.491Z","response_time":63,"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":["elasticsearch","python"],"created_at":"2025-01-30T01:18:53.467Z","updated_at":"2025-10-04T07:51:14.570Z","avatar_url":"https://github.com/plotlabs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elasticsearch: Get Family - Python\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/plotlabs/esgetfamily-python/blob/master/LICENSE.txt) [![Build Status](https://travis-ci.org/plotlabs/esgetfamily-python.svg?branch=master)](https://travis-ci.org/plotlabs/esgetfamily-python) [![CodeFactor](https://www.codefactor.io/repository/github/plotlabs/esgetfamily-python/badge)](https://www.codefactor.io/repository/github/plotlabs/esgetfamily-python) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://www.plotlabs.io/) [![PyPI](https://img.shields.io/pypi/v/esgetfamily.svg)](https://pypi.org/project/esgetfamily/)\n\n_This package returns the parent and its children together. This is compatible with elasticsearch version \u003e=5.0.0,\u003c6.0.0._\n\n```python\nfrom elasticsearch import Elasticsearch  \nimport esgetfamily\n\ndef get_es_object():  \n    es = Elasticsearch(elastic_cred)  \n    return es  \n\nes_db = get_es_object()  \n```\n\n\u003e **For single parent:**\n\n```python\nparents = es_db.get(index=parent_index, doc_type=parent_type, id=parent_id)  \nfinal = esgetfamily.parent_child(es_db, parents, child_type)\n```\n\n\u003e **For single parent with query for child:**\n\n```python\nquery = {  \n    \"match\": {  \n        \"id\": 1  \n    }  \n}\n\nparents = es_db.get(index=parent_index, doc_type=parent_type, id=parent_id)  \nfinal = esgetfamily.parent_child(es_db, parents, child_type, query)\n```\n\n\u003e **For multiple parents:**\n\n```python\nparents = [es_db.get(index=parent_index, doc_type=parent_type, id=parent_id),  \n           es_db.get(index=parent_index, doc_type=parent_type, id=parent_id)]\nfinal = esgetfamily.parent_child(es_db, parents, child_type)\n```\n\n\u003e **For multiple parents with query for child:**\n\n```python\nquery = {  \n    \"match\": {  \n        \"id\": 1  \n    }  \n}\n\nparents = [es_db.get(index=parent_index, doc_type=parent_type, id=parent_id),  \n           es_db.get(index=parent_index, doc_type=parent_type, id=parent_id)]  \nfinal = esgetfamily.parent_child(es_db, parents, child_type, query)\n```\n\n\u003e **Sample Example:**\n\n#### Code:\n\n```python\nfrom elasticsearch import Elasticsearch\ndef get_es_object():  \n    es = Elasticsearch(elastic_cred)  \n    return es  \nes_db = get_es_object()  \nimport esgetfamily, json\n\nparents = es_db.get(index=\"parent\", doc_type=\"par\", id=3)\nfinal = esgetfamily.parent_child(es_db, parents, \"child\")\nprint json.dumps(final, indent=3)\n```\n\n#### Result:\n\n```json\n{\n  \"3\": {\n    \"parent\": {\n      \"_type\": \"par\",\n      \"_source\": {\n        \"age\": 23,\n        \"id\": 3,\n        \"name\": \"ABC\"\n      },\n      \"_index\": \"parent\",\n      \"_version\": 1,\n      \"found\": true,\n      \"_id\": \"3\"\n    },\n    \"child\": [\n      {\n        \"_type\": \"child\",\n        \"_routing\": \"3\",\n        \"_index\": \"parent\",\n        \"_score\": 1.0,\n        \"_source\": {\n          \"id\": 1,\n          \"name\": \"Child1\"\n        },\n        \"_parent\": \"3\",\n        \"_id\": \"1\"\n      },\n      {\n        \"_type\": \"child\",\n        \"_routing\": \"3\",\n        \"_index\": \"parent\",\n        \"_score\": 1.0,\n        \"_source\": {\n          \"id\": 2,\n          \"name\": \"Child2\"\n        },\n        \"_parent\": \"3\",\n        \"_id\": \"2\"\n      }\n    ]\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplotlabs%2Fesgetfamily-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplotlabs%2Fesgetfamily-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplotlabs%2Fesgetfamily-python/lists"}