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

Metadata

Release files for arg 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arg 0.0.1
File Size Uploaded
arg-0.0.1.tar.gz 2.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for arg 0.0.1
File Interpreter ABI Platform
arg-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.1 kB

Release files / arg-0.0.1.tar.gz

Download URL arg-0.0.1.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8249547d3c27c5d2b095e450b82e0acb698448b41d85016d5b395a701580b7cf
BLAKE2b-256 checksum
How to use checksums
091c17c9b364125562788c4072d579be26848047f9f25b817e4f095e28fc4e49
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / arg-0.0.1-py3-none-any.whl

Download URL arg-0.0.1-py3-none-any.whl
Size 2.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1286f9cb1bb30ac35e40d7183743782457556eed7a0414042ec057068177dd67
BLAKE2b-256 checksum
How to use checksums
0a76f555e40afd8ddd7a2a0f1abaa8cd95d520a3a19838525ae9a6977064a1f1
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

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