{"id":19402774,"url":"https://github.com/cscfi/beacon-python","last_synced_at":"2025-04-24T07:32:26.958Z","repository":{"id":33577271,"uuid":"133498037","full_name":"CSCfi/beacon-python","owner":"CSCfi","description":"Python-based GA4GH Beacon API Server","archived":false,"fork":false,"pushed_at":"2023-10-17T00:04:51.000Z","size":7084,"stargazers_count":8,"open_issues_count":11,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2023-10-20T19:07:02.628Z","etag":null,"topics":["api","beacon","elixir-beacon","elixir-europe","ga4gh","life-sciences","python3"],"latest_commit_sha":null,"homepage":"https://beacon-python.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CSCfi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-05-15T10:10:52.000Z","updated_at":"2023-10-21T10:42:01.407Z","dependencies_parsed_at":"2023-09-26T05:04:16.450Z","dependency_job_id":"813ac7cc-2b5f-4059-a9fa-e4d4c658f957","html_url":"https://github.com/CSCfi/beacon-python","commit_stats":null,"previous_names":[],"tags_count":20,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSCfi%2Fbeacon-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSCfi%2Fbeacon-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSCfi%2Fbeacon-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CSCfi%2Fbeacon-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CSCfi","download_url":"https://codeload.github.com/CSCfi/beacon-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223945425,"owners_count":17229625,"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":["api","beacon","elixir-beacon","elixir-europe","ga4gh","life-sciences","python3"],"created_at":"2024-11-10T11:25:47.513Z","updated_at":"2024-11-10T11:25:48.034Z","avatar_url":"https://github.com/CSCfi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Archival Notice\n`beacon-python` was developed for ELIXIR Beacon implementation studies [2018](https://elixir-europe.org/internal-projects/commissioned-services/beacon-network-service) and [2019-2021](https://elixir-europe.org/internal-projects/commissioned-services/beacon-2019-21). Development on the Beacon v1 specification has ceased, and a new Beacon v2 specification has been finalised, and is being adopted by beacon providers.\n\nUsers are encouraged to move to the next iteration of [Beacon v2 Reference Implementation](https://github.com/EGA-archive/beacon2-ri-api). Beacon v2 development can be followed at [GA4GH Beacon v2 Project](https://beacon-project.io/).\n\nWe thank all parties that have been involved with us in the development of the Beacon v1 products past these years.\n\n## beacon-python - Python-based Beacon API Web Server\n\n![Integration Tests](https://github.com/CSCfi/beacon-python/workflows/Integration%20Tests/badge.svg)\n![Python Unit Tests](https://github.com/CSCfi/beacon-python/workflows/Python%20Unit%20Tests/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/CSCfi/beacon-python/badge.svg?branch=HEAD)](https://coveralls.io/github/CSCfi/beacon-python?branch=HEAD)\n[![Documentation Status](https://readthedocs.org/projects/beacon-python/badge/?version=latest)](https://beacon-python.readthedocs.io/en/latest/?badge=latest)\n\nDocumentation: https://beacon-python.readthedocs.io\n\n### Quick start\n\n`beacon-python` Web Server requires:\n* Python 3.10+;\n* running DB [PostgreSQL Server](https://www.postgresql.org/) 9.6+ (recommended 13).\n\n```shell\ngit clone https://github.com/CSCfi/beacon-python\npip install -r requirements.txt\ncd beacon-python\n```\n\n#### Database start\n\nStart the PostgreSQL DB server and set up `POSTGRES_USER` and `POSTGRES_PASSWORD` as `beacon` and `POSTGRES_DB` as `beacondb` (default values, that can be changed via environment variables - see [documentation](https://beacon-python.readthedocs.io) for instructions).\n\nIt is recommended to start PostgreSQL using [Docker](https://www.docker.com/):\n\n```shell\ndocker run -e POSTGRES_USER=beacon \\\n           -e POSTGRES_PASSWORD=beacon \\\n           -v \"$PWD/data\":/docker-entrypoint-initdb.d \\\n           -e POSTGRES_DB=beacondb \\\n           -p 5432:5432 postgres:13\n```\n\n#### Run beacon-python\n\nFor installing `beacon-python` do the following:\n\n```shell\npip install .\n```\n\n#### Loading Data\n\nIf one has their own database the ``beacon_init`` utility can be skipped, and make use of the existing database by:\n* creating a DB View that matches the DB schema for the beacon python server see: [Database](https://beacon-python.readthedocs.io/en/latest/db.html) documentation for information on the database schema and queries;\n* migrating the database to match the [Database](https://beacon-python.readthedocs.io/en/latest/db.html) schema;\n* modifying the queries in [beacon_api.utils.data_query.py](beacon_api/utils/data_query.py) in order to fit one's own database.\n\nFor loading `*.vcf`/`*.vcf.gz` files into the database we provide the `beacon_init` utility:\n```shell\n╰─$ beacon_init --help             \nusage: beacon_init [-h] datafile metadata\n\nLoad datafiles with associated metadata into the beacon database. See example\ndata and metadata files in the /data directory.\n\npositional arguments:\n  datafile    .vcf file containing variant information\n  metadata    .json file containing metadata associated to datafile\n\noptional arguments:\n  -h, --help  show this help message and exit\n```\n\nRun the `beacon-python` Web Server from the command line simply using:\n```shell\nbeacon\n```\n\n### Using the application\n\nThe API has three endpoints, the info endpoint `/`, a second info endpoint `/service-info` for GA4GH compliancy, and the query end point `/query`. The info end point\ngives the user general info about the Beacon and it's datasets, while the query end point allows to\nretrieve dataset information based on specific parameters. The GA4GH info endpoint serves a minimal data payload.\n\nFor information about the endpoints and parameters consult the [Beacon API specification](https://github.com/ga4gh-beacon/specification/blob/develop/beacon.md)\n\n#### Info endpoint\n\nRequest:\n- URL: `/`\n- HTTP method: `GET`\n- Parameters: `None`\n\n#### GA4GH Info endpoint\n\nRequest:\n- URL: `/service-info`\n- HTTP method: `GET`\n- Parameters: `None`\n\n#### Query endpoint\n\nRequest:\n- URL: `/query`\n- HTTP method: `GET` and `POST`\n- Parameters: Refer to [Beacon API specification](https://github.com/ga4gh-beacon/specification/blob/develop/beacon.md) for full list of parameters.\n\n### License\n\n`beacon-python` and all it sources are released under `Apache License 2.0`.\n\n### Acknowledgements\n\nWe would like to acknowledge the valuable feedback from the members of [NBIS](https://nbis.se/) and [DDBJ](https://www.ddbj.nig.ac.jp), whose ideas and contributions have helped to make the Beacon services more robust.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcscfi%2Fbeacon-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcscfi%2Fbeacon-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcscfi%2Fbeacon-python/lists"}