Skip to content

Instantly share code, notes, and snippets.

@ahwagner
Created April 3, 2020 21:58
Show Gist options
  • Save ahwagner/dc65bc2e5b44f4cbf184820754d2184f to your computer and use it in GitHub Desktop.
Save ahwagner/dc65bc2e5b44f4cbf184820754d2184f to your computer and use it in GitHub Desktop.
Get all evidence submitted by CIViC user Cam Grisdale
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"from civicpy import civic"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"evidence = civic.get_all_evidence()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"e = evidence[0]"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"41"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"e.lifecycle_actions.submitted.user.id"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"cams_evidence = [e for e in evidence if e.lifecycle_actions.submitted.user.id == 968]"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"103"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(cams_evidence)"
]
}
],
"metadata": {
"gist": {
"data": {
"description": "Untitled.ipynb",
"public": true
},
"id": ""
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.1"
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment