Skip to main content

python-abspath provides a command line tool that prints the absolute paths of all given files. File names can be piped via STDIN or given as arguments. Work for both Windows and Linux.

Project description

python-abspath

python-abspath provides a command line tool that prints the absolute paths of all given files. File names can be piped via STDIN or given as arguments. Work for both Windows and Linux.

Install

pip install python-abspath

Installed Command Line Tools

  • abspath

Usage

C:\Code\python-abspath>abspath --help
Usage: abspath.py [OPTIONS] [PATH]...

Options:
  -q, --with-quotes
  --help             Show this message and exit.

Example

Example 1:

Show the absolute path of requirements.txt. requirements.txt is given as a parameter.

C:\Code\python-abspath>abspath requirements.txt
C:\Code\python-abspath\requirements.txt

Example 2:

Show the absolute path of a.txt and b.txt. a.txt and b.txt are given as parameters.

C:\Code\python-abspath>abspath a.txt b.txt
C:\Code\python-abspath\a.txt
C:\Code\python-abspath\b.txt

Example 3:

Filename or filenames can be piped via STDIN.

C:\Code\python-abspath>echo a.txt | abspath
C:\Code\python-abspath\a.txt

C:\Code\python-abspath>type filenames.txt
a.txt
b.txt
c.txt

C:\Code\python-abspath>type filenames.txt | abspath
C:\Code\python-abspath\a.txt
C:\Code\python-abspath\b.txt
C:\Code\python-abspath\c.txt

Example 4:

In window the filename seperator is "\", so you can NOT just copy the output and paste as a const value to your code. You have to add -q option, so that the output will be quoted and you can use it in you code.

C:\Code\python-abspath>abspath -q requirements.txt
"C:\\Code\\python-abspath\\requirements.txt"

Releases

v0.1.0 2020/04/09

  • First release.

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

python-abspath-0.1.0.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file python-abspath-0.1.0.tar.gz.

File metadata

  • Download URL: python-abspath-0.1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

File hashes

Hashes for python-abspath-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4c3627554278d8ee6c20eab20117116b504235f1b66ebd6d8960e750c361d65a
MD5 1003efbd5f9ee4aa5854ec4317d5510b
BLAKE2b-256 10aa2f9b73fa7fd7ab5f056373f38f82ac09fd366e1165b78fc939fd4e56027c

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