Skip to main content

Examples

Shorten names/paths by extracting non-common parts:

>>> from uniquify import shortname, shortpath
>>> shortname(['__common_part___abc___common_part__',
...            '__common_part___xbc___common_part__',
...            '__common_part___xyz___common_part__'])
['abc', 'xbc', 'xyz']
>>> shortpath(['some/long/path/___/alpha/___/___/',
...            'some/long/path/___/beta/___/___/',
...            'some/long/path/___/gamma/___/___/'])
['alpha', 'beta', 'gamma']

Convert common parts into skip marks:

>>> from uniquify import skipcommonname, skipcommonpath
>>> skipcommonname(['ab__common_part___c',
...                 'ij__common_part___k',
...                 'xy__common_part___z'])
['ab...c', 'ij...k', 'xy...z']
>>> skipcommonpath(['alpha/common/path/beta',
...                 'epsilon/common/path/delta',
...                 'phi/common/path/psi'])
['alpha/.../beta', 'epsilon/.../delta', 'phi/.../psi']

Install

Install it from pypi

pip install uniquify
# easy_install uniquify

Download files

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

Source Distribution

uniquify-0.0.1.tar.gz (5.2 kB view details)

Uploaded Source

File details

Details for the file uniquify-0.0.1.tar.gz.

File metadata

  • Download URL: uniquify-0.0.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for uniquify-0.0.1.tar.gz
Algorithm Hash digest
SHA256 47e748763aee852f9363a2f7ad759e157b829c6ee6cdb86f78f6a6507f58fb95
MD5 b4f95977cfb1166c53b115e915f88722
BLAKE2b-256 2e70f54766f67bcb26fb4d9274d35f5424533c8f8a908a296f16c93445baf7ba

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 file

0.0.0

1 file

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