This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Instantly create an API and web interface for SQL queries.

Project Description
qrequest
========

Instantly create an API and web interface for SQL queries.

# Basic Setup

1. Write SQL queries to collect the data users can access. Use :keywords for parameters.
2. Run `python qrequest.py setup` to get an sql folder to put your queries and default settings file
2. Put these queries in the sql/main directory
3. Modify the settings below to specify the database driver (name of the python module) and databsae connection string
4. Then run `python qrequest.py run` to get a website which lets users run any of your queries without installing a thing, as well as an API endpoint.

The settings file looks like this. You can change the website title, description and the port the site runs on
```
{
"sites": {
"main": {
"db_connection_string": "<database connection string>",
"db_driver": "<python module name>"
}
},
"website_description": "Run some queries",
"website_port_number": 5000,
"website_title": "qRequest"
}
```

Users can view queries through the web interface, and download the json or csv formatted query results.

The URL format for the json endpoint is
```
/api/{site_name}/{query_name}.json?{params}
```

The URL format for the CSV endpoint is
```
/api/{site_name}/{query_name}.csv?{params}
```

As an example, if you have a query called example_query.sql with two parameters (param1 and param2),
to run the query with param1=1234 and param2="string", go to
```
/api/main/example_query.sql.csv?param1=1234&param2=string
```

# Multiple Sites

qrequest supports multiple database connections, which are called sites.
To setup qrequest for multiple sites, pass all the site names as arguments to the
`setup` command. If none are passed, one site called `main` is created by default.

As an example, to setup two sites called `site1` and `site2` run

```
python qrequest.py setup site1 site2
```

This will generate the following settings file

```
{
"sites": {
"site1": {
"db_connection_string": "<database connection string>",
"db_driver": "<python module name>"
},
"site2": {
"db_connection_string": "<database connection string>",
"db_driver": "<python module name>"
}
},
"website_description": "Run some queries",
"website_port_number": 5000,
"website_title": "qRequest"
}
```

You can specify different connection strings and database drivers for each site.
Release History

Release History

This version
History Node

0.1.12

History Node

0.1.11

History Node

0.1.10

History Node

0.1.9

History Node

0.1.8

History Node

0.1.7

History Node

0.1.6

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.3dev

History Node

0.1.2

History Node

0.1.1

History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
qrequest-0.1.12.tar.gz (61.1 kB) Copy SHA256 Checksum SHA256 Source Oct 20, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting