https://github.com/broadinstitute/dsp-appsec-codedx-api-client-python
Python API Client for Code DX
https://github.com/broadinstitute/dsp-appsec-codedx-api-client-python
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.6%) to scientific vocabulary
Repository
Python API Client for Code DX
Basic Info
- Host: GitHub
- Owner: broadinstitute
- Language: Python
- Default Branch: master
- Size: 502 KB
Statistics
- Stars: 4
- Watchers: 5
- Forks: 1
- Open Issues: 2
- Releases: 0
Metadata Files
README.md
codedx-api-client-python
This is an python client for the CodeDx API. See the CodeDx API Guide for reference.
More details about the Python API implementation at https://broadinstitute.github.io/dsp-appsec-codedx-api-client-python.
Download
Install the library using pip3
bash
pip3 install git+https://github.com/broadinstitute/dsp-appsec-codedx-api-client-python.git
You can then make API calls using the library. See below for an example.
```python from codedx_api import CodeDx
cdx = CodeDx("https://codedx.dsp-appsec-dev.broadinstitute.org/codedx", "c112d3a5-53a3-4840-a9f1-38868a7deeaa")
cdx.create_project('WebGoat') ```
The methods return data according to the schema seen in the CodeDx API Guide. For example, the create_projects call returns:
json
{
"id": 1,
"name": "WebGoat"
}
Docker Usage
The docker image includes the preinstalled library and includes example scripts for common tasks.
Pull Image from GCR
First, make sure you have permissions to access the project on GCR and that you can push and pull images.
docker pull gcr.io/dsp-appsec-dev/codedx-api-wrapper:latest
Interactive Python Session
```python docker run -it --name codedx-tasks gcr.io/dsp-appsec-dev/codedx-api-wrapper:latest
from codedxapi import CodeDx cdx = CodeDx([YOUR-CODEDX-URL], [CODEDX-API-KEY]) cdx.getprojects() {YOUR-PROJECTS-JSON} ```
Run sample scripts
Get Project ID or Create Project if given does not exist
docker run --name create-project gcr.io/dsp-appsec-dev/codedx-api-wrapper:latest create_project.py [API-KEY] [NEW-PROJECT-NAME]
Upload security scan report to CodeDX
docker run -v $(pwd):/app/scripts/reports --name upload-report gcr.io/dsp-appsec-dev/codedx-api-wrapper:latest upload_analysis.py [API-KEY] [PROJECT] [PATH-TO-REPORT]
Development
Run Updates Locally
``` python setup.py bdist_wheel
pip3 install dist/[WHEEL_FILE] ```
Testing
CodeDx API uses mocking and unittests to verify functionality.
python -m unittest discover -s tests -p "*_test.py"
Documentation
Documentation can be generated automatically using docstrings.
Run pdoc --html --output-dir docs codedx_api to generate documentation.
Questions
Please contact appsec@broadinstitute.org with any questions.
Owner
- Name: Broad Institute
- Login: broadinstitute
- Kind: organization
- Location: Cambridge, MA
- Website: http://www.broadinstitute.org/
- Twitter: broadinstitute
- Repositories: 1,083
- Profile: https://github.com/broadinstitute
Broad Institute of MIT and Harvard
GitHub Events
Total
- Pull request event: 1
- Create event: 2
Last Year
- Pull request event: 1
- Create event: 2
Issues and Pull Requests
Last synced: over 1 year ago
All Time
- Total issues: 1
- Total pull requests: 91
- Average time to close issues: 15 days
- Average time to close pull requests: about 1 month
- Total issue authors: 1
- Total pull request authors: 4
- Average comments per issue: 0.0
- Average comments per pull request: 0.23
- Merged pull requests: 68
- Bot issues: 0
- Bot pull requests: 20
Past Year
- Issues: 0
- Pull requests: 14
- Average time to close issues: N/A
- Average time to close pull requests: 14 days
- Issue authors: 0
- Pull request authors: 2
- Average comments per issue: 0
- Average comments per pull request: 0.5
- Merged pull requests: 7
- Bot issues: 0
- Bot pull requests: 6
Top Authors
Issue Authors
- adrazhi (1)
Pull Request Authors
- ssyms (31)
- dependabot[bot] (16)
- zbedo (13)
- davidbernick (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- requests *
- certifi ==2019.6.16
- chardet ==3.0.4
- idna ==2.8
- mock ==4.0.2
- requests ==2.27.1
- six ==1.12.0
- urllib3 ==1.26.5
- xerox ==0.4.1
- requests *