This library sits on top of the machine generated CDA Python Client and offers some syntactic sugar to make it more pleasant to query the CDA.
Documentation for CDA python is in our readthedocs repo and browsable at https://cda.readthedocs.io/
Interactive versions of those notebooks can be used at this MyBinder link:
If you would like to bulk download the notebooks without the website, they are in this folder
If you have comments, questions, or feature requests for CDA python or the documentation site, please tell us at our Discussions page
If you have used CDA python in your work and want to be featured as a use case, start a conversation with us in the Show and Tell
If you have used CDA python and would like to contribute your own notebook for others to use, please make a pull request to our Community Notebooks repo
You can access our swagger endpoints directly at https://cda.datacommons.cancer.gov/api/swagger-ui.html
There are two methods for local installation in virtual environments: Docker or Conda + pip.
Installation without a virtual environment may have unexpected/unresolvable conflicts, and is not supported.
- git (Install)
- terminal/command line
-
Open Terminal or PowerShell and run:
git clone https://github.com/CancerDataAggregator/cda-python.git
- Navigate to the cda-python folder:
cd cda-python
- Build the docker container:
docker-compose up --build
- Open a Browser to http://localhost:8888. This will open a docker container with all the required packages for using the API in ipython notebook.
- To stop the container from running, return to the terminal window (from step 2), and type Control C to stop the container.
To delete the container from your machine, use this command in the cda-python project directory.
docker compose down
- Open Terminal or PowerShell and create a new conda environment:
conda create -n cda python=3.7
type y
when prompted
- Activate the environment:
conda activate cda
conda install jupyter
pip install git+https://github.com/CancerDataAggregator/cda-python.git
cd cda-python
jupyter notebook
type y
when prompted
- Click on the folder called
notebooks
, then the file calledexample.ipynb
to open the example workflow, or create a new notebook to run your own.
You only need to create a new conda environment once!
- To exit the conda environment, return to the terminal window (from step 1), and type Control C to stop the notebook then:
conda deactivate
- To return to the notebook in conda, open a terminal and type:
conda activate cda
jupyter notebooks
Click on the logo below. This will launch a Jupyter Notebook instance with our example notebook ready to run.