a pythonic query language
Sign in or create a new account.
('/home/jameyer/PyDB/Apps/Orestar/Source/pyql_dt.py', 72, 'query', 'return PyQL.pyql_dt.DT.query(self,**kwargs)')
('/usr/local/lib/python2.7/dist-packages/PyQL/pyql_dt.py', 195, 'query', 'res = PyQL.dt.DT.query(self,pyql)')
('/usr/local/lib/python2.7/dist-packages/PyQL/dt.py', 1290, 'query', 'co = compile(self.metacode, "metacode", "exec")')
Both fields and conditions are made up of terms.
A term is a valid Python expression in a name space made up of: database parameters; any imported python modules; PyQL Aggregators such as Average (A), Sum (S), and Replace (R); and other domain specific terms.
|About the Oregon Campaign Finance Database||Sample Queries|
The Oregon Campaign Finance Database originates with the Oregon Secretary of State website at: https://secure.sos.state.or.us/orestar/gotoPublicTransactionSearch.do. The raw data files are avaiable throught the data link in the upper left.
The original data headers were mapped into CamelCase PyQL parameters.
This allows easy access by just the capital letters or the first few letters of a parameter.
For example, to see the Date, Filer, ContributorPayee, and Amount for Ted Wheeler's transactions use the PyQL:
All of the transaction amounts are given as posititve numbers. Use the parameter SubType to help tease out the various machinations. For example, to see the total amount of transactions for each of Ted Wheeler's reported SubTypes, use the PyQL:
To start exploring a database, the PyQL Syntax S(1),R(Parameter)@Parameter is often handy. Let's start here by looking at the break down of transactions by SubType with the PyQL:
Sorting on the first column by clicking on that header, shows that Cash Constibutions is the most popular way to get money into the system.
Similarly, to see the total amount of transactions breaken down by state, use the PyQL:
To make a scatter plot of campaign contributions v date for Portland City Council Position #2, use the PyQL:
To see details of all reported transations for a candidate use (eg): Date,F,CP,A,ST@'Nick Fish' in F
And likewise for Portland City Council Position #3:
To see details of all reported transations for a candidate use (eg): Date,F,CP,A,ST@'Loretta' in F
To make a scatter plot of total Amount vs Zip for Zip codes in Oregon, use the PyQL:
To plot rather the number of transactions for each Zip, use the PyQL:
To plot cumulative transaction Amounts for Ted Wheeler and Jules Baily, use the PyQL:
To see transactions for Kate Brown and Bud Pierce, use the PyQL: