Name: py-mapzen-dbtickets
Owner: Mapzen
Description: Simple Python wrapper for talking to a ticket server.
Created: 2015-07-30 21:02:59.0
Updated: 2016-08-27 17:56:14.0
Pushed: 2015-07-30 21:29:00.0
Homepage: null
Size: 120
Language: Python
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Simple Python wrapper for talking to a (MySQL derived) ticket server.
ython
import mapzen.dbtickets
s = [{ 'user': 'dbtickets', 'database': 'dbtickets', 'host': 'localhost', 'password': '****'}]
t = mapzen.dbtickets.dbtickets(*hosts)
t.generate_id()
t.generate_id()
t.generate_id()
t.generate_id()
Under the hood py-mapzen-dbtickets uses the mysql.connection
library so the arguments you pass in each host config are the same to mysql.connection.
Some default values are provided for each host config. They are:
dbtickets
dbtickets
localhost
So you might also write something like this:
ython
import mapzen.dbtickets
hosts = [{ 'password': '***'}]
t = mapzen.dbtickets.dbtickets(*hosts)
t.generate_id()
Setting up and configuring the database
is outside the scope of this document. The setup assumes that you are
able to change the default auto-increment-increment
and
auto-increment-offset
values in MySQL.
If you are not able to you to do this yourself (because you don't have
suitable permissions to alter your database or whatever) you can also
specify a set_auto_increment
flag in your object constructor.
Doing so will tell the library to explicitly set the database's
variables using MySQL's built-in SET
command. This will incur extra
database commands for each connection but the measure of that cost is
left up to you.
rt mapzen.dbtickets
s = [{ 'password': '***'}]
mapzen.dbtickets.dbtickets(*hosts, set_auto_increment=True)
t t.generate_id()
setup.py
and dependency stuff is still not finished.