{"id":15297424,"url":"https://github.com/opal-project/opalalgorithms","last_synced_at":"2025-04-13T23:15:58.273Z","repository":{"id":57448934,"uuid":"117083478","full_name":"OPAL-Project/opalalgorithms","owner":"OPAL-Project","description":"Algorithms for OPAL Project.","archived":false,"fork":false,"pushed_at":"2023-12-15T02:23:06.000Z","size":87,"stargazers_count":9,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-13T23:15:45.755Z","etag":null,"topics":["algorithm","opal","python"],"latest_commit_sha":null,"homepage":null,"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/OPAL-Project.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-11T10:09:17.000Z","updated_at":"2023-01-03T16:46:30.000Z","dependencies_parsed_at":"2024-10-15T03:21:53.349Z","dependency_job_id":"f7a3092e-e2f2-4c3e-a0c0-61c51fa5f76c","html_url":"https://github.com/OPAL-Project/opalalgorithms","commit_stats":{"total_commits":80,"total_committers":4,"mean_commits":20.0,"dds":"0.19999999999999996","last_synced_commit":"d575747f2e45672b88f2545ff79c9ae771e483a6"},"previous_names":["shubhamjain0594/opalalgorithms"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OPAL-Project%2Fopalalgorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OPAL-Project%2Fopalalgorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OPAL-Project%2Fopalalgorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OPAL-Project%2Fopalalgorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OPAL-Project","download_url":"https://codeload.github.com/OPAL-Project/opalalgorithms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248794569,"owners_count":21162615,"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":["algorithm","opal","python"],"created_at":"2024-09-30T19:17:25.498Z","updated_at":"2025-04-13T23:15:58.250Z","avatar_url":"https://github.com/OPAL-Project.png","language":"Python","readme":"# OPAL Algorithms\n\n[![Build Status](https://travis-ci.org/OPAL-Project/opalalgorithms.svg?branch=master)](https://travis-ci.org/OPAL-Project/opalalgorithms)\n\nAlgorithms for OPAL Project. This repo contains python library of algorithms being used in OPAL Project. To implement any new algorithm, install this library, create a new class by inheriting the base class. Implement `map` function which takes `bandicoot` user and `params` for the algorithm.\n\nEach algorithm runs in a sandboxed environment. We use [codejail](https://github.com/edx/codejail) for sandboxing. Codejail uses [apparmor](https://wiki.ubuntu.com/AppArmor) to ensure a proper sandboxed environment.\n\n## Installation\n\nBefore you setup the library, it is very important you setup the codejail environment. Instructions for setting up can be found [here](https://github.com/edx/codejail). You will have to setup some environmental variables before setup.\n\n```bash\nexport OPALALGO_SANDBOX_VENV=/path/to/sandbox/environment\nexport OPALALGO_SANDBOX_USER=sandbox-user\n```\n\nOPALAlgorithms works both in python 2.7 and python 3.6 environments. Before proceeding it is strictly recommended you activate virtualenv of python 2.7 or python 3.6 .To install follow the following steps:\n\n```bash\ngit clone https://github.com/shubhamjain0594/opalalgorithms.git\ncd opalalgorithms\npip install -r requirements.txt\npython setup.py install\n```\n\nTo run tests\n\n```bash\ncd tests\nbash test.sh\n```\n\n## Usage Instructions\n\nThis library is to be used for writing new algorithms to be run on OPAL Platform. To write any new algorithm, you will have to inherit `opal.core.OPALAlgorithm` and implement `map` function. Ensure that you do not import any functions from external file and all the helper functions are available in the single file containing Algorithm class.\n\n`map` function will get `params` which are the parameters of the request and [`bandicoot_user`](http://bandicoot.mit.edu/docs/reference/generated/bandicoot.User.html#bandicoot.User)\n\nAlso do ensure that you do not install any packages, except the ones installed by the opalalgorithm package.\n\nA sample algorithm implementation for finding population density can be found at `tests/sample_algos/algo1.py`.\n\nUse `tests/generate_data.py` for generating synthetic data for testing. Take a look at `tests/test.sh` and `tests/test_algos.py` to check how to test your algorithm implementation.\n\n## Documentation\n\nPlease find hosted documentation [here](http://opalalgorithms.readthedocs.io/en/latest/index.html).\n\n## TODO\n\n- Codejail setup for memory and other restrictions\n\n## Notes\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopal-project%2Fopalalgorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopal-project%2Fopalalgorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopal-project%2Fopalalgorithms/lists"}