Saravanan666/pypi-org huggingface dataset:
Package: argdeclare
# ardeclareAn implementation of the interface provided by the cmdln module butusing argparse to provide the option/arg heavy parsing.Credit for this code goes foremost to Shakeeb Alireza, code wasinitially found: [argdeclare: declarative interface to argparse](http://code.activestate.com/recipes/576935-argdeclare-declarative-interface-to-argparse/)# Usagefrom argdeclare import Commander, option_group, option, argdef test():# only for options which are repeated across different funcscommon_options = option_group(option('-t', '--type', action='store', help='specify type of package'),arg('package', help='package to be (un)installed'),option('--log', '-l', action='store_true', help='log is on'))class Application(Commander):'a description of the test app'name = 'app1'version = '0.1'default_args = ['install', '--help']@option('--log', '-l', action='store_true', help='log is on')@arg('pattern', help="pattern to delete")def do_delete(self, options):"help text for delete subcmd"print(options)@option('-f', '--force', action='store_true',help='force through installation')@common_optionsdef do_install(self, options):"help text for install subcmd"print(options)@common_optionsdef do_uninstall(self, options):"help text for uninstall subcmd"print(options)app = Application()app.cmdline()if __name__ == '__main__':test()
Package: argdirective
The argdirective projectArgdirective is a simple module which takes the first argument passed to your python script as subcommand and tries to find a directive module based on the basename of the script.Example:script.py subcommand --arg1 --arg2Consider the following module:site-packages
│   ...
│
└───configmount
│   │   mountas well as the following executable script/bin/configmount#!/bin/pythonimportargdirectiveif__name__=="__main__":argdirective.generator.run()If you runconfigmount mount --root /etc /mnt/configmountin your terminal argdirective will lookup the configmount package and redirect the arguments to the module mount. See theconfigmount projectfor more details.
Package: arg-dispatch
arg_dispatchfunction can be dispatched by its argumentsExamplefromarg_dispatchimportdispatch# Functions@dispatchdefdemo(a,b):return'hello'@dispatchdefdemo(c):return'world'demo(a=1,b=2)# return 'hello'demo(c=3)# return 'world'# try to call a function which has not been registeddemo(d=4)# raise `FunctionNotRegist`# MethodsclassDemo(object):@dispatchdefdemo(self,a,b):return'hello'@dispatchdefdemo(self,c):return'world'instance=Demo()instance.demo(a=1,b=2)# return 'hello'instance.demo(c=3)# return 'world'# try to call a method which has not been registedinstance.demo(d=4)# raise `FunctionNotRegist`Notice💣positional arguments must be requireddemo(1,2)# Boom!💣, raise `ArgumentError`instance.demo(1,2)# Boom!💣, raise `ArgumentError`default value is also not supported@dispatchdefdemo(a,b=1):# Boom!💣, raise `ExistDefaultValue`return'hello'classDemo(object):@dispatchdefdemo(self,a,b=1):# Boom!💣, raise `ExistDefaultValue`return'hello'
Package: argeasy
ArgEasy - Create amazing CLI programsArgEasy is acommand lineformatter made so that you can create CLI (command-line interface) Python programsquickly and extremely easily. In addition to being customizable, ArgEasy is optimized and can be used for large projects without any problems.PyPI projectGitHub releasesLearn how to use ArgEasy (documentation)Starting with ArgEasyFirst, let's install the latest version of the project using the PIP package manager with the command below:pipinstallargeasyIf you prefer, you can install the project directly from the official GitHub repository using Git:gitclonehttps://github.com/jaedsonpys/argeasycdargeasy/
python3setup.pyinstallAfter installation, you are ready to use all the features of the latest version of ArgEasy!LicenseMIT License
Copyright (c) 2023 Jaedson SilvaPlease visit theLICENSEfile for more details about the license used in this project.
Package: arge-consumption
ARGE Consumption Data ClientPython Client zum Abruf unterjähriger Verbrauchsinformationen über dieARGE consumption-data API.HintergrundIm Rahmen derEEDveröffentlicht dieARGE HeiWaKoeinen Webservice mit dem monatliche Verbrauchsdaten auf Nutzeinheitenebene vom Wärmedienstunternehmen abgerufen werden können.Dieser Service solle es der Wohnungswirtschaft ermöglichen, Nutzern/Bewohnern eine unterjährige Verbrauchsinformation im Rahmen der EED in eigenen IT-Systemen bereitzustellen.Mehr Infos hier:ARGE HEIWAKO: Datenaustausch
Package: arger
OverviewA wrapper around argparser to help build CLIs from functions. Uses type-hints extensively :snake:.Setup:gear: InstallationInstall it directly into an activated virtual environment:$ pip install arger:books: Usagecreate a python file called test.pyfromargerimportArgerdefmain(param1:int,param2:str,kw1=None,kw2=False):"""Example function with types documented in the docstring.Args:param1: The first parameter.param2: The second parameter.kw1: this is optional parameter.kw2: this is boolean. setting flag sets True."""print(locals())arger=Arger(main,prog="pytest",# for testing purpose. otherwise not required)if__name__=="__main__":arger.run()Here Arger is just a subclass ofArgumentParser. It will not conceal you from using otherargparselibraries.run this normally with$pythontest.py-h
usage:pytest[-h][-kKW1][-w]param1param2

Examplefunctionwithtypesdocumentedinthedocstring.

positionalarguments:param1Thefirstparameter.param2Thesecondparameter.

optionalarguments:-h,--helpshowthishelpmessageandexit-kKW1,--kw1KW1thisisoptionalparameter.(default:None)-w,--kw2thisisboolean.settingflagsetsTrue.(default:False)$pythontest.py100param2{'param1':100,'param2':'param2','kw1':None,'kw2':False}Checkoutexamplesfolder and documentation to see more ofargerin action. It supports any level of sub-commands.FeaturesUses docstring to parse help comment for arguments. SupportsgooglenumpyrstFlags will be generated from parameter-name.e.g.def main(param: ...)->-p, --paramIf needed you could declare it inside docstring like:param arg1: -a --arg this is the document.one can useArgumentclass to pass any values to theparser.add_argumentfunctionThe decorated functions can be composed to form nested sub-commands of any level.Most of the Standard typessupported.
Please seeexamplesfor more supported types with examples.NOTE*argssupported but no**kwargssupport yet.all optional arguments that start with underscore is not passed toParser.
They are considered private to the function implementation.
Some parameter names with special meaning_namespace_-> to get the output from theArgumentParser.parse_args()_arger_-> to get the parser instanceArgparser enhancementsweb-ui :https://github.com/nirizr/argparsewebextra actions :https://github.com/kadimisetty/action-heroautomatic shell completions usingargcomplete
Package: arges
Arges scripts are very simple and emulate a very high level language from where you call the testing/execution actions. Arges provides a set of utilities for
rapid automated testing to interact with any kind of interfaces including the web ui side (by using Selenium) and the server side / command line testing.It supports handling parameters, which are totally separated from the scripts.Within the test scripts you call the actions which by now, are divides into three main categories:-Web handling. From where you can interact with any web site. Selenium 1.0.1 library is used internally.-Command line executions. To execute any kind of command and check the return code or its output.-Parameters handling.Quick installation and useJust type:pip install argesAnd you are ready to go. Arges will interpret .tcase (test case files) and
.tsuite (test suite files) in your command line.This files are high level testing files which are used to launch your testing
commands. Within the .tdata files you can put the parameters so your scripts
could be generic. .tsuite are used to group .tcase and other .tsuite files.The metaphor of the system is a high level interpreter of a simple “testing”
language that a business analyst or qa guy could read without messing with
the code. Your tests could be grouped in tcases, so in this way you will
build reusable, testing “bricks”, such as a login module.There is an example in the same program. For the sake of testing arges you
can try this:sudo arges <your_python_dir>/dist-packages/arges/data/dummy_test_dir/dummy_app/tcase/goodbye_cruel_world.tcaseIn case you don’t know, the sudo command is just to get administrative rights.
This is so in Ubuntu and other *nix systems.You don’t need to be administrator to run arges, but as the report file will be
created in a “reports” directory within the .tcase dir, you will need some
administrative rights. You could avoid this, just by copying the dummy dir to
a home folder. Report file will contain the results of your testing.Adding your own commands.Arges is extensible!Just add your own module within argestools/api with a “runCommand” method.
You will also need to declare it in the “__all__” list of the same package,
just by editing argestools/api/__init__.py and adding your modules’s name to
the list present within the firsts lines.Web testing.Selenium in included within the system and you could invoke its commands within
your testing scripts. hello_world.tcase is a simple example. In order to get
Selenium commands workingm you will need to start Selenium which is present in
data/thirdparty/selenium-server-1.0.1Selenium will let you send commands and get information from any web.
Package: argexec
ArgexecAn unobtrusive, elegant mechanism to provide seamless command line interfaces through argparse for Python functions.
All you have to do is decorate your function of choice with@argexecand away you go!FeaturesDescription parsing from docstringArgument help parsing from reStructuredText-like docstringsArgument type enforcement viatypeguardfromtype hintsArgument default values from function signatureSupport for the following argument types:All builtin primitives (bool,int,float,str,bytes)Fixed length tuples of a supported typeVariable length tuples of a supported typeLists of a supported typeExtensible, complex custom type parsing viadynamic_dispatchInstallYou may install this via theargexecpackage onPyPi:pip3installargexecUsageThe decorator may be applied to any Python function that meets the following requirements:Is not a member functionHasPEP 484type hints for all parametersDoes not use*argsor**kwargsExample (foo.py):#!/usr/bin/python3fromtypingimportTuplefromargexecimportargexecfromargexec.typesimportLogLevel@argexecdef_(w:int,x:Tuple[str,...],y:LogLevel,z:bool=True):"""Hello, world!:param w: foo.:param x: bar.:param y: baz.:param z: qux."""pass$ ./foo.py --help
usage: foo.py [-h] [-y] [--no-z] w [x [x ...]]

Hello, world!

positional arguments:
  w           [int] foo
  x           [Tuple[str, ...]] bar

optional arguments:
  -h, --help  show this help message and exit
  -y, --y     [LogLevel=CRITICAL] baz (more flags for lower level)
  --no-z      [bool=True] quxDevelopmentWhen developing, it is recommended to use Pipenv. To create your development environment:pipenvinstall--devTestingTODO
Package: argfarce
Argfarce makes it easy to declare argparse structures.  Consider this example:>>> class PersonalInfoParser(ArgumentParser):
...     class Meta:
...         prog = 'person.py'
...
...     name = Argument('-n', help="Cheese to use on your sandwich", required=False)
...     profession = Argument('-p', '--profession', choices=('developer', 'programmer', 'software engineer'), help="These are all pretty much the same", required=False)
...     comments = Argument(nargs='*')
...
>>> parser = PersonalInfoParser()
>>> parser.parse_args('-p programmer -n Ken foo bar spam'.split())
>>> print parser.name
Ken
>>> print parser.profession
programmer
>>> print parser.comments
['foo', 'bar', 'spam']This software is not yet compatible with Python 3.
Package: argformat
argformatProvides a more structured formatter for python's argparse module.Installationpip install argformatUsageSimply import theStructuredFormatterand set it as the argparseformatter_class:ExampleimportargparsefromargformatimportStructuredFormatter# Parse argumentsparser=argparse.ArgumentParser(prog=<Yourprogram>,description=<Yourdescription>,formatter_class=StructuredFormatter)# Add your arguments normally...
Package: arggo
ArggoThe no-brainer Python package for experiment management:warning: This library is still in early development. We welcome contributors and early feedback :construction:Arggo is a Python library for managing experiment runs in a clean and elegant manner.Core features:Dataclass-powered automatic argument parsingAutomatic directory creation for different runsArggo is largely inspired byHydraand theHfArgumentParserutility from🤗 Transformers.Table of ContentsInstallationGetting StartedFeaturesInstallationTo install Arggo, runpipinstallarggoGetting StartedThe simplest use case of Arggo is to setup arguments for a script.
Start by defining arguments in a data class:fromdataclassesimportdataclassfromarggo.dataclass_utilsimportparser_field@dataclassclassArguments:name:str=parser_field(help="The user's name.")should_greet:bool=parser_field(help="Whether or not I should greet the user")Then, annotate your main function to magically receive an arguments class :fromarggoimportarggo@arggo()defmain(args:Arguments):ifargs.should_greet:print(f"Greetings,{args.name}!")Test by runningpythonmain.py--nameJohn--should_greetOutputsGreetings, John!That's it!Features:construction: To-do list:Proof-of-concept for dataclass argumentsAutomatic working directory managementService integrationContributingWe welcome early adopters and contributors to this project! See theContributingsection for details.LicenseThis project is open-sourced under the MIT license. SeeLICENSEfor details.AttributionsIcons made byFreepikfromwww.flaticon.com
Package: argguard
ArgGuardArgGuard is a simple abstract utility class to remove some boilerplate code when asserting class arguments.UsageTheArgGuardclass provides the protected abstract_argGuardmethod. This is the method where all assertions, checks and validations of the class arguments should take place. Every class that extends theArgGuardclass needs to implement this method.A second central method is_assert_argswhich stores the provided arguments and calls_argGuard. This method should be called as soon as possible in the constructor of the class to be guarded.APIMethodArgsDescription_arg_guardselfAbstract method where all assertions should take pace_assert_argsself,argsStores the provided arguments and calls_argGuard_get_argsself,*requested_argsRetrieves all requested arguments_get_required_argsself,*requested_argsRetrieves all requested arguments and fails if they are missingExample# Without ArgGuardclassA:def__init__(self,a,b,c=0):assert('a'inself.__args),'Required argument "a" is missing'assert('b'inself.__args),'Required argument "b" is missing'assert(a%b==0),'a ({}) must be divisible by b ({})'.format(a,b)self.state=a//b+c# With ArgGuardclassA(ArgGuard):def__init__(self,a,b,c=0):self._assert_args(locals())self.state=a//b+cdef_arg_guard(self):# If a required argument is missing, an error is throwna,b=self._get_required_args('a','b')assert(a%b==0),'a ({}) must be divisible by b ({})'.format(a,b)
Package: arghelper
arghelperarghelperis a Python 3.8+ module providing functions to help with argparse.Requirementsargparsemodule from thePython Standard Librarysysmodule from thePython Standard Libraryosmodule from thePython Standard LibraryUsagearghelperprovides functions to determine if a file or directory
exists:extant_fileextant_dirThese can be used as follows:if__name__=="__main__":# Process the argumentsimportargparseimportarghelperparser=argparse.ArgumentParser(description='Process the TAFFmat CET files')parser.add_argument('config_file',help='CSV configuration file.',metavar='FILE',type=arghelper.extant_file)parser.add_argument('input_dir',help='Directory containing input files.',metvar='DIR',type=arghelper.extant_dir)args=parser.parse_args()A common pattern, for me at least, is to have three positional arguments
consisting of:config_file--- A configuration fileinput_dir--- A directory containing input files to be readoutput_dir--- A directory where the output files should be savedThis pattern has been abstracted to a Facade function calledparse_config_input_output, which can be used as follows:if__name__=="__main__":# Process the argumentsimportarghelperargs=arghelper.parse_config_input_output(sys.argv)Another common pattern is to just parse the name of a config file:if__name__=="__main__":# Process the argumentsimportarghelperargs=arghelper.parse_config(sys.argv)ContributingContributions are welcome! To contribute please:Fork the repositoryCreate a feature branchAdd code and testsPass lint and testsSubmit apull requestDevelopment SetupDevelopment Setup Using pyenvUse the following commands to create a Python 3.9.9 virtualenv usingpyenvandpyenv-virtualenv, install the requirements in the virtualenv namedarghelper, and list the available [Invoke][] tasks.$pyenvvirtualenv3.11arghelper
$pyenvactivatearghelper
$pipinstall--upgradepip
$pipinstall-rrequirements.txt
$inv-lLicensearghelperis released under the MIT license. Please see theLICENSE.txtfile for more information.
Package: arghonaut
ArghonautArghonaut is an interactive interpreter, visualizer, and debugger forArgh! and Aargh!, which areBefunge-like esoteric programming languages designed by Sascha Wilde.
Arghonaut is written in Python and includes an ncurses interface.Arghonaut was created byAaron Friesenfor FOSS Jam 2021, a hackathon hosted by theUNL Operating Systems and Open Source Group.InstallationpipinstallarghonautTo use the UI, make sure you have ncurses or a suitable equivalent installed.UsageTo run Arghonaut interactively, execute the following command, wheresrc.aghis an Argh! or Aargh! source code file:arghonautsrc.aghFor more detailed usage information, run:arghonaut--helpKeybindingsArghonaut supports the following keybindings:.or Enter: step through executionSpace: automatically step through execution (0.1 second delay) or pausec: continue until next inputhjkl: move the editing cursorb: return the cursor to the instruction pointerg: jump the instruction pointer to the cursori: enter insert mode (the next character you type will be written into the code at the cursor position)o: open a new liner: reset state (excluding unsaved code changes)n: reset program (including unsaved code changes)s: save current code changes to program state (does not modify source file)qor Escape: quitBatch ModeArghonaut can be run in batch mode by adding the--batchflag.
In this mode, the curses interface will not be displayed, and input and output will be performed via standard input and standard output.
Programs can be run interactively with standard input from the keyboard, or with redirected or piped input.ExamplesThis repository includes some example Argh! and Aargh! programs written by Aaron Friesen.
For more examples, refer to theArgh! Mercurial repository.ContributingTo run Arghonaut from source:python-marghonautsrc.aghIf you want to submit a patch, please follow these guidelines:Run the project on some of the examples to test for bugs.Run some Python linters to check for and fix any coding style issues.LicenseArghonaut is licensed under theGNU General Public License Version 3.
Argh! is licensed under theGNU General Public License Version 2, and permits the use of later versions of the license.
Package: argify
Args Parser ReadmeOverviewThis is a simple Python script for parsing command-line arguments and executing corresponding functions. TheArgsclass provides decorators to associate functions with argument names and allows the script to execute the corresponding function when the respective argument is provided in the command line.UsageImporting the ScriptTo use theArgsclass, you need to import the script into your Python code. Make sure the script file is in the same directory as your Python file or in a location where it can be imported.fromargs_parserimportArgsCreating an InstanceTo get started, create an instance of theArgsclass:args_parser=Args()Associating Functions with ArgumentsUse theargdecorator to associate functions with argument names. Theargdecorator takes a list of argument names as its parameter.@args_parser.arg(["-hello","--greet"])defgreet_user(name):print(f"Hello,{name}!")@args_parser.arg(["-bye","--farewell"])defsay_goodbye(name):print(f"Goodbye,{name}!")In this example, thegreet_userfunction is associated with arguments-helloand--greet, and thesay_goodbyefunction is associated with arguments-byeand--farewell.Handling No ArgumentsUse thehaveArgsdecorator to set a function that will be executed when no arguments are provided in the command line.@args_parser.haveArgsdefno_args_function():print("No arguments provided.")Parsing ArgumentsAfter defining your functions and associating them with argument names, call theparse_args()method of theArgsinstance to process the command-line arguments and execute the corresponding function.if__name__=="__main__":args_parser.parse_args()Running the ScriptRun your Python script from the command line, passing the desired argument and its value (if required):pythonyour_script.py-helloAliceOutput:Hello, Alice!pythonyour_script.py-byeBobOutput:Goodbye, Bob!pythonyour_script.pyOutput:No arguments provided.ConclusionTheArgsclass simplifies the process of parsing and handling command-line arguments in Python. By using decorators to associate functions with arguments, you can easily expand the functionality of your script and provide a better command-line interface for your users.Please note that this is a basic example and may require additional error handling and input validation depending on the complexity of your use case. Enjoy using theArgsparser and happy coding!
Package: argil
Argil Python SDKWelcome to the Argil Python SDK. This library provides a simple and intuitive interface to interact with Argil's API, allowing you to leverage the power of AI-driven workflows and automations in your Python applications.For the full Argil documentation, please visithttps://docs.argil.ai.Table of ContentsInstallationUsageAPI ReferenceContributingLicenseInstallationThis library is distributed on PyPI. In order to add it as a dependency, run the following command:pipinstallargilUsageHere is a quick example of how to use the Argil Python SDK:fromargilimportArgilSdksdk=ArgilSdk(api_key='your-api-key')//YoucanalsoprovideyourAPIkeyfromARGIL_API_KEYenvvariable# Run a workflowrun=sdk.workflows.run('workflow-id',{"input_field_name1":$input_value1,"input_field_name2":$input_value2//Inputfieldsdependsontheworkflowyourun,pleaselookatourfulldocumentation.})# Get a workflow runworkflow_run=sdk.workflowRuns.get(run['id'])# List all workflow runsworkflow_run=sdk.workflowRuns.list()print(workflow_run)API ReferenceThe Argil Python SDK provides the following classes:ArgilSdk: The main class that provides access to the different services.Workflows: A class for interacting with the Workflows service of the Argil API.WorkflowRuns: A class for interacting with the WorkflowRuns service of the Argil API.ArgilConfig: A class for managing the configuration for the SDK.ArgilError: A custom error class for providing more detailed and specific error messages.For more detailed information, please refer to the source code and inline comments.ContributingWe welcome contributions from the community.LicenseThis project is licensed under the GPL-3.0-or-later license. For more information, see theLICENSE.mdfile.SupportIf you encounter any problems or have any questions, please open an issue on ourGitHub repository.AcknowledgementsThis project uses the following open-source packages:requests: A simple, yet elegant HTTP library.ContactFor any inquiries, please contact us atbriva@argil.ai.