Module Import alias alias alias alias alias alias alias alias alias alias alias alias alias Import alias identifier Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore ListLoad Str Str Str Str Str Str Assign NameStore Str Assign NameStore Str FunctionDef arguments args defaults body Expr Str Global identifier identifier identifier identifier identifier identifier Assign NameStore Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword ListLoad Str Str Str Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword ListLoad Str Str Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword ListLoad Str Str Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword ListLoad Str Str Str Str Str Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword ListLoad Str Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str keyword ListLoad Str Str Str Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr If CompareNotEq AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr If CompareNotEq AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr If CompareEq AttributeLoad NameLoad attr NameLoad body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str For NameStore AttributeLoad NameLoad attr body If UnaryOpNot CompareIn NameLoad NameLoad body Raise Call NameLoad Call AttributeLoad NameLoad attr Str NameLoad Expr Call NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr Call NameLoad AttributeLoad NameLoad attr Expr Call NameLoad Assign NameStore Call NameLoad Assign NameStore Call NameLoad If CompareNotEq AttributeLoad NameLoad attr Str body Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad Expr Call NameLoad Expr Call NameLoad If CompareIn Str AttributeLoad NameLoad attr body TryExcept body Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad handlers ExceptHandler body If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr Index Num SubscriptLoad Call AttributeLoad NameLoad attr Index Num If CompareIn Str AttributeLoad NameLoad attr body TryExcept body Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad handlers ExceptHandler body If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr Index Num SubscriptLoad Call AttributeLoad NameLoad attr Index Num If CompareIn Str AttributeLoad NameLoad attr body TryExcept body Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad handlers ExceptHandler body If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr Index Num SubscriptLoad Call AttributeLoad NameLoad attr Index Num If CompareIn Str AttributeLoad NameLoad attr body TryExcept body Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad handlers ExceptHandler body If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr Index Num SubscriptLoad Call AttributeLoad NameLoad attr Index Num If CompareIn Str AttributeLoad NameLoad attr body TryExcept body Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad handlers ExceptHandler body If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr Index Num SubscriptLoad Call AttributeLoad NameLoad attr Index Num If CompareIn Str AttributeLoad NameLoad attr body TryExcept body Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad handlers ExceptHandler body If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr Index Num SubscriptLoad Call AttributeLoad NameLoad attr Index Num If CompareNotEq AttributeLoad NameLoad attr Str body Expr Call NameLoad NameLoad If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Expr Call NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str handlers ExceptHandler body If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr Index Num SubscriptLoad Call AttributeLoad NameLoad attr Index Num Expr Call AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args defaults body Expr Str Global identifier Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign NameStore BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad If CompareIs NameLoad NameLoad body Expr Call NameLoad NameLoad orelse Expr Call NameLoad NameLoad If CompareNotEq AttributeLoad NameLoad attr Str body Expr Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Assign NameStore NameLoad If CompareEq NameLoad Str body Assign NameStore Str orelse If CompareEq NameLoad Str body Assign NameStore Str orelse Assign NameStore NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If BoolOpAnd Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call NameLoad Expr Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Global identifier Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call NameLoad Expr Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Global identifier Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd Str NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Global identifier Return Call AttributeLoad AttributeLoad NameLoad attr attr Str Str decorator_list FunctionDef arguments args defaults body Expr Str Global identifier Return BinOpAdd BinOpAdd AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd Str AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd NameLoad Str For NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str body If UnaryOpNot Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr NameLoad BinOpAdd BinOpAdd NameLoad Str Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call NameLoad NameLoad BinOpAdd NameLoad Str Str decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call NameLoad NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd BinOpAdd Str NameLoad Str NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Str Str Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd NameLoad Str Str For NameStore Call AttributeLoad NameLoad attr BinOpAdd NameLoad Str body Expr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Expr Call NameLoad NameLoad BinOpAdd NameLoad Str Str decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd BinOpAdd Str NameLoad Str NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad Str Str Str Expr Call NameLoad NameLoad BinOpAdd NameLoad Str Str decorator_list FunctionDef arguments args defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Str Expr Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Str Str Str Str Str Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad BinOpAdd NameLoad Str Str decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd NameLoad Str Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Str Index Str Assign NameStore BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd NameLoad Str If Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr BinOpAdd Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call NameLoad NameLoad BinOpAdd NameLoad Str Str decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call NameLoad NameLoad BinOpAdd NameLoad Str Str decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd BinOpAdd Str NameLoad Str NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIn Str NameLoad body Expr Call AttributeLoad NameLoad attr Str If CompareIn Str NameLoad body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Str Assign NameStore Num For NameStore NameLoad body Assign NameStore ListLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler body AugAssignAdd NameStore Num Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr Index Num SubscriptLoad Call AttributeLoad NameLoad attr Index Num NameLoad Expr Call AttributeLoad NameLoad attr If CompareGt NameLoad Num body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr NameLoad orelse Expr Call NameLoad NameLoad BinOpAdd NameLoad Str Str decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr If CompareNotEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Str Assign TupleStore NameStore NameStore NameStore TupleLoad NameLoad NameLoad NameLoad TryFinally body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body For NameStore NameLoad body If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareNotEq NameLoad NameLoad body If CompareGt Call AttributeLoad NameLoad attr Str Num body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad finalbody If NameLoad body Delete NameDel If NameLoad body Delete NameDel decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str handlers ExceptHandler type AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad If BoolOpAnd CompareNotEq AttributeLoad NameLoad attr NameLoad CompareIn Str AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad If CompareNotEq AttributeLoad NameLoad attr Str body Expr Call NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Global identifier identifier Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str Assign NameStore Dict Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Call NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd Str AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str ListLoad SubscriptLoad NameLoad Index Str handlers ExceptHandler type AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str ListLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Global identifier Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Call NameLoad If BoolOpAnd CompareNotEq AttributeLoad NameLoad attr NameLoad CompareIn Str AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad Expr Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Global identifier identifier Assign NameStore ListLoad If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad Assign NameStore AttributeLoad NameLoad attr If CompareIn Str AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad Str If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Dict Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Str Assign SubscriptStore NameLoad Index Str BinOpAdd NameLoad Str Assign SubscriptStore NameLoad Index Str BinOpAdd NameLoad Str Assign SubscriptStore NameLoad Index Str BinOpAdd BinOpAdd BinOpAdd BinOpAdd AttributeLoad NameLoad attr NameLoad Str NameLoad Str Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Str Assign NameStore Call NameLoad BinOpAdd BinOpAdd BinOpAdd NameLoad Str NameLoad Str If NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad If CompareIn Str AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad Str If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Dict Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Str Assign SubscriptStore NameLoad Index Str BinOpAdd NameLoad Str Assign SubscriptStore NameLoad Index Str BinOpAdd NameLoad Str Assign SubscriptStore NameLoad Index Str BinOpAdd BinOpAdd BinOpAdd BinOpAdd AttributeLoad NameLoad attr NameLoad Str NameLoad Str Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Str Assign NameStore Call NameLoad BinOpAdd BinOpAdd BinOpAdd NameLoad Str NameLoad Str If NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad If CompareIn Str AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad Str If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Dict Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Str Assign SubscriptStore NameLoad Index Str BinOpAdd NameLoad Str Assign SubscriptStore NameLoad Index Str BinOpAdd NameLoad Str Assign SubscriptStore NameLoad Index Str BinOpAdd BinOpAdd BinOpAdd BinOpAdd AttributeLoad NameLoad attr NameLoad Str NameLoad Str Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Str Assign NameStore Call NameLoad BinOpAdd BinOpAdd BinOpAdd NameLoad Str NameLoad Str If NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad If CompareIn Str AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad Str If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Dict Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Str Assign SubscriptStore NameLoad Index Str BinOpAdd NameLoad Str Assign SubscriptStore NameLoad Index Str BinOpAdd NameLoad Str Assign SubscriptStore NameLoad Index Str BinOpAdd BinOpAdd BinOpAdd BinOpAdd AttributeLoad NameLoad attr NameLoad Str NameLoad Str Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Str Assign NameStore Call NameLoad BinOpAdd BinOpAdd BinOpAdd NameLoad Str NameLoad Str If NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad If CompareIn Str AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad Str If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Dict Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Str Assign SubscriptStore NameLoad Index Str BinOpAdd NameLoad Str Assign SubscriptStore NameLoad Index Str BinOpAdd NameLoad Str Assign SubscriptStore NameLoad Index Str BinOpAdd BinOpAdd BinOpAdd BinOpAdd AttributeLoad NameLoad attr NameLoad Str NameLoad Str Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Str Assign NameStore Call NameLoad BinOpAdd BinOpAdd BinOpAdd NameLoad Str NameLoad Str If NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad If CompareIn Str AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad Str If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str Assign NameStore Dict Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Str Assign SubscriptStore NameLoad Index Str BinOpAdd NameLoad Str Assign SubscriptStore NameLoad Index Str BinOpAdd NameLoad Str Assign SubscriptStore NameLoad Index Str BinOpAdd BinOpAdd BinOpAdd BinOpAdd AttributeLoad NameLoad attr NameLoad Str NameLoad Str Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Str Assign SubscriptStore NameLoad Index Str Str Assign NameStore Call NameLoad BinOpAdd BinOpAdd BinOpAdd NameLoad Str NameLoad Str If NameLoad body Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str For NameStore NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str If CompareEq Call AttributeLoad Call AttributeLoad Call NameLoad NameLoad attr attr Call AttributeLoad Call AttributeLoad NameLoad attr attr body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore NameLoad TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str Str NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr Str Str NameLoad attr attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad BinOpAdd NameLoad Str Assign NameStore Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotEq NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotEq NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotEq NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Str Assign NameStore ListLoad If CompareIn Str NameLoad body If CompareIn Str SubscriptLoad NameLoad Index Str body Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd NameLoad NameLoad For NameStore NameLoad body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad Expr Call AttributeLoad NameLoad attr Str Assign SubscriptStore NameLoad Index Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Global identifier Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Global identifier Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign NameStore BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd Str NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore NameLoad If CompareEq NameLoad NameLoad body Assign NameStore Str Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr Str If CompareEq Call NameLoad NameLoad Num body Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num If CompareEq NameLoad Str body Assign NameStore BinOpAdd NameLoad Num orelse If CompareEq NameLoad Str body Assign NameStore BinOpAdd NameLoad Num orelse If CompareEq NameLoad Str body Assign NameStore BinOpAdd NameLoad Num Assign NameStore BinOpAdd BinOpAdd BinOpAdd BinOpAdd Call NameLoad NameLoad Str Call NameLoad NameLoad Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd Str NameLoad Str NameLoad Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Global identifier Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr Str orelse Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot Call NameLoad NameLoad NameLoad body Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore BinOpAdd BinOpAdd Str AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A sys os arcpy logging logging.config shutil zipfile glob ckanclient datetime argparse csv re N/A xml.etree.ElementTree et N/A args None N/A logger None N/A output_folder None N/A source_feature_class None N/A staging_feature_class None N/A ckan_client None N/A temp_workspace None N/A available_formats N/A shp dwg kml csv metadata gdb N/A outCoordSystem GEOGCS['GCS_WGS_1984',    DATUM['D_WGS_1984',    SPHEROID['WGS_1984',6378137.0,298.257223563]],    PRIMEM['Greenwich',0.0],    UNIT['Degree',0.0174532925199433]] N/A geographicTransformation NAD_1983_HARN_To_WGS_1984 main N/A N/A N/A N/A N/A Main function
    
    Returns:
        None
     N/A args output_folder source_feature_class staging_feature_class temp_workspace logger N/A parser N/A N/A argparse ArgumentParser fromfile_prefix_chars @ N/A N/A N/A parser add_argument -o --output-folder action store dest output_folder help The root output folder in which to create the published files.  Sub-folders will automatically be created for each dataset (ex. \\myserver\OpenDataCatalog). N/A N/A N/A parser add_argument -w --temp-workspace action store dest temp_workspace help The root workspace folder in which to create temporary output files. A local workspace will increase performance. (ex. C:\temp). N/A N/A N/A parser add_argument -d --download-url action store dest download_url help The root path to the data download repository. (ex. http://data.denvergov.org/). N/A N/A N/A parser add_argument -s --source-workspace action store dest source_workspace required True help The source workspace to publish the feature class from (ex. Database Connections\\SDE Connection.sde).  Backslashes must be escaped as in the example. N/A N/A N/A parser add_argument -e --exclude-fields action store dest exclude_fields help Specifies a comma-delimited list of fields (columns) to remove from the dataset before publishing. (ex. TEMP_FIELD1,TEMP_FIELD2) N/A N/A N/A parser add_argument -f --formats action store dest formats default shp,dwg,kml,csv,metadata,gdb help Specific formats to publish (shp=Shapefile, dwg=CAD drawing file, kml=Keyhole Markup Language, metadata=Metadata, gdb=File Geodatabase).  If not specified all formats will be published. N/A N/A N/A parser add_argument -a --ckan-api action store dest ckan_api default http://colorado.ckan.net/api/2/ help The root path to the CKAN repository (ex. http://colorado.ckan.net/api/2/) N/A N/A N/A parser add_argument -k --ckan-api-key action store dest ckan_api_key required True help The CKAN API key (get from http://colorado.ckan.net/user/me when logged in) N/A N/A N/A parser add_argument -p --ckan-dataset-name-prefix action store dest ckan_dataset_name_prefix default help A prefix used in conjunction with the dataset-name argument to create the complete dataset name on OpenColorado. N/A N/A N/A parser add_argument -t --ckan-dataset-title-prefix action store dest ckan_dataset_title_prefix default help A prefix used in conjunction with the dataset-title argument to create the complete dataset title on OpenColorado. N/A N/A N/A parser add_argument -g --ckan-group-name action store dest ckan_group_name default help The group name in the OpenColorado group register that the dataset will be added to. N/A N/A N/A parser add_argument -l --ckan-license action store dest ckan_license default cc-by help The default data license type for the dataset. N/A N/A N/A parser add_argument -i --ckan-increment-version action store dest increment choices N/A major minor revision none default revision help Update the version number on OpenColorado 
(default: %(default)s) N/A N/A N/A parser add_argument -m --update-from-metadata action store dest update_from_metadata choices N/A description tags all help Update dataset information using the source metadata N/A N/A N/A parser add_argument -x --metadata-xslt action store dest metadata_xslt default ..\StyleSheets\Format_FGDC.xslt help The XSLT stylesheet to pass the FGDC CSDGM metadata through before publishing. N/A N/A N/A parser add_argument -r --exe-result action store dest exe_result choices N/A export publish all default all help Result of executing this script; export data files only, publish to CKAN, or both. N/A N/A N/A parser add_argument -v --log-level action store dest log_level choices N/A DEBUG INFO WARNING ERROR CRITICAL NOTSET default INFO help The level of detail to output to log files. N/A N/A N/A parser add_argument -b --build-target action store dest build_target choices N/A TEST PROD default TEST help The server tier the script is running on. Only PROD supports email alerts. N/A N/A N/A parser add_argument -n --gdb-version action store dest gdb_version choices N/A 9.2 9.3 10.0 CURRENT default 9.3 help The oldest version of Esri ArcGIS file geodatabases need to work with. N/A N/A N/A parser add_argument feature_class action store help The fully qualified path to the feature class (ex. Database Connections\\SDE Connection.sde\\schema.parcels).  If a source workspace is specified (ex. -s Database Connections\\SDE Connection.sde) just the feature class name needs to be provided here (ex. schema.parcels) N/A N/A N/A parser add_argument dataset_name action store help The name of the dataset on OpenColorado.  If a prefix is provided (-p) dont include it here. N/A N/A N/A parser add_argument dataset_title action store help The title of the dataset on OpenColorado.  If a prefix is provided (-t) dont include it here. N/A args N/A N/A parser parse_args N/A N/A N/A args output_folder None N/A N/A output_folder N/A N/A N/A args output_folder strip N/A N/A N/A args temp_workspace None N/A N/A temp_workspace N/A N/A N/A args temp_workspace strip N/A N/A N/A args source_workspace None N/A N/A source_feature_class N/A args feature_class N/A N/A source_feature_class N/A N/A N/A os path join N/A args source_workspace N/A args feature_class N/A N/A N/A args formats None N/A N/A N/A args formats available_formats N/A N/A N/A args formats N/A N/A N/A args formats split , N/A arg N/A args formats N/A N/A N/A N/A arg available_formats N/A N/A N/A Exception N/A N/A str format Format type: '{0}' not supported arg N/A N/A init_logger N/A N/A N/A N/A N/A logger info ============================================================ N/A N/A N/A logger info Starting PublishOpenDataset N/A N/A N/A logger info N/A N/A Executing in directory: {0} format N/A N/A os getcwd N/A N/A N/A logger info N/A N/A Featureclass: {0} format source_feature_class N/A N/A N/A logger info N/A N/A CKAN dataset name: {0} format N/A args dataset_name N/A N/A N/A logger info N/A N/A Download folder: {0} format output_folder N/A N/A N/A logger info N/A N/A Execution type: {0} format N/A args exe_result N/A N/A N/A logger info N/A N/A Export formats: {0} format N/A str N/A args formats N/A N/A delete_dataset_temp_folder N/A output_folder N/A create_dataset_folder N/A temp_workspace N/A create_dataset_temp_folder N/A N/A N/A args exe_result publish N/A N/A N/A N/A arcpy env outputCoordinateSystem outCoordSystem N/A N/A N/A arcpy env geographicTransformations geographicTransformation N/A N/A N/A len N/A args formats 0 N/A N/A N/A N/A logger info Exporting to file geodatabase N/A staging_feature_class N/A export_file_geodatabase N/A N/A drop_exclude_fields N/A N/A export_metadata N/A N/A shp N/A args formats N/A N/A N/A N/A N/A N/A logger info Exporting to shapefile N/A N/A export_shapefile N/A N/A N/A N/A logger N/A N/A N/A N/A logger exception N/A N/A Error publishing shapefile for dataset {0}. {1} {2} format N/A args dataset_name N/A N/A N/A sys exc_info N/A 1 N/A N/A N/A sys exc_info N/A 0 N/A N/A metadata N/A args formats N/A N/A N/A N/A N/A N/A logger info Exporting metadata XML file N/A N/A publish_metadata N/A N/A N/A N/A logger N/A N/A N/A N/A logger exception N/A N/A Error publishing metadata for dataset {0}. {1} {2} format N/A args dataset_name N/A N/A N/A sys exc_info N/A 1 N/A N/A N/A sys exc_info N/A 0 N/A N/A gdb N/A args formats N/A N/A N/A N/A N/A N/A logger info Publishing file geodatabase N/A N/A publish_file_geodatabase N/A N/A N/A N/A logger N/A N/A N/A N/A logger exception N/A N/A Error publishing file geodatabase for dataset {0}. {1} {2} format N/A args dataset_name N/A N/A N/A sys exc_info N/A 1 N/A N/A N/A sys exc_info N/A 0 N/A N/A dwg N/A args formats N/A N/A N/A N/A N/A N/A logger info Exporting to CAD drawing file N/A N/A export_cad N/A N/A N/A N/A logger N/A N/A N/A N/A logger exception N/A N/A Error publishing CAD for dataset {0}. {1} {2} format N/A args dataset_name N/A N/A N/A sys exc_info N/A 1 N/A N/A N/A sys exc_info N/A 0 N/A N/A kml N/A args formats N/A N/A N/A N/A N/A N/A logger info Exporting to KML file N/A N/A export_kml N/A N/A N/A N/A logger N/A N/A N/A N/A logger exception N/A N/A Error publishing KML for dataset {0}. {1} {2} format N/A args dataset_name N/A N/A N/A sys exc_info N/A 1 N/A N/A N/A sys exc_info N/A 0 N/A N/A csv N/A args formats N/A N/A N/A N/A N/A N/A logger info Exporting to CSV file N/A N/A export_csv N/A N/A N/A N/A logger N/A N/A N/A N/A logger exception N/A N/A Error publishing CSV for dataset {0}. {1} {2} format N/A args dataset_name N/A N/A N/A sys exc_info N/A 1 N/A N/A N/A sys exc_info N/A 0 N/A N/A N/A args exe_result export N/A N/A N/A remove_missing_formats_from_publication output_folder N/A N/A N/A len N/A args formats 0 N/A N/A N/A publish_to_ckan N/A N/A N/A logger info N/A Done - PublishOpenDataset  N/A args dataset_name N/A N/A N/A logger info ============================================================ N/A N/A N/A N/A logger N/A N/A N/A N/A logger exception N/A N/A Error publishing dataset {0}. {1} {2} format N/A args dataset_name N/A N/A N/A sys exc_info N/A 1 N/A N/A N/A sys exc_info N/A 0 N/A N/A N/A sys exit 1 N/A publish_to_ckan N/A N/A N/A N/A N/A Updates the dataset in the CKAN repository or creates a new dataset

    Returns:
        None
     N/A ckan_client N/A ckan_client N/A N/A ckanclient CkanClient base_location N/A args ckan_api api_key N/A args ckan_api_key N/A dataset_id N/A N/A args ckan_dataset_name_prefix N/A args dataset_name N/A dataset_entity N/A get_remote_dataset dataset_id N/A N/A dataset_entity None N/A N/A N/A create_dataset dataset_id N/A N/A N/A update_dataset dataset_entity N/A N/A N/A args increment none N/A N/A N/A update_dataset_version N/A remove_missing_formats_from_publication N/A N/A directory N/A N/A N/A Removes data formats that haven't been created
    from publishing to CKAN.
        
     N/A formats N/A N/A exp_format N/A args formats N/A N/A N/A N/A logger debug N/A N/A Checking for export format {0} format exp_format N/A exp_dir None N/A N/A exp_format shp N/A N/A exp_dir shape N/A N/A N/A exp_format dwg N/A N/A exp_dir cad N/A N/A exp_dir exp_format N/A exp_dir N/A N/A N/A os path join directory exp_dir N/A N/A N/A N/A os path exists exp_dir N/A N/A N/A N/A formats append exp_format N/A N/A args formats formats N/A create_folder N/A N/A directory delete N/A False N/A N/A Creates a folder if it does not exist

    Returns:
        None
     N/A N/A N/A N/A N/A os path exists directory delete N/A N/A N/A N/A logger debug N/A Deleting directory  directory N/A N/A N/A shutil rmtree directory N/A N/A N/A N/A N/A os path exists directory N/A N/A N/A N/A logger debug N/A N/A Directory " directory " does not exist.  Creating.. N/A N/A N/A os makedirs directory N/A directory N/A create_dataset_folder N/A N/A N/A N/A N/A Creates the output folder for exported files.
    
    Creates the output folder if it does not exist.

    Returns:
        The name of the path
     N/A directory N/A N/A N/A os path join output_folder N/A get_dataset_filename N/A N/A create_folder directory N/A directory N/A create_dataset_temp_folder N/A N/A N/A N/A N/A Creates a temporary folder for processing data
    
    Creates the temporary folder if it does not exist.

    Returns:
        The name of the path
     N/A temp_workspace N/A directory N/A N/A N/A os path join temp_workspace N/A get_dataset_filename N/A N/A create_folder directory N/A directory N/A delete_dataset_temp_folder N/A N/A N/A N/A N/A Deletes the temporary folder for processing data

    Returns:
        None
     N/A temp_workspace N/A name N/A get_dataset_filename N/A gdb_folder N/A N/A N/A os path join temp_workspace gdb N/A gdb_file N/A N/A N/A os path join gdb_folder N/A name .gdb N/A N/A N/A logger debug N/A Deleting file geodatabase: gdb_file N/A N/A N/A N/A os path exists gdb_file N/A N/A N/A N/A arcpy Delete_management gdb_file N/A dataset_directory N/A N/A N/A os path join temp_workspace name N/A N/A N/A N/A os path exists dataset_directory N/A N/A N/A N/A logger debug N/A Deleting directory  dataset_directory N/A N/A N/A shutil rmtree dataset_directory N/A publish_file N/A N/A directory file_name file_type N/A N/A N/A Publishes a file to the catalog download folder
    
    Returns:
        None
     N/A folder N/A create_folder N/A N/A N/A os path join output_folder file_type N/A N/A N/A logger info N/A N/A N/A Copying  file_name  to  folder N/A N/A N/A shutil copyfile N/A N/A N/A os path join directory file_name N/A N/A N/A os path join folder file_name N/A get_dataset_filename N/A N/A N/A N/A N/A Gets a file system friendly name from the catalog dataset name
    
    Returns:
        A string representing the dataset file name
     N/A args N/A N/A N/A N/A args dataset_name replace - _ N/A get_dataset_title N/A N/A N/A N/A N/A Gets the title of the catalog dataset
    
    Returns:
        A string representing the dataset title
     N/A args N/A N/A N/A N/A args ckan_dataset_title_prefix :  N/A args dataset_title N/A export_file_geodatabase N/A N/A N/A N/A N/A Exports the feature class to a file geodatabase
    
    Returns:
        None
     N/A folder gdb N/A name N/A get_dataset_filename N/A temp_working_folder N/A N/A N/A os path join temp_workspace folder N/A N/A create_folder temp_working_folder True N/A gdb_temp N/A N/A N/A os path join temp_working_folder N/A name .gdb N/A gdb_feature_class N/A N/A N/A os path join gdb_temp name N/A N/A N/A N/A arcpy Exists gdb_temp N/A N/A N/A N/A logger debug N/A N/A N/A Creating temp file geodatabase v N/A args gdb_version  for processing: gdb_temp N/A N/A N/A arcpy CreateFileGDB_management N/A N/A N/A os path dirname gdb_temp N/A N/A N/A os path basename gdb_temp N/A args gdb_version N/A N/A N/A logger debug N/A Copying featureclass from: source_feature_class N/A N/A N/A logger debug N/A Copying featureclass to: gdb_feature_class N/A N/A N/A arcpy CopyFeatures_management source_feature_class gdb_feature_class N/A gdb_feature_class N/A publish_file_geodatabase N/A N/A N/A N/A N/A Publishes the already exported file geodatabase to the Open Data Catalog
    
    Returns:
        None
     N/A folder gdb N/A name N/A get_dataset_filename N/A temp_working_folder N/A N/A N/A os path join temp_workspace folder N/A N/A N/A logger debug Zipping the file geodatabase N/A zip_file_name N/A N/A N/A os path join temp_working_folder N/A name .zip N/A zip_file N/A N/A zipfile ZipFile zip_file_name w N/A gdb_file_name N/A N/A N/A os path join temp_working_folder N/A name .gdb N/A filename N/A N/A glob glob N/A gdb_file_name /* N/A N/A N/A N/A N/A filename endswith .lock N/A N/A N/A N/A zip_file write filename N/A N/A name .gdb/ N/A N/A N/A os path basename filename N/A zipfile ZIP_DEFLATED N/A N/A N/A zip_file close N/A N/A publish_file temp_working_folder N/A name .zip gdb N/A export_shapefile N/A N/A N/A N/A N/A Exports the feature class as a zipped shapefile
    
    Returns:
        None
     N/A folder shape N/A name N/A get_dataset_filename N/A temp_working_folder N/A N/A N/A os path join temp_workspace folder N/A N/A create_folder temp_working_folder True N/A zip_folder N/A N/A N/A os path join temp_working_folder name N/A N/A create_folder zip_folder N/A source staging_feature_class N/A destination N/A N/A N/A os path join zip_folder N/A name .shp N/A N/A N/A logger debug N/A N/A N/A N/A Exporting to shapefile from " source " to " destination " N/A N/A N/A arcpy CopyFeatures_management source destination 0 0 0 N/A N/A N/A logger debug Zipping the shapefile N/A zip_file N/A N/A zipfile ZipFile N/A N/A N/A os path join temp_working_folder N/A name .zip w N/A filename N/A N/A glob glob N/A zip_folder /* N/A N/A N/A N/A zip_file write filename N/A N/A N/A os path basename filename N/A zipfile ZIP_DEFLATED N/A N/A N/A zip_file close N/A N/A publish_file temp_working_folder N/A name .zip shape N/A export_cad N/A N/A N/A N/A N/A Exports the feature class as a CAD drawing file
    
    Returns:
        None
     N/A folder cad N/A name N/A get_dataset_filename N/A temp_working_folder N/A N/A N/A os path join temp_workspace folder N/A N/A create_folder temp_working_folder True N/A source staging_feature_class N/A destination N/A N/A N/A os path join temp_working_folder N/A name .dwg N/A N/A N/A logger debug N/A N/A N/A N/A Exporting to DWG file from " source " to " destination " N/A N/A N/A arcpy ExportCAD_conversion source DWG_R2000 destination Ignore_Filenames_in_Tables Overwrite_Existing_Files N/A N/A publish_file temp_working_folder N/A name .dwg cad N/A export_kml N/A N/A N/A N/A N/A Exports the feature class to a kml file
    
    Returns:
        None
     N/A N/A N/A arcpy CheckOutExtension 3D N/A folder kml N/A name N/A get_dataset_filename N/A temp_working_folder N/A N/A N/A os path join temp_workspace folder N/A N/A create_folder temp_working_folder True N/A destination N/A N/A N/A os path join temp_working_folder N/A name .kmz N/A N/A N/A logger debug N/A N/A Generating KML file in memory from  " staging_feature_class " N/A N/A N/A arcpy MakeFeatureLayer_management staging_feature_class name N/A N/A replace_literal_nulls name N/A N/A N/A logger debug N/A N/A Exporting KML file (KMZ) to " destination " N/A N/A N/A arcpy LayerToKML_conversion name destination 20000 false DEFAULT 1024 96 N/A N/A N/A logger debug N/A Deleting in-memory feature layer: name N/A N/A N/A arcpy Delete_management name N/A N/A publish_file temp_working_folder N/A name .kmz kml N/A export_metadata N/A N/A N/A N/A N/A Exports the feature class metadata to an xml file
    
    Returns:
        None
     N/A folder metadata N/A name N/A get_dataset_filename N/A temp_working_folder N/A N/A N/A os path join temp_workspace folder N/A N/A create_folder temp_working_folder True N/A source staging_feature_class N/A raw_metadata_export N/A N/A N/A os path join temp_working_folder N/A name _raw.xml N/A N/A N/A arcpy env workspace temp_working_folder N/A installDir N/A N/A N/A arcpy GetInstallInfo desktop N/A InstallDir N/A translator N/A installDir Metadata/Translator/ARCGIS2FGDC.xml N/A N/A N/A arcpy ExportMetadata_conversion source translator raw_metadata_export N/A destination N/A N/A N/A os path join temp_working_folder N/A name .xml N/A N/A N/A N/A os path exists N/A args metadata_xslt N/A N/A N/A N/A logger info N/A Applying metadata XSLT:  N/A args metadata_xslt N/A N/A N/A arcpy XSLTransform_conversion raw_metadata_export N/A args metadata_xslt destination N/A N/A N/A logger debug N/A Reimporting metadata to file geodatabase  destination N/A N/A N/A arcpy MetadataImporter_conversion destination staging_feature_class N/A N/A N/A N/A logger warn N/A N/A Problem publishing dataset {0}. Metadata XSLT not found. format N/A args dataset_name N/A N/A N/A os rename raw_metadata_export destination N/A N/A publish_file temp_working_folder N/A name .xml metadata N/A publish_metadata N/A N/A N/A N/A N/A Publishes the already exported metadata to the Open Data Catalog
    
    Returns:
        None
     N/A folder metadata N/A name N/A get_dataset_filename N/A temp_working_folder N/A N/A N/A os path join temp_workspace folder N/A N/A publish_file temp_working_folder N/A name .xml metadata N/A export_csv N/A N/A N/A N/A N/A Exports the feature class as a csv file
    
    Returns:
        None
     N/A folder csv N/A name N/A get_dataset_filename N/A temp_working_folder N/A N/A N/A os path join temp_workspace folder N/A N/A create_folder temp_working_folder True N/A source staging_feature_class N/A destination N/A N/A N/A os path join temp_working_folder N/A name .csv N/A N/A N/A logger debug N/A N/A N/A N/A Exporting to csv from " source " to " destination " N/A rows N/A N/A arcpy SearchCursor source N/A csv_file N/A open destination wb N/A csv_writer N/A N/A csv writer csv_file N/A fieldnames N/A N/A f name N/A f N/A N/A arcpy ListFields source N/A N/A OBJECTID fieldnames N/A N/A N/A N/A fieldnames remove OBJECTID N/A N/A SHAPE fieldnames N/A N/A N/A N/A fieldnames remove SHAPE N/A N/A N/A csv_writer writerow fieldnames N/A error_report N/A error_count 0 N/A row rows N/A N/A values N/A N/A field fieldnames N/A N/A N/A N/A values append N/A N/A row getValue field N/A N/A N/A N/A N/A csv_writer writerow values N/A N/A N/A N/A error_count 1 N/A error_report N/A N/A {0}
{1} format error_report values N/A logger N/A N/A N/A N/A logger debug N/A N/A Error publishing record to CSV for dataset {0}. {1} {2} {3} format N/A args dataset_name N/A N/A N/A sys exc_info N/A 1 N/A N/A N/A sys exc_info N/A 0 values N/A N/A N/A csv_file close N/A N/A error_count 0 N/A N/A N/A N/A sys exc_clear N/A N/A N/A logger exception N/A N/A Error publishing CSV for dataset {0}. The following records prevented the CSV from publish correctly. Check for invalid characters: {1} format N/A args dataset_name error_report N/A N/A N/A publish_file temp_working_folder N/A name .csv csv N/A drop_exclude_fields N/A N/A N/A N/A N/A Removes all fields (columns) from a dataset passed into the exclude-fields
    parameter.
    
    Parameters:
        None
        
    Returns:
        None
     N/A exclude_fields N/A args exclude_fields N/A N/A exclude_fields None N/A N/A N/A N/A logger info N/A Deleting fields:  exclude_fields N/A exclude_fields N/A N/A exclude_fields replace , ; N/A N/A N/A arcpy DeleteField_management staging_feature_class exclude_fields N/A replace_literal_nulls N/A N/A layer_name N/A N/A N/A Replaces literal string representation of null, '<Null>', with a true null value 
        (None in Python).
    
    Parameters:
        layer_name - The name of the layer to replace literal nulls.
        
    Returns:
        None
     N/A N/A N/A logger debug Start replacing literal nulls. N/A N/A fields row rows N/A None None None N/A N/A N/A fields N/A N/A arcpy ListFields layer_name N/A rows N/A N/A arcpy UpdateCursor layer_name N/A row rows N/A N/A field fields N/A N/A N/A N/A field type String N/A N/A value N/A N/A row getValue N/A field name N/A N/A value None N/A N/A N/A N/A N/A value find <Null> -1 N/A N/A N/A N/A logger debug N/A N/A Found a "<Null>" string to nullify in field: {0}. format N/A field name N/A N/A N/A logger debug Replacing null string N/A N/A N/A row setValue N/A field name None N/A N/A N/A logger debug N/A N/A Replaced with {0} format value N/A N/A N/A rows updateRow row N/A N/A N/A logger debug N/A N/A Done replacing literal nulls in {0}. format layer_name N/A N/A row N/A N/A row N/A rows N/A N/A rows N/A get_remote_dataset N/A N/A dataset_id N/A N/A N/A Gets the dataset from CKAN repository

    Parameters:
        dataset_id - A string representing the unique dataset name
    
    Returns:
        An object structured the same as the JSON dataset output from
        the CKAN REST API. For more information on the structure look at the
        web service JSON output, or reference:
        http://docs.ckan.org/en/latest/api-v2.html#model-api
     N/A dataset_entity None N/A N/A N/A dataset_entity N/A N/A ckan_client package_entity_get dataset_id N/A N/A N/A logger info N/A N/A Dataset  dataset_id  found on OpenColorado N/A N/A N/A N/A ckanclient CkanApiNotFoundError N/A N/A N/A N/A logger info N/A N/A Dataset  dataset_id  not found on OpenColorado N/A dataset_entity N/A create_dataset N/A N/A dataset_id N/A N/A N/A Creates a new dataset and registers it to CKAN

    Parameters:
        dataset_id - A string representing the unique dataset name
    
    Returns:
        None
     N/A dataset_entity N/A create_local_dataset dataset_id N/A dataset_entity N/A update_dataset_resources dataset_entity N/A N/A N/A N/A args update_from_metadata None N/A metadata N/A args formats N/A N/A dataset_entity N/A update_local_dataset_from_metadata dataset_entity N/A N/A N/A args exe_result export N/A N/A N/A create_remote_dataset dataset_entity N/A N/A N/A N/A logger info N/A N/A Publication run type set to {0}, skipping remote creation of dataset. format N/A args exe_result N/A create_local_dataset N/A N/A dataset_id N/A N/A N/A Creates a new dataset entity, but does not commit it to CKAN

    Parameters:
        dataset_id - A string representing the unique dataset name
    
    Returns:
        An object structured the same as the JSON dataset output from
        the CKAN REST API. For more information on the structure look at the
        web service JSON output, or reference:
        http://docs.ckan.org/en/latest/api-v2.html#model-api
     N/A args ckan_client N/A N/A N/A logger info N/A N/A New Dataset  dataset_id  being initialized N/A dataset_entity N/A N/A N/A dataset_entity N/A name dataset_id N/A N/A dataset_entity N/A license_id N/A args ckan_license N/A N/A dataset_entity N/A title N/A get_dataset_title N/A N/A N/A group_entity N/A N/A ckan_client group_entity_get N/A args ckan_group_name N/A N/A group_entity None N/A N/A N/A N/A logger info N/A Adding dataset to group:  N/A args ckan_group_name N/A N/A dataset_entity N/A groups N/A N/A group_entity N/A id N/A N/A N/A N/A ckanclient CkanApiNotFoundError N/A N/A N/A N/A logger warn N/A N/A Problem publishing dataset {0}. Group: {1} not found on CKAN. format N/A args dataset_name N/A args ckan_group_name N/A N/A dataset_entity N/A groups N/A N/A dataset_entity N/A create_remote_dataset N/A N/A dataset_entity N/A N/A N/A Creates a new remote CKAN dataset.
       The dataset does not yet exists in the CKAN repository, it is created.
    
    Parameters:
        dataset_entity - An object structured the same as the JSON dataset 
        output from the CKAN REST API. For more information on the structure 
        look at the web service JSON output, or reference:
        http://docs.ckan.org/en/latest/api-v2.html#model-api
    
    Returns:
        None
     N/A ckan_client N/A N/A N/A ckan_client package_register_post dataset_entity N/A update_dataset N/A N/A dataset_entity N/A N/A N/A Updates an existing dataset and commits changes to CKAN

    Parameters:
        dataset_entity - An object structured the same as the JSON dataset 
        output from the CKAN REST API. For more information on the structure 
        look at the web service JSON output, or reference:
        http://docs.ckan.org/en/latest/api-v2.html#model-api
    
    Returns:
        None
     N/A dataset_entity N/A update_dataset_resources dataset_entity N/A N/A dataset_entity N/A license_id N/A args ckan_license N/A N/A dataset_entity N/A title N/A get_dataset_title N/A N/A N/A N/A args update_from_metadata None N/A metadata N/A args formats N/A N/A dataset_entity N/A update_local_dataset_from_metadata dataset_entity N/A N/A update_remote_dataset dataset_entity N/A update_dataset_resources N/A N/A dataset_entity N/A N/A N/A Updates the CKAN dataset entity resources. If the resources already
       exist in the CKAN repository, they're updated (preserving the original 
       unique resource ID). If the resource does not already exist,
       a new one is created. 
       
    Parameters:
        dataset_entity - An object structured the same as the JSON dataset output from
        the CKAN REST API. For more information on the structure look at the
        web service JSON output, or reference:
        http://docs.ckan.org/en/latest/api-v2.html#model-api
    
    Returns:
        An object structured the same as the JSON dataset output from
        the CKAN REST API. For more information on the structure look at the
        web service JSON output, or reference:
        http://docs.ckan.org/en/latest/api-v2.html#model-api
     N/A args ckan_client N/A resources N/A N/A N/A resources dataset_entity N/A N/A resources N/A dataset_entity N/A resources N/A dataset_file_name N/A get_dataset_filename N/A title N/A args dataset_title N/A N/A shp N/A args formats N/A N/A shp_resource N/A get_resource_by_format resources shp N/A N/A shp_resource None N/A N/A N/A N/A logger info Creating new SHP resource N/A shp_resource N/A N/A N/A N/A resources append shp_resource N/A N/A N/A N/A logger info Updating SHP resource N/A N/A shp_resource N/A name N/A title  - SHP N/A N/A shp_resource N/A description N/A title  - Shapefile N/A N/A shp_resource N/A url N/A N/A N/A N/A N/A args download_url dataset_file_name /shape/ dataset_file_name .zip N/A N/A shp_resource N/A mimetype application/zip N/A N/A shp_resource N/A format shp N/A N/A shp_resource N/A resource_type file N/A file_size N/A get_file_size N/A N/A N/A output_folder \shape\ dataset_file_name .zip N/A file_size N/A N/A N/A shp_resource N/A size file_size N/A N/A dwg N/A args formats N/A N/A dwg_resource N/A get_resource_by_format resources dwg N/A N/A dwg_resource None N/A N/A N/A N/A logger info Creating new DWG resource N/A dwg_resource N/A N/A N/A N/A resources append dwg_resource N/A N/A N/A N/A logger info Updating DWG resource N/A N/A dwg_resource N/A name N/A title  - DWG N/A N/A dwg_resource N/A description N/A title  - AutoCAD DWG N/A N/A dwg_resource N/A url N/A N/A N/A N/A N/A args download_url dataset_file_name /cad/ dataset_file_name .dwg N/A N/A dwg_resource N/A mimetype application/acad N/A N/A dwg_resource N/A format dwg N/A N/A dwg_resource N/A resource_type file N/A file_size N/A get_file_size N/A N/A N/A output_folder \cad\ dataset_file_name .dwg N/A file_size N/A N/A N/A dwg_resource N/A size file_size N/A N/A kml N/A args formats N/A N/A kml_resource N/A get_resource_by_format resources kml N/A N/A kml_resource None N/A N/A N/A N/A logger info Creating new KML resource N/A kml_resource N/A N/A N/A N/A resources append kml_resource N/A N/A N/A N/A logger info Updating KML resource N/A N/A kml_resource N/A name N/A title  - KML N/A N/A kml_resource N/A description N/A title  - Google KML N/A N/A kml_resource N/A url N/A N/A N/A N/A N/A args download_url dataset_file_name /kml/ dataset_file_name .kmz N/A N/A kml_resource N/A mimetype application/vnd.google-earth.kmz N/A N/A kml_resource N/A format kml N/A N/A kml_resource N/A resource_type file N/A file_size N/A get_file_size N/A N/A N/A output_folder \kml\ dataset_file_name .kmz N/A file_size N/A N/A N/A kml_resource N/A size file_size N/A N/A csv N/A args formats N/A N/A csv_resource N/A get_resource_by_format resources csv N/A N/A csv_resource None N/A N/A N/A N/A logger info Creating new CSV resource N/A csv_resource N/A N/A N/A N/A resources append csv_resource N/A N/A N/A N/A logger info Updating CSV resource N/A N/A csv_resource N/A name N/A title  - CSV N/A N/A csv_resource N/A description N/A title  - Comma-Separated Values N/A N/A csv_resource N/A url N/A N/A N/A N/A N/A args download_url dataset_file_name /csv/ dataset_file_name .csv N/A N/A csv_resource N/A mimetype text/csv N/A N/A csv_resource N/A format csv N/A N/A csv_resource N/A resource_type file N/A file_size N/A get_file_size N/A N/A N/A output_folder \csv\ dataset_file_name .csv N/A file_size N/A N/A N/A csv_resource N/A size file_size N/A N/A metadata N/A args formats N/A N/A metadata_resource N/A get_resource_by_format resources XML N/A N/A metadata_resource None N/A N/A N/A N/A logger info Creating new Metadata resource N/A metadata_resource N/A N/A N/A N/A resources append metadata_resource N/A N/A N/A N/A logger info Updating Metadata resource N/A N/A metadata_resource N/A name N/A title  - Metadata N/A N/A metadata_resource N/A description N/A title  - Metadata N/A N/A metadata_resource N/A url N/A N/A N/A N/A N/A args download_url dataset_file_name /metadata/ dataset_file_name .xml N/A N/A metadata_resource N/A mimetype application/xml N/A N/A metadata_resource N/A format xml N/A N/A metadata_resource N/A resource_type metadata N/A file_size N/A get_file_size N/A N/A N/A output_folder \metadata\ dataset_file_name .xml N/A file_size N/A N/A N/A metadata_resource N/A size file_size N/A N/A gdb N/A args formats N/A N/A gdb_resource N/A get_resource_by_format resources gdb N/A N/A gdb_resource None N/A N/A N/A N/A logger info Creating new gdb resource N/A gdb_resource N/A N/A N/A N/A resources append gdb_resource N/A N/A N/A N/A logger info Updating GDB resource N/A N/A gdb_resource N/A name N/A title  - GDB N/A N/A gdb_resource N/A description N/A title  - Esri File Geodatabase N/A N/A gdb_resource N/A url N/A N/A N/A N/A N/A args download_url dataset_file_name /gdb/ dataset_file_name .zip N/A N/A gdb_resource N/A mimetype application/zip N/A N/A gdb_resource N/A format gdb N/A N/A gdb_resource N/A resource_type file N/A file_size N/A get_file_size N/A N/A N/A output_folder \gdb\ dataset_file_name .zip N/A file_size N/A N/A N/A gdb_resource N/A size file_size N/A N/A dataset_entity N/A resources resources N/A dataset_entity N/A get_resource_by_format N/A N/A resources format_type N/A N/A N/A Searches an array of resources to find the resource that
       matches the file format type passed in. Returns the resource
       if found. 
       
    Parameters:
        resources - An array of CKAN dataset resources 
        For more information on the structure look at the
        web service JSON output, or reference:
        http://docs.ckan.org/en/latest/api-v2.html#model-api
        format_type - A string with the file format type to find (SHP, KML..)
    
    Returns:
        resource - A CKAN dataset resource if found. None if not found. 
        For more information on the structure look at the
        web service JSON output, or reference:
        http://docs.ckan.org/en/latest/api-v2.html#model-api
     N/A resource resources N/A N/A current_format N/A resource N/A format N/A N/A N/A N/A N/A N/A N/A str current_format strip upper N/A N/A N/A N/A format_type strip upper N/A N/A resource N/A None N/A get_file_size N/A N/A file_path N/A N/A N/A Gets the size in bytes of the specified file. 
       
    Parameters:
        file_path - A string with the path to the file
    
    Returns:
        string - The size in bytes of the file 
     N/A file_size None N/A N/A N/A file_size N/A N/A N/A os path getsize file_path N/A N/A N/A N/A N/A N/A logger warn N/A N/A Problem publishing dataset {0}. Unable to retrieve file size for resource: {1}. format N/A args dataset_name file_path N/A file_size N/A slugify_string N/A N/A in_str N/A N/A N/A Turns a string into a slug.
    
    Parameters:
        in_str - The input string.
    
    Returns:
        A slugified string. 
     N/A slug N/A N/A re sub \s+ - in_str N/A slug N/A N/A N/A N/A N/A N/A re sub (((?<=[a-z])[A-Z])|([A-Z](?![A-Z]|$))) -\1 slug lower strip - N/A slug N/A N/A re sub -+ - slug N/A slug N/A update_local_dataset_from_metadata N/A N/A dataset_entity N/A N/A N/A Updates the CKAN dataset entity by reading in metadata
       from the ArcGIS Metadata xml file. If the dataset already
       exists in the CKAN repository, the dataset is fetched
       and modified. If the dataset does not already exist,
       a new dataset entity object is created. 
       
    Parameters:
        dataset_entity - An object structured the same as the JSON dataset output from
        the CKAN REST API. For more information on the structure look at the
        web service JSON output, or reference:
        http://docs.ckan.org/en/latest/api-v2.html#model-api
    
    Returns:
        An object structured the same as the JSON dataset output from
        the CKAN REST API. For more information on the structure look at the
        web service JSON output, or reference:
        http://docs.ckan.org/en/latest/api-v2.html#model-api
     N/A folder metadata N/A name N/A get_dataset_filename N/A working_folder N/A N/A N/A os path join output_folder folder N/A file_path N/A N/A N/A os path join working_folder N/A name .xml N/A metadata_file N/A open file_path r N/A metadata_xml N/A N/A et parse metadata_file N/A N/A N/A metadata_file close N/A title N/A get_dataset_title N/A N/A dataset_entity N/A title title N/A xpath_abstract //abstract N/A abstract_element N/A N/A metadata_xml find xpath_abstract N/A N/A abstract_element None N/A N/A N/A dataset_entity N/A notes N/A abstract_element text N/A N/A N/A N/A logger warn N/A N/A Problem publishing dataset {0}. No abstract found in metadata. format N/A args dataset_name N/A xpath_maintainer //distinfo/distrib/cntinfo/cntorgp/cntorg N/A maintainer_element N/A N/A metadata_xml find xpath_maintainer N/A N/A maintainer_element None N/A N/A N/A dataset_entity N/A maintainer N/A maintainer_element text N/A N/A N/A N/A logger warn N/A N/A Problem publishing dataset {0}. No maintainer found in metadata. format N/A args dataset_name N/A xpath_maintainer_email //distinfo/distrib/cntinfo/cntemail N/A maintainer_email_element N/A N/A metadata_xml find xpath_maintainer_email N/A N/A maintainer_email_element None N/A N/A N/A dataset_entity N/A maintainer_email N/A maintainer_email_element text N/A N/A N/A N/A logger warn N/A N/A Problem publishing dataset {0}. No maintainer email found in metadata. format N/A args dataset_name N/A xpath_author //idinfo/citation/citeinfo/origin N/A author_element N/A N/A metadata_xml find xpath_author N/A N/A author_element None N/A N/A N/A dataset_entity N/A author N/A author_element text N/A N/A N/A N/A logger warn N/A N/A Problem publishing dataset {0}. No author found in metadata. format N/A args dataset_name N/A N/A dataset_entity N/A author_email N/A keywords N/A N/A N/A tags dataset_entity N/A N/A N/A featured N/A dataset_entity N/A tags N/A N/A N/A N/A keywords append featured N/A N/A N/A logger info Preserving 'featured' dataset tag N/A xpath_theme_keys //themekey N/A theme_keyword_elements N/A N/A metadata_xml findall xpath_theme_keys N/A xpath_place_keys //placekey N/A place_keyword_elements N/A N/A metadata_xml findall xpath_place_keys N/A keyword_elements N/A theme_keyword_elements place_keyword_elements N/A keyword_element keyword_elements N/A N/A keyword N/A slugify_string N/A keyword_element text N/A N/A N/A keywords append keyword N/A N/A N/A logger debug N/A Keywords found in metadata:  keyword N/A N/A N/A keywords append gis N/A N/A dataset_entity N/A tags keywords N/A dataset_entity N/A update_remote_dataset N/A N/A dataset_entity N/A N/A N/A Updates the remote CKAN dataset.
       The dataset already exists in the CKAN repository, it is updated.
    
    Parameters:
        dataset_entity - An object structured the same as the JSON dataset 
        output from the CKAN REST API. For more information on the structure 
        look at the web service JSON output, or reference:
        http://docs.ckan.org/en/latest/api-v2.html#model-api
    
    Returns:
        None
     N/A ckan_client N/A N/A N/A logger info Updating dataset through CKAN API N/A N/A N/A ckan_client package_entity_put dataset_entity N/A update_dataset_version N/A N/A N/A N/A N/A Updates the dataset version number on CKAN repository
    
    Returns:
        None
     N/A args N/A N/A N/A logger info Updating CKAN dataset version N/A ckan N/A N/A ckanclient CkanClient base_location N/A args ckan_api api_key N/A args ckan_api_key N/A dataset_id N/A N/A args ckan_dataset_name_prefix N/A args dataset_name N/A N/A N/A dataset_entity N/A N/A ckan package_entity_get dataset_id N/A version N/A dataset_entity N/A version N/A version N/A increment_version version N/A args increment N/A N/A dataset_entity N/A version version N/A N/A N/A ckan package_entity_put dataset_entity N/A N/A N/A N/A ckanclient CkanApiNotFoundError N/A N/A N/A N/A logger info N/A N/A  Dataset  dataset_id  not found on OpenColorado N/A increment_version N/A N/A version increment_type N/A N/A N/A Increments the version number
    
    Parameters:
        version - A version in the format <major.minor.revision>
        increment_type - [major, minor, or revision]
    
    Returns:
        a string representing the incremented version in the format
        <major.minor.revision>
     N/A incremented_version version N/A N/A version None N/A N/A incremented_version 1.0.0 N/A N/A N/A logger info N/A No version number found.  Setting version to  incremented_version N/A N/A version_parts N/A N/A version split . N/A N/A N/A len version_parts 3 N/A N/A major N/A int N/A version_parts N/A 0 N/A minor N/A int N/A version_parts N/A 1 N/A revision N/A int N/A version_parts N/A 2 N/A N/A increment_type major N/A N/A major N/A major 1 N/A N/A N/A increment_type minor N/A N/A minor N/A minor 1 N/A N/A N/A increment_type revision N/A N/A revision N/A revision 1 N/A incremented_version N/A N/A N/A N/A N/A str major . N/A str minor . N/A str revision N/A N/A N/A logger info N/A N/A N/A Incrementing CKAN dataset version from  version  to  incremented_version N/A incremented_version N/A init_logger N/A N/A N/A N/A N/A 
    Reads in the configuration file and initializes the logger.
    Adds a FileHandler to the logger and outputs a log file for
    each dataset published.
    
    Parameters:
        None
        
     N/A logger N/A N/A N/A N/A logging config fileConfig ..\Config\Logging.config N/A N/A N/A args build_target PROD N/A N/A logger N/A N/A logging getLogger ProdLogger N/A N/A logger N/A N/A logging getLogger DefaultLogger N/A numeric_level N/A getattr logging N/A N/A N/A args log_level upper None N/A N/A N/A isinstance numeric_level int N/A N/A N/A ValueError N/A Invalid log level: %s N/A args log_level N/A N/A N/A logger setLevel numeric_level N/A N/A logger name PublishOpenDataset N/A consoleHandler N/A N/A logger handlers N/A 0 N/A logFileName N/A N/A ..\Log\ N/A args dataset_name .log N/A fileHandler N/A N/A logging FileHandler logFileName N/A N/A N/A fileHandler setLevel N/A consoleHandler level N/A N/A N/A fileHandler setFormatter N/A consoleHandler formatter N/A N/A N/A logger addHandler fileHandler N/A N/A N/A __name__ __main__ N/A N/A N/A main