Skip to main content

List symbols in input

Project description

syms

syms lists symbols in its input (where "symbol" can be defined flexibly enough to be words, identifiers or XML tags).

syms is distributed under the terms of the GNU General Public License; either version 3 of the License, or (at your option), any later version. See the file COPYING for more details.

Usage examples

Unique symbols, sorted lexically: syms "$@" | sort | uniq
Number of unique symbols: syms "$@" | sort | uniq | wc -l
Unique symbols, sorted by frequency: syms "$@" | sort | uniq -c | sort -n -k 2
Unique lines (like uniq, but not just adjacent lines): syms -s "^(.*)$" "$@"

usage: syms [-h] [-s REGEXP] [-V] [FILE ...]

List symbols in input.

positional arguments:
  FILE

options:
  -h, --help            show this help message and exit
  -s REGEXP, --symbol REGEXP
                        symbols are given by REGEXP
  -V, --version         show program's version number and exit

The default symbol type is words (-s "\p{L}+"); other useful settings
include:

  non-white-space characters: -s "\S+"
  alphanumerics and underscores: -s "\w+"
  XML tags: -s "<([a-zA-Z_:][a-zA-Z_:.0-9-]*)[\s>]"

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

syms-1.0.2.tar.gz (14.4 kB view hashes)

Uploaded Source

Built Distribution

syms-1.0.2-py3-none-any.whl (14.8 kB view hashes)

Uploaded Python 3

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