Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Toolset to generate ticket universes

Project description

Ticket Universe

CircleCI

A command line interface and library to generate a universe of unique ticket codes in Python 3.x.

Installation

Ticket Universe can be installed via pip:

pip install ticket-universe

Usage

Ticket Universe can be used as library and as command line interface.

Command line interface

The ticket universe cli provides a means to generate a universe and write it to stdout.

usage: ticket-universe [-h] [--offset OFFSET] [--limit LIMIT]
                       [POSITION [POSITION ...]]

example: ticket-universe fixed:LTFY- alpha numeric numeric numeric

positional arguments:
  POSITION         alpha | alpha:safe_latin | numeric | range:min:max |
                   fixed:{} | binary

optional arguments:
  -h, --help       show this help message and exit
  --offset OFFSET
  --limit LIMIT

Library

from ticket_universe.position import FixedPosition, AlphaPosition, NumericPosition, RangedPosition
from ticket_universe.universe import Universe


standard_universe = Universe([
    FixedPosition('LTFY-'),
    AlphaPosition(),
    NumericPosition(),
    NumericPosition()
])

# ['LTFY-A00', ..., 'LTFY-Z99']
print([t for t in standard_universe])


# Alternate charsets for alpha positions
charset_universe = Universe([AlphaPosition('safe_latin'), AlphaPosition('safe_latin')])
tickets = [t for t in charset_universe]
print('O' in tickets, 'I' in tickets, 'L' in tickets) # False, False, False


# Limited, generate only a part of the universe
limited_universe = Universe([RangedPosition(0, 999)])
print(len([t for t in limited_universe.generate(limit=10, offset=2])) #8

Project details


Download files

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

Files for ticket-universe, version 0.4
Filename, size File type Python version Upload date Hashes
Filename, size ticket_universe-0.4-py3-none-any.whl (7.8 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size ticket_universe-0.4.tar.gz (4.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page