Skip to main content

Generate a run of integers or characters. Similar to jot and seq.

Project description

A simple command line tool to create sequences of numbers.

drang-run is comparable to jot or seq, but with a more intuitive interface. It was inspired (and named after) a post by Dr. Drang.

Installation

Just install like any other package:

pip3 install drang-run

This will install the run command.

run --version

Usage

Basic usage includes up to three arguments:

run [START] STOP [STEP]

START and STEP are optional and have 1 as default.

$>run 4
1
2
3
4
$>run 5 8
5
6
7
8
$>run 0 10 3
0
3
6
9

Reverse the sequence with -r:

$>run 4 -r
4
3
2
1

Format the output with --format. The option accepts any kind of Python format string.

$>run 998 1002 --format "{: 4}."
 998.
 999.
1000.
1001.
1002.

You can use decimals for START, STOP and STEP:

$>run 1.1 1.5 .15
1.1
1.25
1.4

Using letters will generate character sequences:

$>run d g
d
e
f
g

By default, the sequence is separated by a newline character \n, but you can change this with -s:

$>run d g -s "\t"
d       e       f       g

Run additional sequences with --also START STOP STEP:

$>run 1 2 -- also 3 4 1
1-3
1-4
2-3
2-4

Of course, this can be used with characters and be formatted:

$>run 1 2 -- also b c 1 --format "{0:02}. {1}_{1}"
01. a_a
01. b_b
02. a_a
02. b_b

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

drang-run-0.3.5.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

drang_run-0.3.5-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file drang-run-0.3.5.tar.gz.

File metadata

  • Download URL: drang-run-0.3.5.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.7 Darwin/20.6.0

File hashes

Hashes for drang-run-0.3.5.tar.gz
Algorithm Hash digest
SHA256 68bb085cad94b42d6f8bf24843c73c7d66da4bfa7a0c97e52e3470f9f458bb23
MD5 319a03ce5dde707c9d2a6b7e379dc07e
BLAKE2b-256 3bffd05f730fc2804554c15f69a1160efd37da29d1cb25adad45b6d7c791ecbd

See more details on using hashes here.

File details

Details for the file drang_run-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: drang_run-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.11 CPython/3.9.7 Darwin/20.6.0

File hashes

Hashes for drang_run-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ee7f73848f6f2bdcc66eed6924f7a6a226826b8f16c23f6fc903bf309664ea5d
MD5 502b896b0942f55841d67f90234d181b
BLAKE2b-256 52ad801f467e987a84726246cbe2ceb8c1d9b8ac8341c3499d20964460233719

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