Skip to main content




𝘼𝙍𝙂 : Parse command line arguments made easier...

Install

pip install arg

Usage

$ python test.py ford -m mustang --year 2017 red

test.py

import arg

# argv without file name
print(arg())
# => ['ford', '-m', 'mustang', '--year', '2017', 'red']

# argv
print(arg.v())
# => ['test.py', 'ford', '-m', 'mustang', '--year', '2017', 'red']

# argc
print(arg.c())
# => 7

# args as string
print(arg.s())
# => test.py ford -m mustang --year 2017 red

# file name
print(arg.fileName())
# => test.py

# argument at n
print(arg.at(2))
# => -m

API

arg()

Return an array with the arguments without the file name

Return Type: list

.v()

Return an array with all the arguments. (arg.v ~> argv Argumet Vector)

Return Type: list

.c()

Return an array with all the arguments. (arg.c ~> argc Argument Count)

Return Type: int

.s()

Return an string with all the arguments. (arg.s ~> Arguments to String)

Return Type: str

.fileName()

Return an string with the name of the file

Return Type: str

.at(n)

Return the value of the argument at value at n

Return Type: str

Related

  • lupe: A better CLI Helper.

Team

Carlos Abraham Logo
Carlos Abraham

License

MIT License © Carlos Abraham

Download files

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

Source Distribution

arg-0.0.1.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arg-0.0.1-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: arg-0.0.1.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.15

File hashes

Hashes for arg-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8249547d3c27c5d2b095e450b82e0acb698448b41d85016d5b395a701580b7cf
MD5 c884314e163e2795a117cb81e150c6f8
BLAKE2b-256 091c17c9b364125562788c4072d579be26848047f9f25b817e4f095e28fc4e49

See more details on using hashes here.

File details

Details for the file arg-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: arg-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.15

File hashes

Hashes for arg-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1286f9cb1bb30ac35e40d7183743782457556eed7a0414042ec057068177dd67
MD5 24474c0219a868bc1cd618cd9972742c
BLAKE2b-256 0a76f555e40afd8ddd7a2a0f1abaa8cd95d520a3a19838525ae9a6977064a1f1

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page