# AIcrowd API
[![Build Status](https://travis-ci.com/AIcrowd/aicrowd_api.svg?token=thqphyYGsxAAMBx7geLi&branch=master)](https://travis-ci.com/AIcrowd/aicrowd_api)
Python client for server side API of the [aicrowd.com](https://www.aicrowd.com) webapp.
* Free software: GNU General Public License v3
* Documentation: https://aicrowd-api.readthedocs.io.
# Installation
## Deployment
```bash
pip install git+https://github.com/AIcrowd/aicrowd_api.git
```
## Development
```bash
git clone https://github.com/AIcrowd/aicrowd_api
cd aicrowd_api
pip install -r requirements_dev.txt
pip install -e .
```
# Usage
## Instantiate API object
```python
from aicrowd_api import API as AICROWD_API
auth_token="<YOUR AICROWD AUTH TOKEN>"
api = AICROWD_API(auth_token)
```
## Authenticate participant
* with `API_KEY`
```python
api.authenticate_participant(EXAMPLE_API_KEY)
```
* with `username`
```python
api_key = api.authenticate_participant_with_username("spMohanty")
```
## Get all Submissions
```python
challenge_id = "test_challenge"
submissions = api.get_all_submissions(challenge_id)
print(submissions)
```
## Create Submission
```python
challenge_id = "test_challenge"
submission = api.create_submission(challenge_id)
print(submission)
# Output
# ========================================
# AIcrowdSubmission : 5261
# challenge_id : test_challenge
# round_id : False
# score : False
# score_secondary : False
# grading_status : submitted
# message :
# ========================================
```
## Get submission
```python
challenge_id = "test_challenge"
submission_id = 5262
submission = api.get_submission(challenge_id, submission_id)
```
## Update submission
Assuming you have a `submission` object by using `api.create_submission` or `api.get_submission`.
You can update the submission by :
```python
# Update params
submission.grading_status = "graded"
submission.score = 0.98
submission.score_secondary = 0.98
submission.update()
print(submission)
# Output#
# ========================================
# AIcrowdSubmission : 5262
# challenge_id : test_challenge
# round_id : False
# score : 0.98
# score_secondary : 0.98
# grading_status : graded
# message :
# ========================================
```
# Tests
```bash
# Setup the environment varriables
cp environ.sh.example environ.sh
# Then modify the respective environment variables
source environ.sh
pytests tests/
```
# Author
S.P.Mohanty <mohanty@aicrowd.com>
Arjun Nemani <nemani@aicrowd.com>
Raw data
{
"_id": null,
"home_page": "https://github.com/AIcrowd/aicrowd_api",
"name": "aicrowd-api",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "aicrowd_api aicrowd crowdai_api crowdai",
"author": "S.P. Mohanty",
"author_email": "mohanty@aicrowd.com",
"download_url": "https://files.pythonhosted.org/packages/bd/02/893a50e8888a305eacb96636512936153415d4b0bc24b32a684d37bde95a/aicrowd_api-0.1.25.tar.gz",
"platform": null,
"description": "# AIcrowd API\n[![Build Status](https://travis-ci.com/AIcrowd/aicrowd_api.svg?token=thqphyYGsxAAMBx7geLi&branch=master)](https://travis-ci.com/AIcrowd/aicrowd_api)\n\nPython client for server side API of the [aicrowd.com](https://www.aicrowd.com) webapp.\n\n* Free software: GNU General Public License v3\n* Documentation: https://aicrowd-api.readthedocs.io.\n\n# Installation\n## Deployment\n```bash\npip install git+https://github.com/AIcrowd/aicrowd_api.git\n```\n\n## Development\n```bash\ngit clone https://github.com/AIcrowd/aicrowd_api\ncd aicrowd_api\npip install -r requirements_dev.txt\npip install -e .\n```\n\n# Usage\n## Instantiate API object\n```python\nfrom aicrowd_api import API as AICROWD_API\nauth_token=\"<YOUR AICROWD AUTH TOKEN>\"\napi = AICROWD_API(auth_token)\n```\n\n## Authenticate participant\n* with `API_KEY`\n```python\napi.authenticate_participant(EXAMPLE_API_KEY)\n```\n\n* with `username`\n```python\napi_key = api.authenticate_participant_with_username(\"spMohanty\")\n```\n\n## Get all Submissions\n```python\n\nchallenge_id = \"test_challenge\"\nsubmissions = api.get_all_submissions(challenge_id)\nprint(submissions)\n```\n\n## Create Submission\n```python\nchallenge_id = \"test_challenge\"\nsubmission = api.create_submission(challenge_id)\nprint(submission)\n\n# Output\n# ========================================\n# AIcrowdSubmission\t:\t5261\n# \tchallenge_id\t:\ttest_challenge\n# \tround_id\t:\tFalse\n# \tscore\t:\tFalse\n# \tscore_secondary\t:\tFalse\n# \tgrading_status\t:\tsubmitted\n# \tmessage\t:\n# ========================================\n```\n\n## Get submission\n```python\nchallenge_id = \"test_challenge\"\nsubmission_id = 5262\nsubmission = api.get_submission(challenge_id, submission_id)\n```\n\n## Update submission\nAssuming you have a `submission` object by using `api.create_submission` or `api.get_submission`.\nYou can update the submission by :\n\n```python\n# Update params\nsubmission.grading_status = \"graded\"\nsubmission.score = 0.98\nsubmission.score_secondary = 0.98\nsubmission.update()\nprint(submission)\n# Output#\n# ========================================\n# AIcrowdSubmission\t:\t5262\n# \tchallenge_id\t:\ttest_challenge\n# \tround_id\t:\tFalse\n# \tscore\t:\t0.98\n# \tscore_secondary\t:\t0.98\n# \tgrading_status\t:\tgraded\n# \tmessage\t:\n# ========================================\n```\n\n# Tests\n```bash\n# Setup the environment varriables\ncp environ.sh.example environ.sh\n# Then modify the respective environment variables\nsource environ.sh\npytests tests/\n```\n\n# Author\nS.P.Mohanty <mohanty@aicrowd.com>\nArjun Nemani <nemani@aicrowd.com>\n",
"bugtrack_url": null,
"license": "GNU General Public License v3",
"summary": "Python api for interacting with AIcrowd Grading infrastructure",
"version": "0.1.25",
"project_urls": {
"Homepage": "https://github.com/AIcrowd/aicrowd_api"
},
"split_keywords": [
"aicrowd_api",
"aicrowd",
"crowdai_api",
"crowdai"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2a09b66f1caaddae133e9dc09240c1208a93d1380f29e526280dfb2d9d2de33d",
"md5": "dfe5df9b14b5cd3e38970e0e81651650",
"sha256": "ff9057e57e1ffc6bc65b8ab8ba37b12e5dba3b7e0fe9c7265fc5f90376949fe6"
},
"downloads": -1,
"filename": "aicrowd_api-0.1.25-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "dfe5df9b14b5cd3e38970e0e81651650",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 10117,
"upload_time": "2024-02-07T21:34:36",
"upload_time_iso_8601": "2024-02-07T21:34:36.768301Z",
"url": "https://files.pythonhosted.org/packages/2a/09/b66f1caaddae133e9dc09240c1208a93d1380f29e526280dfb2d9d2de33d/aicrowd_api-0.1.25-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bd02893a50e8888a305eacb96636512936153415d4b0bc24b32a684d37bde95a",
"md5": "4500ab3d54fb105c30214cec19d7a516",
"sha256": "5c57c6785ccacce335b627e9534a6c8d0bc19a475032dbfeed4516598797aa94"
},
"downloads": -1,
"filename": "aicrowd_api-0.1.25.tar.gz",
"has_sig": false,
"md5_digest": "4500ab3d54fb105c30214cec19d7a516",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 11317,
"upload_time": "2024-02-07T21:34:39",
"upload_time_iso_8601": "2024-02-07T21:34:39.415992Z",
"url": "https://files.pythonhosted.org/packages/bd/02/893a50e8888a305eacb96636512936153415d4b0bc24b32a684d37bde95a/aicrowd_api-0.1.25.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-07 21:34:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AIcrowd",
"github_project": "aicrowd_api",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "aicrowd-api"
}