{"id":16391996,"url":"https://github.com/mikeshultz/pyqual","last_synced_at":"2025-10-04T06:30:33.582Z","repository":{"id":4216099,"uuid":"5337326","full_name":"mikeshultz/pyqual","owner":"mikeshultz","description":"A python+postgresql database quality assurance app.","archived":false,"fork":false,"pushed_at":"2016-04-28T06:27:48.000Z","size":913,"stargazers_count":4,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-22T16:39:17.161Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikeshultz.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.txt","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-08-08T04:56:01.000Z","updated_at":"2016-04-26T00:12:07.000Z","dependencies_parsed_at":"2022-09-12T05:50:26.359Z","dependency_job_id":null,"html_url":"https://github.com/mikeshultz/pyqual","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeshultz%2Fpyqual","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeshultz%2Fpyqual/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeshultz%2Fpyqual/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeshultz%2Fpyqual/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikeshultz","download_url":"https://codeload.github.com/mikeshultz/pyqual/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235222539,"owners_count":18955329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T04:48:07.885Z","updated_at":"2025-10-04T06:30:28.246Z","avatar_url":"https://github.com/mikeshultz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"================================================================================\n Pyqual - A python database quality assurance app\n================================================================================\n:Info: See \u003chttp://wiki.mikeshultz.com/Pyqual\u003e for basic info.\n:Author: Mike Shultz \u003cmike@mikeshultz.com\u003e\n:Date: $Date: 2013-04-19 12:33:00 -0700 (Fri, 19 Apr 2013) $\n:Revision: $Revision: 1.0.5 $\n:Description: A python database QA app\n:License: MIT License \u003chttp://opensource.org/licenses/MIT\u003e\n:Copyright: Copyright 2012 Mike Shultz\n\n.. image:: http://www.quantifiedcode.com/api/v1/project/f9240e0e06db42a09eb4c47f8785d04e/badge.svg\n   :target: http://www.quantifiedcode.com/app/project/f9240e0e06db42a09eb4c47f8785d04e\n   :alt: QC Code Review\n\nIntroduction\n================================================================================\nPyqual is a data quality assurance(QA) application. Its intention is to provide\na system in which users can setup tests to run against a PostgreSQL database.\nTests generally are for checking to make sure your data is sane and to key you\ninto problems that need to be fixed.\n\nFor instance, a sample test that comes with the base data for pyqual checks to \nmake sure there is at least one superuser setup.  If there is not one, there \nwould be a problem and it would make pyqual unusable.  This then will notify the\ntest owner of the problem so it can be fixed.\n\nPyqual provides the ability to run simple TRUE/FALSE SQL tests, as well as more \ncomplex tests that can use Python to do more complex checks with the data \nreturned by the test query.  You can also store data from the test for later \nuse.  For instance, you could have the test return the result of all Pyqual \nusers for later use.\n\nRequirements\n================================================================================\n- Python 2.7\n- distutils or setuptools if using setup.py\n\nPython Dependencies\n-------------------\nSee requirements.txt\n\nSetup\n================================================================================\n\nUsing setup.py\n--------------\n1) Install requirements ``sudo pip install -r requirements.txt``\n2) Run ``sudo python setup.py install``\n3) Get the base data into your database with ``python setup.py basedata --name=[dbname] --user=[username]``\n4) Edit site-packages/pyqual/settings.py to set your database settings\n5) Run the Pyqual daemon with ``pqdaemon.py start``\n6) Try the web interface, which is default at http://localhost:8081/ and the first user added to the DB has a username of 'admin' and a password of 'pyqual'.\n\nUsing pip\n---------\n1) Run ``pip install -e .`` in the pyqual directory\n2) Get the base data into the database with ``psql -f setup/base_data.sql [dbname]``\n3) Edit settings.py to configure your DB connection settings\n4) Run the Pyqual daemon with ``pqdaemon.py start``\n5) Try the web interface, which is default at http://localhost:8081/ and the first user added to the DB has a username of 'admin' and a password of 'pyqual'.\n\nManual Installation\n-------------------\nTo set up pyqual, follow these simple steps:\n\n1) Install dependencies using PIP by running ``pip install -r requirements.txt``\n2) Edit pyqual/settings.py to set your database settings\n3) To populate your database with base data and structure, run the SQL in setup/base_data.sql\n4) Run the Pyqual daemon with ``pqdaemon.py start``\n5) Try the web interface, which is default at http://localhost:8081/ and the first user added to the DB has a username of 'admin' and a password of 'pyqual'.\n\nYou should be all set from here!\n\nBuilding Tests\n================================================================================\nPyqual currently has two types of tests.  SQL Only, and SQL+Python.  For \nSQL-only tests to pass, the query should return ``TRUE``.  If using Python, the \nvariable ``results`` should be set to ``True``.\n\nSQL Only Tests\n--------------\nAn SQL test is the simplest and the purpose is to return TRUE from the query if \neverything is okay.\n\nFor instance, one of the sample tests that come with Pyqual checks to make sure\nthere is at least one test in the database.::\n\n    SELECT TRUE FROM pq_test LIMIT 1;\n\nThis would simply be considered passed if at least one row is returned and is \nTRUE.\n\nSQL + Python Tests\n------------------\n\nMore complex tests can be made using Python to parse and play with the returned\ndata from the query.  One of the sample tests mentioned before checks to see if\nthere's at least one super user.::\n\n    SELECT COUNT(user_id) AS count FROM pq_user JOIN pq_user_permission perm USING (user_id) WHERE permission_id = 3;\n\nThis test could be run as SQL only in this case, but for a demonstration of \nusing Python, we check the count returned to make sure it's greater than 0.::\n\n    if data[0]['count'] \u003e 0:\n        result = True\n\nStoring Test Result Data\n------------------------\n\nPyqual also allows you to store result data in the logs(and have it sent in \nnotification E-mails).  So, for instance, if you wanted to be sent(or just store \nit in the log table) the list of all of the super users(if they exist), you can\nstore it in ``resultData`` in your Python test.::\n\n    SELECT user_id, username FROM pq_user JOIN pq_user_permission perm USING (user_id) WHERE permission_id = 3;\n\n::\n\n    if len(data) \u003e 0:\n        result = True\n        resultData['users'] = []\n        for row in data:\n            resultData['users'].append(row['username'])\n\nThen the list will be stored in the log as the actual list of strings and be\nE-mailed as a pretty printed string.\n\nTODO\n================================================================================\nn/t\n\nProblems or Questions\n================================================================================\nIf you have problems or want to report a bug, please use the Github issue \ntracker at https://github.com/mikeshultz/pyqual/issues\n\nIf you have any questions, feel free to E-mail me at the address listed at the \ntop of this README.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeshultz%2Fpyqual","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikeshultz%2Fpyqual","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeshultz%2Fpyqual/lists"}