Skip to main content

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)], limit=10, offset=2)
print(len([t for t in limited_universe])) #8

Project details


Download files

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

Source Distribution

ticket_universe-0.3.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

ticket_universe-0.3-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file ticket_universe-0.3.tar.gz.

File metadata

  • Download URL: ticket_universe-0.3.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for ticket_universe-0.3.tar.gz
Algorithm Hash digest
SHA256 0fdab2f7b21342696190de04b522391d5a8202b59b5c71747f333a5d8bb87885
MD5 37b98f0bd4b8a42d1ca9d70664e5c2ec
BLAKE2b-256 5713275f1ff662d7b854315ed1e3f5f50c7dcfb70601a168d385221bf3721839

See more details on using hashes here.

File details

Details for the file ticket_universe-0.3-py3-none-any.whl.

File metadata

  • Download URL: ticket_universe-0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for ticket_universe-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4215ae8b3c9c08c1bd01a39136f8c8064a2dd9316ac0a3169a83d83186020f4c
MD5 b92e53ac4dadc7d661e8d284a5995e56
BLAKE2b-256 a43d0e4ca4a35da8f0eef2b4b86f9e56c678227d8e4bce82aadc213250071234

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page