Skip to main content

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

Metadata

Release files for ticket-universe 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ticket-universe 0.4
File Size Uploaded
ticket_universe-0.4.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ticket-universe 0.4
File Interpreter ABI Platform
ticket_universe-0.4-py3-none-any.whl Python 3 none any Details

Total release size: 12.4 kB

Release files / ticket_universe-0.4.tar.gz

Download URL ticket_universe-0.4.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
858b3d9f7f01834cdbe0b0a4e80360f41e57183643dfe7215d16e9c8dbe3a2c2
BLAKE2b-256 checksum
How to use checksums
f51c167db1f1b23d702e94520b95491fe3c5e081a086df81a2ecf4f5e1328f1d
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / ticket_universe-0.4-py3-none-any.whl

Download URL ticket_universe-0.4-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d21785b29bc063a316d2b96a5c1aa71817bdec41db7f9717f05f04cdd7842333
BLAKE2b-256 checksum
How to use checksums
03477f83a9aed484ae9f01bfecced04fff358324806190b3f7a93d9ca8987537
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.4 This release

2 release files

0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page