package
stringlengths
1
122
pacakge-description
stringlengths
0
1.3M
ansible-specdoc
ansible-specdocA utility for dynamically generating documentation from an Ansible module's spec.This project was primarily designed for theLinode Ansible Collection.An example Ansible Collection usingansible-specdoccan be foundhere.Usageansible-specdoc[-h][-s][-nMODULE_NAME][-iINPUT_FILE][-oOUTPUT_FILE][-f{yaml,json,jinja2}][-j][-tTEMPLATE_FILE]GenerateAnsibleModuledocumentationfromspec. options:-h,--helpshowthishelpmessageandexit-s,--stdinReadthemodulefromstdin.-nMODULE_NAME,--module-nameMODULE_NAMEThenameofthemodule(requiredforstdin)-iINPUT_FILE,--input_fileINPUT_FILEThemoduletogeneratedocumentationfrom.-oOUTPUT_FILE,--output_fileOUTPUT_FILEThefiletooutputthedocumentationto.-f{yaml,json,jinja2},--output_format{yaml,json,jinja2}Theoutputformatofthedocumentation.-j,--injectInjecttheoutputdocumentationintothe`DOCUMENTATION`,`RETURN`,and`EXAMPLES`fieldsofinputmodule.-tTEMPLATE_FILE,--template_fileTEMPLATE_FILEThefiletouseasthetemplatefortemplatedformats.-c,--clear_injected_fields,ClearstheDOCUMENTATION,RETURNS,andEXAMPLESfieldsinspecifiedmoduleandsetsthemtoanemptystring.Generating a templated documentation file:ansible-specdoc-fjinja2-tpath/to/my/template.md.j2-ipath/to/my/module.py-opath/to/output/file.mdDynamically generating and injecting documentation back into module constants:ansible-specdoc-j-ipath/to/my/module.pyNOTE: Documentation string injection requires that you haveDOCUMENTATION,RETURN, andEXAMPLESconstants defined in your module.Generating a raw documentation string (not recommended):ansible-specdoc-fyaml-ipath/to/my/module.pyImplementationImporting SpecDoc ClassesAll of theansible-specdocclasses can be imported into an Ansible module using the following statement:fromansible_specdoc.objectsimport*Alternatively, only specific classes can be imported using the following statement:fromansible_specdoc.objectsimportSpecDocMeta,SpecField,SpecReturnValue,FieldType,DeprecationInfoDeclaring Module MetadataTheansible-specdocspecification format requires that each module exports aSPECDOC_METAobject with the following structure:SPECDOC_META=SpecDocMeta(description=['Module Description'],requirements=['python >= 3.6'],author=['Author Name'],options=module_spec,examples=['example module usage'],return_values={'my_return_value':SpecReturnValue(description='A generic return value.',type=FieldType.string,sample=['sample response']),})Declaring Argument SpecificationEachSpecFieldobject translates to a parameter that can be rendered into documentation and passed into Ansible for specification. These fields should be declared in a dict format as shown below:module_spec={'example_argument':SpecField(type=FieldType.string,required=True,description=['An example argument.'])}This dict should be passed into theoptionsfield of theSPECDOC_METAdeclaration.Passing Specification to AnsibleIn order to retrieve the Ansible-compatible spec dict, use theSPECDOC_META.ansible_specproperty.Other NotesTo preventansible-specdocfrom executing module code, please ensure that all module logic executes using the following pattern:if__name__=='__main__':main()To deprecate a module, specify thedeprecatedfield as follows:SPECDOC_META=SpecDocMeta(...deprecated=DeprecationInfo(alternative='my.new.module',removed_in='1.0.0',why='Reason for deprecation'))When deprecating a module, you will also need to update yourmeta/runtime.ymlfile. Please refer to theofficial Ansible deprecation documentationfor more details.TemplatesThis repository provides anexample Markdown templatethat can be used in conjunction with the-targument.
ansible-sphinx
ASphinxextension for documentingAnsibleroles and playbooks.Based onZuul Sphinx.
ansible-ssh
Adds interactive SSH capabilities to Ansible, especially useful in setups with VMs in private subnets accessible only via jumphosts.It uses Ansibleโ€™s inventory file so anyansible_ssh_common_argsoransible_ssh_extra_argsapply toansible-sshas well.RequirementsansiblepipUsageRun with-hfor command-line help:usage: ansible-ssh [-h] [--inventory INVENTORY] [--key-file KEYFILE] [--user USER] [--verbose] [--become] host positional arguments: host the host to ssh into, if not provided a list of hosts in current inventory file is printed optional arguments: -h, --help show this help message and exit --inventory INVENTORY, -i INVENTORY ansible inventory file to use instead of the one defined in ansible.cfg --key-file KEYFILE, -k KEYFILE ssh private key file to use instead of the default for the user --user USER, -u USER, -l USER override the user defined in ansible inventory file --verbose, -v pass verbose flag to ssh command --become, -b ssh as root instead of the inventory-supplied accountExample$ansible-sshlb-0executingssh-C-oControlMaster=auto-oControlPersist=60s-oProxyCommand="ssh -W %h:%p -q [email protected]"-lubuntu192.168.1.30Lastlogin:SatMay2515:40:132019from192.168.1.100ubuntu@lb-0:~$
ansible-starter
ansible_starter
ansible-stubs
ansible-stubs
ansible-subprocess
# ansible-subprocess[![Build Status](https://travis-ci.org/uehara1414/ansible-subprocess.svg?branch=master)](https://travis-ci.org/uehara1414/ansible-subprocess)ansible-subprocess run Ansible dynamically via the subprocess module.## Demo```pythonfrom ansible_subprocess import run_playbook, run_pingstatus, stdout, stderr = run_playbook('playbooks/sample.yml', 'web')status, stdout, stderr = run_playbook('playbooks/sample2.yml',['127.0.0.1', '127.0.0.2'],extra_vars={'var1': 'hoge', 'var2': 'fuga'},extra_options=['--syntax-check'])status, stdout, stderr = run_ping(['8.8.8.8'])```## Installation```bashpip install ansible-subprocess```## License[MIT](https://github.com/uehara1414/ansible-subprocess/blob/master/LICENSE)
ansible-taskrunner
Table of Contentsgenerated withDocTocOverviewTL;DRUse case and exampleGivenThe ChallengeInvestigationAssessmentProposed SolutionTechnical DetailsCreating a task manifest fileAdd the hosts blockAdd the vars blockPopulate the vars block - defaultsPopulate the vars block - define global optionsPopulate the vars block - define sub-commandsPopulate the vars block - cli options - mapped variablesPopulate the vars block - help/messagePopulate the vars block - embedded shell functionsMore about embedded shell functionsBash example:Python example:Ruby example:Populate the vars block - dynamic inventory expressionPopulate the vars block - inventory fileAdd tasksUsage ExamplesInstallationMore ExamplesAppendixThe Options SeparatorBastion ModeSpecial Variablesansible_playbook_commandcli_provideransible_extra_optionstasks_filecommandMutually Exclusive OptionsSimple TemplatingSingle-Executable ReleasesUnit TestingTODO - Add more tests!License and CreditsOverviewansible-taskrunneris a cli app that is essentially an ansible wrapper.It reads an ansible playbook file as its input, which serves as atask manifest.If no task manifest is specified, the app will search for 'Taskfile.yaml' in the current working directory.The inspiration for the tool comes from the gnu make command, which operates in similar fashion, i.e.A Makefile defines available build stepsThe make command consumes the Makefile at runtime and exposes these steps as command-line optionsIf you are running this tool from Windows, please read the section onBastion ModeTL;DREver wanted to add custom switches to theansible-playbookcommand? Something like this:ansible-playbook -i myinventory.txt -d dbhost1 -w webhost1 -t value1 myplaybook.yamlWell, you can through the use of an ansible-playbook wrapperThat's wheretaskscomes in:tasks -s -b bar -f foo1translates to:ansible-playbook -i /tmp/ansible-inventory16xdkrjd.tmp.ini \ -e "{'some_foo_variable':'foo1'}" -e "{'some_bar_variable':'bar'}" -e "{'playbook_targets':'local'}" Taskfile.yamlJump down to theusage examplesto see this in actionReview theinstallationinstructions if you want to test-drive itRead on if you want to dig deeper into the toolUse case and exampleGivenAn enterprise-grade application named contoso-appMultiple teams:DevelopmentEngineeringDBAOperationsQAAnsible is the primary means of invoking business and operational processes across the numerous environmentsThe ChallengeYou must ensure all teams adopt a standardized approach to running ansible workloadsInvestigationUpon investigating the current approach, you observe the following:Users tend to create wrapper scripts that call the ansible-playbook commandThese scripts don't follow any naming convention, as you've noted:run.shstart.shplaybook.shThese shell scripts have common attributes:Dynamically populate ansible-playbook variables via the --extra-vars optionDynamically creating ansible inventoriesPerforming pre/post-flight tasksProviding a command-line interfaceAssessmentAdvantages to the above approach:Quick-n-dirty, anyone can get started relatively quickly with writing ansible automationDisadvantages:Lack of standards:Leads to difficulty in collaboration and code refactoringDecreased re-usability of codebaseThis design encourages standalone playbooksMakes it more difficult to package actions as rolesDuplicate efforts across codebaseProposed SolutionEmploy a pre-execution script that operates at a layer above theansible-playbookcommand:Accomplishes the same as the above, but in more uniform mannerSupport for custom command-line parameters/flagsDynamic inventory expressionEmbedded shell functionsAdvantages to this approach:Easier to manageIf you know YAML and Ansible, you can get started relatively quickly with writing ansible automationSingle executable (/usr/local/bin/tasks)Disadvantages:Target ansible controller needs to have thetaskscommand installedBack To TopTechnical DetailsAs stated in theoverview, this tool functions much like themakecommand in that it accepts an input file that essentially extends its cli options.We create a specially formatted ansible-playbook that serves as a task manifest file (by default, Taskfile.yaml).This task manifest file:Extends thetaskscommandIs a valid ansible playbook (Taskfile.yaml), and can thus be launched with theansible-playbookcommandVariables available to the pre-execution phase are also available to the ansible execution phaseCreating a task manifest fileIn the following sections, we'll be building a sample manifest/playbook.Start by opening up your favorite text/IDE/editor and creating a newtask manifest filenamedTaskfile.yaml.Add the hosts blockAdd hosts, gather_facts, etc:Click to ExpandTaskfile.yaml### The hosts block - hosts: myhosts gather_facts: true become: trueAdd the vars blockRemember, the task runner will ultimately be calling theansible-playbookcommand against this very same file,so it must be a valid ansible playbook.Let's add the 'vars' block, which allows us to populate some default values:Click to ExpandTaskfile.yaml### The hosts block - hosts: myhosts gather_facts: true become: true ### The vars block vars:Populate the vars block - defaultsLet's add some default variables to the playbook:Click to ExpandTaskfile.yaml### The hosts block - hosts: myhosts gather_facts: true become: true ### The vars block vars: var1: value1 var2: value2 var3: value3 var4: |- This is a multi-line value of type string var5: - listvalue1 - listvalue2 - listvalue3 - listvalue4 var6: some_key: some_child_key: dictvalue1 var7: $(echo some_value) var8: 8000 dbhosts: - dbhost1 - dbhost2 - dbhost3 webhosts: - webhost1 - webhost2 - webhost3As you can see, we've defined a number of variables holding different values.The rules for evaluation of these are as follows:Variable | Ansible Evaluation | Shell Function Evaluation -------------------------------------------- | ----------------------- | ----------------------- str_var: value1 | String | String bool_var: True | Boolean | String num_var: 3 | Integer | Integer multiline_var: | | Multiline String | String (heredoc) This is a multi-line value | | of type string | | list_var: | List Object | String (heredoc) - item1 | | - item2 | | dict_var: | Dictionary Object | JSON String (heredoc) key1: somevalue1 | | key2: somevalue2 | | shell_var: $(grep somestring /some/file.txt) | String | Depends on outputAdditionally, arguments supplied from the command-line conformto the type specified in the options definition, with "string" being the default type.Back To TopPopulate the vars block - define global optionsGlobal options are available to all sub-commands.These are defined under thevars.globals.optionskey.Let's add a simple example:Click to ExpandTaskfile.yaml### The hosts block - hosts: myhosts gather_facts: true become: true ### The vars block vars: var1: value1 var2: value2 var3: value3 var4: |- This is a multi-line value of type string var5: - listvalue1 - listvalue2 - listvalue3 - listvalue4 var6: some_key: some_child_key: dictvalue1 var7: $(echo some_value) var8: 8000 dbhosts: - dbhost1 - dbhost2 - dbhost3 webhosts: - webhost1 - webhost2 - webhost3 globals: options: my_global_option: help: "This is my global option" short: -g long: --global var: some_global_variablePopulate the vars block - define sub-commandsNext, we define the available sub-commands and their options.Let's add a sub-command namedrunalong with its command-line options:Click to ExpandTaskfile.yaml### The hosts block - hosts: myhosts gather_facts: true become: true ### The vars block vars: var1: value1 var2: value2 var3: value3 var4: |- This is a multi-line value of type string var5: - listvalue1 - listvalue2 - listvalue3 - listvalue4 var6: some_key: some_child_key: dictvalue1 var7: $(echo some_value) var8: 8000 dbhosts: - dbhost1 - dbhost2 - dbhost3 webhosts: - webhost1 - webhost2 - webhost3 ### Global Options Block globals: options: my_global_option: help: "This is my global option" short: -g long: --global var: some_global_variable ### The commands block commands: run: options: foo: help: "This is some foo option" short: -f long: --foo type: choice var: some_foo_variable required: True not_required_if: - some_bar_variable options: - foo1 - foo2 bar: help: "This is some bar option" short: -b long: --bar type: str var: some_bar_variable required: False required_if: - hello - some_baz_variable baz: help: "This is some baz option" short: -z long: --baz type: str var: some_baz_variable required: False mutually_exclusive_with: - some_bar_variable - some_foo_variable envvar: help: "The value for this argument can be derived from an Environmental Variable" short: -E long: --env-var type: str var: env_var env_var: SOME_ENVIRONMENT_VARIABLE env_var_show: True num: help: "This is a numeric argument" short: -n long: --number var: some_num_variable type: int required: False env_var_show: True targets: help: "Playbook targets" short: -t long: --targets type: str var: playbook_targets required: True multiple: help: |- This option can be specified multiple times short: -m long: --multiple type: str var: multiple_arg allow_multiple: True some_switch: help: |- This is some boolean option, behaves like Click's switches, holds the value of True if specified see: https://github.com/pallets/click short: -s long: --some-switch is_flag: true var: some_switch required: True say_hello: help: "Invoke the 'hello' embedded shell function" short: -hello long: --say-hello type: str var: hello is_flag: True say_goodbye: help: "Invoke the 'goodbye' embedded shell function" short: -goodbye long: --say-goodbye type: str var: goodbye is_flag: True hidden_option: help: "This is a hidden option" short: -O long: --hidden-option is_hidden: True type: str var: hidden is_flag: True verbose: help: |- This is a sample paramter that supports counting, as with: -v, -vv, -vvv, which would evaluate to 1, 2, and 3, respectively short: -v allow_counting: True var: verbosityAs you can see, commands are defined via YAML, and the syntax is mostly self-explanatory.Currently, the parameters available to any given option areconsistent with click version 8.1.x, seeAPI โ€” Click Documentation (8.1.x)Important Notes:An option'svarkey:In the case of standard options, this variable holds the value of the arguments passed to the optionIn the case of flags/switches, this variable is a BooleanThe variable is available during the entire runtimeIn the above example, the-helloand-goodbyeoptions point to special mappedvariables that themselves map to corresponding shell functions defined in the subcommand'sfunctions directive. We'll discuss this more in sectionembedded-shell-functions.Populate the vars block - cli options - mapped variablesAs I mentioned before, the above mapped variables can be usedduring runtime.That is, they can be referenced in any defined shell functions,dynamic inventory expression logic, as well as during ansible execution.Consider the-f|-foofrom the example.Whatever argument you pass to this option becomes the value for the mapped variablesome_foo_variable.Again, this variable is made available to the underlying subprocess call, and thus to ansible.So when we call the tasks command like sotasks run -f foo1, the value for thesome_foo_variablebecomesfoo.Populate the vars block - help/messageNext, we add the help/message section:Click to ExpandTaskfile.yaml### The hosts block - hosts: myhosts gather_facts: true become: true ### The vars block vars: var1: value1 var2: value2 var3: value3 var4: |- This is a multi-line value of type string var5: - listvalue1 - listvalue2 - listvalue3 - listvalue4 var6: some_key: some_child_key: dictvalue1 var7: $(echo some_value) var8: 8000 dbhosts: - dbhost1 - dbhost2 - dbhost3 webhosts: - webhost1 - webhost2 - webhost3 ### Global Options Block globals: options: my_global_option: help: "This is my global option" short: -g long: --global var: some_global_variable ### The commands block commands: run: options: foo: help: "This is some foo option" short: -f long: --foo type: choice var: some_foo_variable required: True not_required_if: - some_bar_variable options: - foo1 - foo2 bar: help: "This is some bar option" short: -b long: --bar type: str var: some_bar_variable required: False required_if: - hello - some_baz_variable baz: help: "This is some baz option" short: -z long: --baz type: str var: some_baz_variable required: False mutually_exclusive_with: - some_bar_variable - some_foo_variable envvar: help: "The value for this argument can be derived from an Environmental Variable" short: -E long: --env-var type: str var: env_var env_var: SOME_ENVIRONMENT_VARIABLE env_var_show: True num: help: "This is a numeric argument" short: -n long: --number var: some_num_variable type: int required: False env_var_show: True targets: help: "Playbook targets" short: -t long: --targets type: str var: playbook_targets required: True multiple: help: |- This option can be specified multiple times short: -m long: --multiple type: str var: multiple_arg allow_multiple: True some_switch: help: |- This is some boolean option, behaves like Click's switches, holds the value of True if specified see: https://github.com/pallets/click short: -s long: --some-switch is_flag: true var: some_switch required: True say_hello: help: "Invoke the 'hello' embedded shell function" short: -hello long: --say-hello type: str var: hello is_flag: True say_goodbye: help: "Invoke the 'goodbye' embedded shell function" short: -goodbye long: --say-goodbye type: str var: goodbye is_flag: True hidden_option: help: "This is a hidden option" short: -O long: --hidden-option is_hidden: True type: str var: hidden is_flag: True verbose: help: |- This is a sample paramter that supports counting, as with: -v, -vv, -vvv, which would evaluate to 1, 2, and 3, respectively short: -v allow_counting: True var: verbosity help: message: | Invoke the 'run' command epilog: | This line will be displayed at the end of the help text message examples: - example1: | tasks $command - example2: | Usage example 2Runningtasks run --helpshould return the list of parameters along with the help message you defined.Populate the vars block - embedded shell functionsAdd embedded shell functions:Taskfile.yaml### The hosts block - hosts: myhosts gather_facts: true become: true ### The vars block vars: var1: value1 var2: value2 var3: value3 var4: |- This is a multi-line value of type string var5: - listvalue1 - listvalue2 - listvalue3 - listvalue4 var6: some_key: some_child_key: dictvalue1 var7: $(echo some_value) var8: 8000 dbhosts: - dbhost1 - dbhost2 - dbhost3 webhosts: - webhost1 - webhost2 - webhost3 ### Global Options Block globals: options: my_global_option: help: "This is my global option" short: -g long: --global var: some_global_variable ### The commands block commands: run: options: foo: help: "This is some foo option" short: -f long: --foo type: choice var: some_foo_variable required: True not_required_if: - some_bar_variable options: - foo1 - foo2 bar: help: "This is some bar option" short: -b long: --bar type: str var: some_bar_variable required: False required_if: - hello - some_baz_variable baz: help: "This is some baz option" short: -z long: --baz type: str var: some_baz_variable required: False mutually_exclusive_with: - some_bar_variable - some_foo_variable envvar: help: "The value for this argument can be derived from an Environmental Variable" short: -E long: --env-var type: str var: env_var env_var: SOME_ENVIRONMENT_VARIABLE env_var_show: True num: help: "This is a numeric argument" short: -n long: --number var: some_num_variable type: int required: False env_var_show: True targets: help: "Playbook targets" short: -t long: --targets type: str var: playbook_targets required: True multiple: help: |- This option can be specified multiple times short: -m long: --multiple type: str var: multiple_arg allow_multiple: True some_switch: help: |- This is some boolean option, behaves like Click's switches, holds the value of True if specified see: https://github.com/pallets/click short: -s long: --some-switch is_flag: true var: some_switch required: True say_hello: help: "Invoke the 'hello' embedded shell function" short: -hello long: --say-hello type: str var: hello is_flag: True say_goodbye: help: "Invoke the 'goodbye' embedded shell function" short: -goodbye long: --say-goodbye type: str var: goodbye is_flag: True hidden_option: help: "This is a hidden option" short: -O long: --hidden-option is_hidden: True type: str var: hidden is_flag: True verbose: help: |- This is a sample paramter that supports counting, as with: -v, -vv, -vvv, which would evaluate to 1, 2, and 3, respectively short: -v allow_counting: True var: verbosity ### The help message help: message: | Invoke the 'run' command epilog: | This line will be displayed at the end of the help text message examples: - example1: | tasks $command - example2: | Usage example 2 ### Embedded shell functions functions: hello: shell: bash help: Say hello source: |- echo Hello! The value for var1 is $var1 goodbye: shell: bash help: Say goodbye source: |- echo The value for var1 is $var1. Goodbye!Again, notice the two switches-helloand-goodbye, with mapped variableshelloandgoodbye, respectively.These mapped variables correspond to keys in thefunctionsblock with matching names.As such, specifying either or both-helloand-goodbyein yourtasks runinvocationwill short-circuit normal operation and execute the corresponding functionsin the order in which you call them.Try it yourself by running:tasks run -t local -s -b bar -m one -m two -vvv -O -hello -goodbyetasks run -t local -s -b bar -m one -m two -vvv -O -goodbye -helloThere is also a special flag---invoke-functionthat is globally available to all subcommands.Invocation is as follows:tasks <subcommand> ---invoke-function <function_name>.In our example, we would run:tasks run -t local -s -b bar -m one -m two -vvv -O ---invoke-function helloFor more usage examples, see theappendix.More about embedded shell functionsLet's briefly side-step into embedded shell functions.The syntax for nesting these under thefunctionskey is as follows:name_of_function: shell: bash, ruby, or python help: Help Text to Display hidden: false/true source: |- {{ code }}Back To TopBash example:hello: shell: bash help: Hello World in Bash hidden: false source: |- echo 'Hello World!'Python example:hello: shell: python help: Hello World in Python hidden: false source: |- print('Hello World!')Ruby example:hello: shell: ruby help: Hello World in Ruby hidden: false source: |- puts 'Hello World!'Back To TopPopulate the vars block - dynamic inventory expressionA useful feature of this tool is the ability to define your ansibleinventory as a dynamic expression in the Taskfile itself.To do so, we populate the with theinventory_expressionkey.When the inventory is defined in this manner, the logic is as follows:The inventory expression is evaluatedAn ephemeral inventory file is created with thecontents of this file being the output, or result, of that expressionThe fully qualified path to the ephemeral inventory file is specified as theargument to theansible-playbookinventory parameter-iLet's define our inventory expression:Click to ExpandTaskfile.yaml### The hosts block - hosts: myhosts gather_facts: true become: true ### The vars block vars: var1: value1 var2: value2 var3: value3 var4: |- This is a multi-line value of type string var5: - listvalue1 - listvalue2 - listvalue3 - listvalue4 var6: some_key: some_child_key: dictvalue1 var7: $(echo some_value) var8: 8000 dbhosts: - dbhost1 - dbhost2 - dbhost3 webhosts: - webhost1 - webhost2 - webhost3 ### Global Options Block globals: options: my_global_option: help: "This is my global option" short: -g long: --global var: some_global_variable ### The commands block commands: run: options: foo: help: "This is some foo option" short: -f long: --foo type: choice var: some_foo_variable required: True not_required_if: - some_bar_variable options: - foo1 - foo2 bar: help: "This is some bar option" short: -b long: --bar type: str var: some_bar_variable required: False required_if: - hello - some_baz_variable baz: help: "This is some baz option" short: -z long: --baz type: str var: some_baz_variable required: False mutually_exclusive_with: - some_bar_variable - some_foo_variable envvar: help: "The value for this argument can be derived from an Environmental Variable" short: -E long: --env-var type: str var: env_var env_var: SOME_ENVIRONMENT_VARIABLE env_var_show: True num: help: "This is a numeric argument" short: -n long: --number var: some_num_variable type: int required: False env_var_show: True targets: help: "Playbook targets" short: -t long: --targets type: str var: playbook_targets required: True multiple: help: |- This option can be specified multiple times short: -m long: --multiple type: str var: multiple_arg allow_multiple: True some_switch: help: |- This is some boolean option, behaves like Click's switches, holds the value of True if specified see: https://github.com/pallets/click short: -s long: --some-switch is_flag: true var: some_switch required: True say_hello: help: "Invoke the 'hello' embedded shell function" short: -hello long: --say-hello type: str var: hello is_flag: True say_goodbye: help: "Invoke the 'goodbye' embedded shell function" short: -goodbye long: --say-goodbye type: str var: goodbye is_flag: True hidden_option: help: "This is a hidden option" short: -O long: --hidden-option is_hidden: True type: str var: hidden is_flag: True verbose: help: |- This is a sample paramter that supports counting, as with: -v, -vv, -vvv, which would evaluate to 1, 2, and 3, respectively short: -v allow_counting: True var: verbosity ### The help message help: message: | Invoke the 'run' command epilog: | This line will be displayed at the end of the help text message examples: - example1: | tasks $command - example2: | Usage example 2 ### Embedded shell functions functions: hello: shell: bash help: Say hello source: |- echo Hello! The value for var1 is $var1 goodbye: shell: bash help: Say goodbye source: |- echo The value for var1 is $var1. Goodbye! ### The inventory expression inventory_expression: | [local] localhost ansible_connection=local [web_hosts] $(echo -e "${webhosts}" | tr ',' '\n') [db_hosts] $(echo -e "${dbhosts}" | tr ',' '\n') [myhosts:children] web_hosts db_hostsAs you can see, the inventory expression is dynamic, asit gets evaluated based on the output of inline shell commands.Let's focus on the variable$webhosts.As per the logic describedabove, the variable $webhosts is a heredoc with a value of:webhosts=' webhost1 webhost2 webhost3 'As such, theweb_hostsgroup in the inventory expression ...[web_hosts] $(echo -e "${webhosts}" | tr ',' '\n')... will evaluate to:[web_hosts] webhost1 webhost2 webhost3Also, notice how the inline shell command transforms commas into newline characters by way of the transform (tr) command.This makes it so that if we were to have defined thewebhostsvariablein the Tasksfile aswebhosts: webhost1,webhost2,webhost3, it would have had the same outcomeas defining it as a list object in thevarsblock.Populate the vars block - inventory fileWe can specify an inventory file instead of an inventory expression with theinventory_filekey.Click to ExpandTaskfile.yaml### The hosts block - hosts: myhosts gather_facts: true become: true ### The vars block vars: var1: value1 var2: value2 var3: value3 var4: |- This is a multi-line value of type string var5: - listvalue1 - listvalue2 - listvalue3 - listvalue4 var6: some_key: some_child_key: dictvalue1 var7: $(echo some_value) var8: 8000 dbhosts: - dbhost1 - dbhost2 - dbhost3 webhosts: - webhost1 - webhost2 - webhost3 ### Global Options Block globals: options: my_global_option: help: "This is my global option" short: -g long: --global var: some_global_variable ### The commands block commands: run: options: foo: help: "This is some foo option" short: -f long: --foo type: choice var: some_foo_variable required: True not_required_if: - some_bar_variable options: - foo1 - foo2 bar: help: "This is some bar option" short: -b long: --bar type: str var: some_bar_variable required: False required_if: - hello - some_baz_variable baz: help: "This is some baz option" short: -z long: --baz type: str var: some_baz_variable required: False mutually_exclusive_with: - some_bar_variable - some_foo_variable envvar: help: "The value for this argument can be derived from an Environmental Variable" short: -E long: --env-var type: str var: env_var env_var: SOME_ENVIRONMENT_VARIABLE env_var_show: True num: help: "This is a numeric argument" short: -n long: --number var: some_num_variable type: int required: False env_var_show: True targets: help: "Playbook targets" short: -t long: --targets type: str var: playbook_targets required: True multiple: help: |- This option can be specified multiple times short: -m long: --multiple type: str var: multiple_arg allow_multiple: True some_switch: help: |- This is some boolean option, behaves like Click's switches, holds the value of True if specified see: https://github.com/pallets/click short: -s long: --some-switch is_flag: true var: some_switch required: True say_hello: help: "Invoke the 'hello' embedded shell function" short: -hello long: --say-hello type: str var: hello is_flag: True say_goodbye: help: "Invoke the 'goodbye' embedded shell function" short: -goodbye long: --say-goodbye type: str var: goodbye is_flag: True hidden_option: help: "This is a hidden option" short: -O long: --hidden-option is_hidden: True type: str var: hidden is_flag: True verbose: help: |- This is a sample paramter that supports counting, as with: -v, -vv, -vvv, which would evaluate to 1, 2, and 3, respectively short: -v allow_counting: True var: verbosity ### The help message help: message: | Invoke the 'run' command epilog: | This line will be displayed at the end of the help text message examples: - example1: | tasks $command - example2: | Usage example 2 ### Embedded shell functions functions: hello: shell: bash help: Say hello source: |- echo Hello! The value for var1 is $var1 goodbye: shell: bash help: Say goodbye source: |- echo The value for var1 is $var1. Goodbye! ### Inventory file inventory_file: '/some/path/some/inventory.yaml'Notes of Importance:The value you provide to theinventory_filekey supports templatingThat is, any of the variables available runtime variables can be used, for example:inventory_file: '/some/path/some/inventory_$foo_variable.yaml'inventory_file: '/some/path/some/inventory_$var1.yaml'You should not be specifying both aninventory_fileand aninventory_expression, as you get unexpected results.Back To TopAdd tasksFinally, let's add some proper ansible tasks!Click to ExpandTaskfile.yaml### The hosts block - hosts: myhosts gather_facts: true become: true ### The vars block vars: var1: value1 var2: value2 var3: value3 var4: |- This is a multi-line value of type string var5: - listvalue1 - listvalue2 - listvalue3 - listvalue4 var6: some_key: some_child_key: dictvalue1 var7: $(echo some_value) var8: 8000 dbhosts: - dbhost1 - dbhost2 - dbhost3 webhosts: - webhost1 - webhost2 - webhost3 ### Global Options Block globals: options: my_global_option: help: "This is my global option" short: -g long: --global var: some_global_variable ### The commands block commands: run: options: foo: help: "This is some foo option" short: -f long: --foo type: choice var: some_foo_variable required: True not_required_if: - some_bar_variable options: - foo1 - foo2 bar: help: "This is some bar option" short: -b long: --bar type: str var: some_bar_variable required: False required_if: - hello - some_baz_variable baz: help: "This is some baz option" short: -z long: --baz type: str var: some_baz_variable required: False mutually_exclusive_with: - some_bar_variable - some_foo_variable envvar: help: "The value for this argument can be derived from an Environmental Variable" short: -E long: --env-var type: str var: env_var env_var: SOME_ENVIRONMENT_VARIABLE env_var_show: True num: help: "This is a numeric argument" short: -n long: --number var: some_num_variable type: int required: False env_var_show: True targets: help: "Playbook targets" short: -t long: --targets type: str var: playbook_targets required: True multiple: help: |- This option can be specified multiple times short: -m long: --multiple type: str var: multiple_arg allow_multiple: True some_switch: help: |- This is some boolean option, behaves like Click's switches, holds the value of True if specified see: https://github.com/pallets/click short: -s long: --some-switch is_flag: true var: some_switch required: True say_hello: help: "Invoke the 'hello' embedded shell function" short: -hello long: --say-hello type: str var: hello is_flag: True say_goodbye: help: "Invoke the 'goodbye' embedded shell function" short: -goodbye long: --say-goodbye type: str var: goodbye is_flag: True hidden_option: help: "This is a hidden option" short: -O long: --hidden-option is_hidden: True type: str var: hidden is_flag: True verbose: help: |- This is a sample paramter that supports counting, as with: -v, -vv, -vvv, which would evaluate to 1, 2, and 3, respectively short: -v allow_counting: True var: verbosity ### The help message help: message: | Invoke the 'run' command epilog: | This line will be displayed at the end of the help text message examples: - example1: | tasks $command - example2: | Usage example 2 ### Embedded shell functions functions: hello: shell: bash help: Say hello source: |- echo Hello! The value for var1 is $var1 goodbye: shell: bash help: Say goodbye source: |- echo The value for var1 is $var1. Goodbye! ### The inventory expression inventory_expression: | [local] localhost ansible_connection=local [web_hosts] $(echo -e "${webhosts}" | tr ',' '\n') [db_hosts] $(echo -e "${dbhosts}" | tr ',' '\n') [myhosts:children] web_hosts db_hosts tasks: - name: Show Variables debug: msg: |- {{ hostvars[inventory_hostname] | to_nice_json }}The task above will display all available host variables.Usage ExamplesQuick usage examples:Display help for main commandtasks --helpDisplay help for therunsubcommandtasks run --helpInitialize your workspacetasks initRun the Taskfile.yaml playbook, passing in additional options to the underlying subprocesstasks run -t local -s -b bar -m one -m twoDon't do anything, just echo the underlying shell commandtasks run -t local -s -b bar -m one -m two -O ---echoResult should be similar to:ansible-playbook -i /var/folders/5f/4g4xnnv958q52108qxd2rj_r0000gn/T/ansible-inventorytlmz2hpz.tmp.ini \ -e "{'var1':'${var1}'}" ... Taskfile.yamlRun the embedded functionhellotasks run -t local -s -b bar -m one -m two -helloRun the embedded functionshelloandgoodbyerun -t local -s -b bar -m one -m two -hello -goodbyeBack To TopInstallationAnsible-taskrunner consists of thetaskscommand.It can be installed in a few ways:pip install ansible-taskrunnerpip install git+https://github.com/berttejeda/ansible-taskrunner.gitObtaining arelease(these lag behind the pip distributions)Note: You'll need to pre-install a python distribution for the Windows MSI release. Not yet sure if I am doing something wrong or if that's by design. I lean toward the former :|More ExamplesReview theexamplesdirectory for more hands-on usage samples.AppendixThe Options SeparatorWhen you pass the---options separator to any subcommand, anything after the separator is passed directly to the ansible subprocess.Bastion ModeIf you're launching thetaskscommand from a Windows host, this tool will automatically execute inBastion ModeUnder Bastion Mode, thetaskscommand will:Execute theansible-playbooksubprocess via abastion host, i.e. a remote machine thatshould haveansibleinstalledThis is done via ssh using theparamikomoduleRunning in Bastion Mode requires a configuration file containing the ssh connection settings.To initialize this configuration file, you can simply runtasks init.For full usage options, enter intasks init --help.Once you've initialized the configuration file, you should seesftp-config.jsonin your workspace.This configuration file is fashioned after thesftpplugin forSublime Textand is thus compatible.Special Variablesansible_playbook_commandIf you define the playbook variableansible_playbook_command, this will override the underlying ansible-playbook command invocation.As an example, suppose I define this variable in the aboveTaskfile.yaml, as follows:- hosts: myhosts gather_facts: true become: true vars: ansible_playbook_command: 'python ${HOME}/ansible_2.7.8/ansible-playbook' var1: value1 var2: value2 var3: value3 # ...Upon invoking thetaskscommand with the---echoflag:The temporary inventory would be revealed as:inventory_is_ephemeral=True if [[ "$inventory_is_ephemeral" == "True" ]];then echo -e """${inventory_expression}"""| while read line;do eval "echo -e ${line}" >> "/var/folders/some/path/ansible-inventoryo4fw4ttc.tmp.ini"; done fi;*The above inventory file path will differ, of courseAnd the underlying shell command would be revealed as:python ${HOME}/ansible_2.7.8/ansible-playbook \ -i /var/folders/some/path/ansible-inventoryo4fw4ttc.tmp.ini \ -e "{'var1':'${var1}'}" \ -e "{'var2':'${var2}'}" \ -e "{'var3':'${var3}'}" \ ... Taskfile.yamlBack To Toppre_executionAnything defined under thepre_executionvariable will be evaluatedbeforeall other statements in the underlying shell expression.As an example, suppose I define the pre_execution variable in the aboveTaskfile.yaml, as follows:- hosts: myhosts gather_facts: true become: true vars: pre_execution: |- export pxe_var=some_value touch /tmp/.run.lockUpon invoking thetaskscommand with the---echoflag:The underlying shell expression would be revealed as:... export pxe_var=some_value touch /tmp/.run.lock ...The commands above are always placedbeforeall variables declarations in the underlying shell expresison.post_executionThis is similar topre_execution, except that anything defined under thepost_executionvariable will be evaluatedafterall other statements in the underlying shell expression.environment_varsBy defining the playbook dictionary variableenvironment_vars,the following occurs:For each dictionarykey: valuepair:A correspondingexportstatement is defined in the underlying shell expressionAs an example, suppose I define this variable in the aboveTaskfile.yaml, as follows:- hosts: myhosts gather_facts: true become: true vars: ansible_playbook_command: 'python ${HOME}/ansible_2.7.8/ansible-playbook' var1: value1 var2: value2 var3: value3 some_path: /some/path environment_vars: MY_ENV_VAR1: "${some_path}/${var1}" MY_ENV_VAR2: "${some_path}/${var2}" # ...Upon invoking thetaskscommand with the---echoflag:The underlying shell expression would be revealed as:var1="value1" var2="value2" export MY_ENV_VAR1="${some_path}/${var1}" export MY_ENV_VAR2="${some_path}/${var2}"These export statements are always placedafterall variables declarations in the underlying shell expresison.ANSIBLE_ VariablesAny variables matching ANSIBLE_.* will automatically be expressed as export statements.As an example, suppose I define such variables in the aboveTaskfile.yaml, as follows:- hosts: myhosts gather_facts: true become: true vars: ANSIBLE_VAULT_PASSWORD_FILE: /some/path/some/password_file ANSIBLE_CALLBACK_PLUGINS: /some/other/path/some/plugins # ...Upon invoking thetaskscommand with the---echoflag:The underlying shell expression would be revealed as:var1="value1" var2="value2" export ANSIBLE_VAULT_PASSWORD_FILE="/some/path/some/password_file" export ANSIBLE_CALLBACK_PLUGINS="/some/other/path/some/plugins"cli_providerYou can override the underlying command-line provider in two ways:Via the tasks config file (seeexamples)By defining the variablecli_providerin the specified TaskfileAs an example, suppose I define this variable in the aboveTaskfile.yaml, as follows:- hosts: myhosts gather_facts: true become: true vars: cli_provider: bash # ...Upon invoking thetaskscommand, you will note that the app no longer operates in anansible-playbookmode, but rather as yaml-abstracted bash-script.There are three cli-providers built in to the tasks command:ansiblebashvagrantansible_extra_optionsApart from utilizing the---options separator, you can specify additional options to pass to the underlyingansible-playbooksubprocess by setting an appropriate value for the__ansible_extra_options__Environmental variable.tasks_fileThe__tasks_file__variable points to the current Taskfile.It is available to the underlying subprocess shell.commandThe__command__variable points to the name of the invoked subcommand.It is available to the underlying subprocess shell.Back To TopMutually Exclusive OptionsThis tool supports the following advanced options:Mutually Exclusive, seeMutually exclusive option groups in python Click - Stack Overflow.Mutually InclusiveConditionally requiredSuppose you want a set of options such that:You want to accept one option but only if another, related option has not been specifiedYou can accomplish this by defining your option with the following parameters:- required: False - mutually_exclusive_with: - some_bar_variable - some_foo_variableIn the above configuration, calling this option along with options-f|-fooand-b|-barwill trigger an illegal usage error, since you'vemarked the option as mutually exclusive with either of these two options.Feel free to review theTaskfile.yaml, as you'll find an example of:mutually exclusivemutually inclusiveconditionally requiredSimple TemplatingAs of version 1.1.5, simple templating is available to the following objects:Help messagesExamplesOptionsOptions valuesWhat this means is that we expose a limited set of internal variables to the above.As an example:help: message: | Invoke the 'run' command epilog: | This line will be displayed at the end of the help text message examples: - example1: | tasks -f $tf_path --foo foo --bar bar - example2: | tasks -f $tf_path --foo foo --baz bazIn the above strings,$tf_pathwill expand to the internal variable tf_path, which holds the relative path to the current tasks file.Below is a list of available variables for your convenience:Variable | Description ------------- | ------------- exe_path | The absolute path to the tasks executable cli_args | The current command-line invocation cli_args_short | The current command-line invocation, minus the executable sys_platform | The OS Platform as detected by Python tf_path | The relative path to the specified TaskfileAdditionally, allcurrently set environmental variablesare also available for templating.Back To TopSingle-Executable ReleasesThis script also ships as a zipapp executable (similar to a windows .exe).Head over to thereleases pagefor release downloads.You can also build your own single-executable zipapp, as follows:Make sure you have themake-zipappexecutable in your pathInvoking build tasksBuild zipapp:python ansible_taskrunner/cli.py -f Makefile.yaml run ---make zipappRead More on zipapps:zipapp โ€” Manage executable Python zip archives โ€” Python 3.7.4rc2 documentationUnit TestingTo run all tests, simply call the test script, as with:python tests/test_ansible_taskrunner.pyTODO - Add more tests!Back To TopLicense and CreditsThis project adopts the the MIT distribution License.Releasescome bundled with the following opensource python packages:click, licensed under BSD-3-ClausepyYaml, licensed under MITLastly, this package was created with Cookiecutter and theaudreyr/cookiecutter-pypackageproject template.Cookiecutter:https://github.com/audreyr/cookiecutteraudreyr/cookiecutter-pypackage:https://github.com/audreyr/cookiecutter-pypackage
ansible-template-validator
ansible-config-validatorA helper script to use with the validate option from ansibletemplatemoduleThe module provides a command line tool to validate configuration templates in cases where the validation depends on more than one file, and there is no clear way to sandboxing the validation process.So, for example, if you want to validate anNGINXconfig file that contains a server block configuration you will have to validate the entire configuration tree ofNGINXfiles, therefore what this script does is to replace the original config file with the new one, runs the validation command, and then restores all to the previous state independently of the validation command result.Installpipinstallansible-config-validatorUsageusage:ansible-template-validator[-h][-lSYMLINK]new_fileoriginal_filevalidation_command Commandtobeusedashelperwithansibletemplatevalidate.Replaces original_filewithnew_file,andthenrunvalidation_command.Afterthis, returnsvalidation_commandreturncodeandoriginal_fileisrestored.Ifa symlinkisspecified,incaseitdoesn't exists, it is created pointing tooriginal_file and then is deleted.positional arguments:new_file File used to replace original_fileoriginal_file Original file that is going to be validatedvalidation_command Command to be executed to validate the config filesoptional arguments:-h, --help show this help message and exit-l SYMLINK, --create-sym-link SYMLINKCreates an ephemeral symbolic link pointing tooriginal_file, just in case it doesn'texists.Example-name:Update nginx {{website_config}} filetemplate:src:"website.conf"dest:"{{website_config}}"validate:"ansible-template-validator%s{{website_config}}{{nginx_validation_command|quote}}"vars:website_config:"/etc/nginx/sites-enabled/website.conf"nginx_validation_command:/usr/sbin/nginx -t -q -g 'daemon on; master_process on;Note:The script must have been previously installed on the target node.
ansible-terminal
Ansible SSHThis script list hosts which are defined in Ansible Inventory and open SSH/SFTP connection to host which is selected.UsagePrint usage:ansible-terminalPrint version:ansible-terminal -vWork with Ansible Inventory by different optionsusage: ansible-terminal [-h] -a [INVENTORY_PATH [INVENTORY_PATH ...]] -p {ssh,sftp} [--debug] [-v] [-n NAME] [-u SSH_USER] [-k SSH_KEY] Open SSH/SFTP session to hosts defined in Ansible Inventory optional arguments: -h, --help show this help message and exit -a [INVENTORY_PATH [INVENTORY_PATH ...]] Path for Ansible Inventory file or directory. Multiple definitions can be done.If directory is given, all Ansible Inventory files will be parsed recursively -p {ssh,sftp} Protocol type for connection to Hosts. ssh / sftp --debug Enable debug logs -v show program's version number and exit -n NAME Name of host to search. If one host matches, will connect automaically -u SSH_USER SSH Username for ssh connection type. This will override ansible_ssh_user for all connections -k SSH_KEY SSH Key File path for ssh connection type. This will override ansible_ssh_private_key_file for all connectionsPyPI -https://pypi.org/project/ansible-terminal/NotesFor default, Below parameters are used for SSH/SFTP connection.user: root ssh-key: ~/.ssh/ target machine: hostYou can overwrite these values by defining relatedAnsible Behavioral Inventory Propertiesin the inventory. Parameters:ansible_ssh_user ansible_host ansible_ssh_private_key_fileThanksPlease do not forget to star when you are using : )
ansible-terraform-variables
No description available on PyPI.
ansible-test
Ansible-test is a tool for testing your automation on local docker images. You can think of this as a slim version of Chefโ€™s test-kitchen$cd/my/ansible/repository$ansible-testmy_ansible_roleThe above command will drop a Dockerfile at the root of your ansible repo and initialize a docker image with ansible installed. It will then run the ansible role โ€œmy_ansible_roleโ€.Note that ansible-test also accepts arbitrary arguments. These arguments will be passed onto the ansible-playbook command while running tests.InstallationTo install ansible-test:$pipinstallansible-testDocumentationansible-test requires that you have docker installed locally. If you are using Mac OSX, I reccommend you use boot2docker.NOTE: Given dockerโ€™s inflexibility with Dockerfiles, ansible-test will overwrite the file Dockerfile at the current working directory from which you run ansible-test. This is currently the simplest way to integrate docker as a testing tool.
ansible-testing
UNKNOWN
ansible-tests
Ansible testMake testinfra easier with ansible repository.Write your test directly in your rolespurpose of ansible-testsI want to be able to write testinfra tests in my role and use my inventories and my playbooks to run themUsagesansible-tests --file-name tests.yml --inventory inventory/dev.iniTest your ansible rolesYour tests should be in test directory inside your role :nginx โ”œโ”€โ”€ defaults โ”‚ย ย  โ””โ”€โ”€ main.yml โ”œโ”€โ”€ handlers โ”‚ย ย  โ””โ”€โ”€ main.yml โ”œโ”€โ”€ tasks โ”‚ย ย  โ””โ”€โ”€ main.yml โ””โ”€โ”€ tests โ””โ”€โ”€ test_nginx.pyExample of test file :# tests/test_nginx.py def test_check_nginx_is_installed(host): nginx = host.package('nginx') assert nginx.is_installed def test_nginx_is_running(host): nginx = host.service('nginx') assert nginx.is_runningExample of corersponding task file :# tasks/main.yml --- - name: install nginx package: name: nginx state: present - name: start nginx service: name: nginx state: startedConfigure ansible-testTo run ansible test, you have to respect this requirements:your roles must be inrolesdirectoryyou must have a playbook or a file to describe the matching between tests and serverstests.yml supported formats- hosts: bdd roles: postgres - hosts: all roles: secu- hosts: all roles: - base - secu- hosts: - bdd - web-app roles: - role: secu - role: users- hosts: bdd:web-app roles: - role: secuYou should be able to use directly your playbook if you don't use stuff like!groupto exclude some group
ansible-test-tool
Ansible-test is a tool for testing your automation in docker containers. It works a little bit like chefโ€™s kitchen.usage:ansible-test[-h][--ansibleANSIBLE][--imageIMAGE]roleroles_pathpositionalarguments:roleDefinetheroletotestroles_pathDefinethepathtotheroles(likeinansible.cfg)optionalarguments:-h,--helpshowthishelpmessageandexit--ansibleANSIBLE,-aANSIBLETheansibleversiontoinstall--imageIMAGE,-iIMAGEThedockerbaseimagetotesttherole/playbookon.InstallationTo install ansible-test:$pipinstallansible-testDocumentationansible-test requires that you have docker installed locally. If you are using Mac OSX, I recommend you use boot2docker.
ansible-toolbox
UNKNOWN
ansible-toolkit
UNKNOWN
ansible-toolkit-ng
No description available on PyPI.
ansible-tools
ansible-toolsThis is a set of wrappers around theansible,ansible-playbookandansible-vaultcommands which integrate with the system keyring to retrieve the vault password.It should work on both Linux and macOS.InstallationOn macOS, with Homebrew:brew install lvillani/tap/ansible-tools;With Pip:pip install --user ansible-tools;It is best, however, to installansible-toolsin a Virtualenv, along with the version of Ansible you are using.Overviewansible-vault-helper: Used by users to setup keyring integration, called by Ansible to obtain a Vault unlock password.vaultify: Wraps Ansible commands such asansible,ansible-playbookandansible-playbookso that the Vault is automatically unlocked with the password stored in the system's keyring.ansible-local: Wrapper to run Ansible locally.ansible-mkpasswd: Generates an encrypted password that can be used with the user module (see alsohere)UsageGo to the same directory that contains your playbooks and then run:ansible-vault-helper --updateYou will be prompted for a vault name (which can be anything) and the unlock password. The former is stored inansible.cfgalongside your playbooks, the latter is securely stored in your keyring.At this point you can run Ansible as usual but precede the command withvaultify. That is, to start a playbook run:vaultify ansible-playbook site.ymlWe also ship a tool to easily apply a playbook on the current system calledansible-localwhich is composable withvaultify.AliasesHere's a list of handy shell aliases to make your life easier. They were tested on fish but should work also on Bash and Zsh:alias v="vault" alias ansible="vaultify ansible" alias ansible-playbook="vaultify ansible-playbook"
ansible-toolset
No description available on PyPI.
ansible_tools_spidy
No description available on PyPI.
ansible-tower-cli
Welcome to tower-clitower-cliis a legacy command line tool for Ansible Tower.It is also what the Ansibletower_*modules use under the hood. Such as:https://docs.ansible.com/ansible/latest/modules/tower_organization_module.htmlThese modules are now vendored as part of the AWX collection at:https://galaxy.ansible.com/awx/awxSupporting correct operation of the modules is the maintenance aim of this package.Anyone developing new tooling around AWX or Ansible Tower via a Unix command line is suggested to use the new CLI.https://github.com/ansible/awx/tree/devel/awxkit/awxkit/cli/docsRelease History3.3.9 (2020-03-12)Improve error handling for template specification in workflow schema command.Pin the click library to avoid changing look and feel of output.3.3.8 (2020-01-14)Process deprecated vault_credential parameter with extra request3.3.7 (2019-10-25)Job template associate_credential now uses โ€œcredentialsโ€ endpointInclude related credentials to job templates in send and receive commandsAdd field for job_slice_count to job template resource3.3.6 (2019-07-19)Fix formatting for upload to PyPI server3.3.5 (2019-07-19)Fix error with use of โ€“insecure flagAllow notifications to be used with projectsFix send command error when job and workflow have the same nameFix receive command when schedules have survey answersFix error associating credential with workflow node3.3.4 (2019-04-22)Fix receive command bugs related template labelsFix receive command bug when importing to custom credential typesFix receive command bug when host name was in multiple inventoriesFix bugs with special characters in config optionsFix bug using HipChat notification โ€œnotifyโ€ optionPassword prompt written to stderr nowSupport prompting for inventory and variables with workflowsAllow managing certain user-configurable instance properties3.3.3 (2019-03-22)Fix bug where workflow schema would hang if there were too many nodesAdd organization job_template_role to role management3.3.2 (2019-01-28)Fix bug where verify_ssl config parameter was not respectedFix bug where โ€“all-pages was ignored listing team roles3.3.1 (2019-01-24)Fixed associating labels to workflowsAssociating labels to job template now takes option as โ€“job-templateAllow adding workflows inside of workflowsAllow exporting schedules of workflowsSend command now uses default terminal background colorFix some unicode errors in send/receive commandsHide display of page number for human-formatted single page resultsAllow setting the custom virtual environment on projects and organizations3.3.0 (2018-04-25)Added send and receive commands to export and import resourcesAdded support for import and export role memberships as wellAdded login command for token-based auth (AWX feature)Added options for workflow nodes and schedules (AWX feature)Added support for server-side copying (AWX feature)Added resource for activity streamAdded abstract resource for job eventsBug fixes for label creation, workflow monitor, global config, role list3.2.1 (2017-12-19)Added support for using settings from environment vars in normal CLI useMade many-to-many relations easier to manage with a new field typeInstalled new CLI entry point, awx-cliAllowed setup and testing to proceed without root privilegesAdded project and inventory update resources to enable more functionalityFixed bug when copying resources that use the variables field typeFixed bug that caused debug messages to hang with long line lengthsFixed bug with side-by-side install of v1 and v2Fixed bug where โ€“all-pages was ignored for rolesAllowed use of โ€“format=id with multiple resultsAdded cleaner handling of Unicode3.2.0 (2017-10-04)General:Officially support using tower_cli as a python library.Major documentation updates. From 3.2.0 docs are hosted onhttp://tower-cli.readthedocs.io.Added project_update and inventory_update resources to allow canceling and deleting.Updates from Tower 3.2:Migrated to API V2. All API calls will start with/api/v2instead of/api/v1.Made inventory_source an external resource and remove the old relationship to its associated group. Remove launching inventory updates from group resource.Added credential_type resource and significantly modified credential resource to reveal user-defined credentials feature of Tower 3.2.Added job template extra credential (dis)association to reveal extra_credential field of 3.2 job templates.Removed all source-specific inventory source fields and replaced them with acredentialfield.Updated inventory resource fields to reveal smart inventory and insights integration features of Tower 3.2.Addedlist_factandinsightscommands to host resource to reveal smart inventory and insights integration features of Tower 3.2.Addedinstanceandinstance_groupresources to reveal instance/instance group feature of Tower 3.2.Enabled (dis)associating instance groups to(from) organization, job_template and inventory resources to reveal instance/instance group feature of Tower 3.2.Added support for Tower 3.2 SCM inventory sources.Updated job_template resource fields to reveal changes in Tower 3.2, includingโ€“diffmode feature.Updated job resource launch command to reveal changes in Tower 3.2, includingโ€“diffmode feature.Updated ad_hoc resource fields to reveal changes in Tower 3.2, includingโ€“diffmode feature. Specifically, changed name ofโ€“becomeoflaunchcommand intoโ€“become-enabled.Deprecated features:Removed permission resource.Disabled launching a job using the jobs endpoint.Removed scan jobs in favor of new job fact cache.Removed Rackspace options.Remove outdated association function for projectโ€™s organization.Reflected from 3.1.8:Include method of installing with alias tower-cli-v2Fix bug of incomplete role membership lookup, preventing granting of roles.Combine click parameters from multiple base classes in metaclass.Fix unicode bug in human display format.Add new page_size parameter to list view.Add scm_update_cache_timeout field to project resource.Begin process to deprecate python 2.6.3.1.7 (2017-08-07)Follow up 3.1.6 by duplicating exceptions.py to supportimport tower_cli.utils.exceptionssyntax.3.1.6 (2017-07-18)Fix a usage compatibility issue for Ansible Tower modules.3.1.5 (2017-07-12)Major code base file structure refactor. Now all click-related logics are moved totower_cli/cli/directory, andexceptions.pyas well ascompat.pyare moved out of utils directory into base directory.Categorize help text options for resource action commands (likeupdate) to increase readability.Behavior change of workflow schema command. Now schema will both create new nodes and delete existing nodes when needed to make the resulting workflow topology exactly the same as described in schema file.Add commandjob_template callbackto enable conducting provisioning callback via Tower CLI.Add new format option to just echo id.Expand some resource fields, including hipchat rooms for notification template and allow_simultaneous for job templates.Lookup related inventory sources with โ€œstarts withโ€ logic if its name is not fully qualified.Fixed a python 3.5 compatibility issue that causes job monitor traceback.Minor typo and help text updates.3.1.4 (2017-06-07)Support resource copy subcommand.Support auth-token-based authentication for Tower CLI requests.Support managing workflow roles, labels and notifications via Tower CLI.Several fixes on RPM spec file.Name change from โ€˜foremanโ€™ to โ€˜satellite6โ€™ in credential kind choices.Fixed a bug where creating job templates with โ€“extra-vars did not work after 3.1.0 upgrade.Fixed traceback when launching job with โ€“use-job-endpoint.Enhanced json library usage to prevent traceback when using earlier python 2.6 versions.Prevent throwing unnecessary warning when reading from global configuration file.3.1.3 (2017-03-22)Fixed a bug where extra_vars were dropped in some commands.3.1.2 (2017-03-21)Fixed a bug where global flags are not added to some commands.3.1.1 (2017-03-13)Fixed a bug which blocks named resources from using runtime configure settings.Fixed a bug in 3.1.0 which sometimes causes traceback whenpkvalue is given.3.1.0 (2017-03-09)Improved job monitoring functionality to enable standard out streaming, which displays real-time job output on command line.Added workflow, workflow_job and node endpoints to manipulate workflow graph and manage workflow job resources. Reflecting workflows feature of Tower 3.1.Added settings command to manage Tower settings via Tower CLI. Reflecting Configure Tower in Tower (CTiT) feature of Tower 3.1.Included timeout option to certain unified job template resources. Reflecting job timeout feature of Tower 3.1.Added unicode support to extra_vars and variable types.Several minor bug fixes to improve user experience.3.0.3 (2017-02-07)Expose custom inventory script resource to the userInclude tests and docs in the release tarballAdded job template skip_tags prompting supportAdded job template callback support3.0.2 (2016-12-08)Enable configuring tower-cli via environment variables3.0.1 (2016-09-22)Added custom SSL certificate support3.0.0 (2016-08-05)Added text indicator for resource changeAllow hosts, inventory, and groups to use variables from the command line and denote a file by starting with โ€œ@โ€Added resource role for tower3.0 and permission for previous tower versionsAdded notification templatesAdded labelsAdded description display optionAdded deprecation warningsHelp text upgradesGive indication of โ€œchangedโ€ apart from colorNew credential fields to support openstack-v2, networking and azureNew options for inventory source/group. Add implicit resource inventory script.credential updates (no longer require user/team)Added support for system auditorsprojects (do not post to organizations/N/projects)prompt-for JT fields + job launch options (allow blank inventory too)Update the POST protocol for associate and disassociate actionsNew job launch option for backwards compatibilityNew tower-cli option to display tower-cli versionEnhanced debug log format (support multi-line debug log)2.3.2 (2016-07-21)Add RPM specfile and MakefileTower compatibility fixesAllow scan JTs as an option for โ€œjob_typeโ€Add ability to create group as subgroup of another groupAdd YAML output format against JSON and humanized output formatsAdd SSL corner case error handling and suggestionAllow resource disassociation with โ€œnullโ€2.3.1 (2015-12-10)Fixed bug affecting force-on-exists and fail_on_found optionsChanged extra_vars behavior to be more compliant by re-parsing vars, even when only one source existsFixed group modify bug, avoid sending unwanted fields in modify requests2.3.0 (2015-10-20)Fixed an issue where the settings file could be world readableAdded the ability to associate a project with an organizationAdded setting โ€œverify_sslโ€ to disallow insecure connectionsAdded support for additional cloud credentialsExposed additional options for a cloud inventory sourceCombined โ€œ launch-time extra_varsโ€ with โ€œ job_template extra_varsโ€ for older Tower versionsChanged the extra_vars parameters to align with Ansible parameter handlingAdded the ability to run ad hoc commandsIncluded more detail when displaying job informationAdded an example bash script to demonstrate tower-cli usage2.1.1 (2015-01-27)Added tests for Python versions 2.6 through 3.4Added shields for github READMEAdded job_tags on job launchesAdded option for project local path2.1.0 (2015-01-21)Added the ability to customize the set of fields used as options for a resourceExpanded monitoring capability to include projects and inventory sourcesAdded support for new job_template job launch endpoint2.0.2 (2014-10-02)Added ability to set local scope for config fileExpanded credential resource to allow options for cloud credentials2.0.1 (2014-07-18)Updated README and error text2.0.0 (2014-07-15)Pluggable resource architecture built around click
ansible-tripleo-ipa-server
This repository contains Ansible for configuring the FreeIPA server for TripleO.Installation$pipinstall--prefix=/usransible-tripleo-ipa-serverOr, if you are installing from source, in the project directory:$pythonsetup.pyinstall--prefix=/usr
ansible-troll
Ansible role testing tool implemented as a plugin for pytest.
ansible-universe
UNKNOWN
ansible-vagrant
Tired of the rather limitedvagrant provisionwith theansibleprovider? Tired of keeping yourhostsfile up to date?ansible-vagrantto the rescue!Usage$ pip install ansible-vagrant $ cd /path/to/project/with/a/vagrantfile $ ansible-vagrant-update-hosts $ cat hosts_vagrant [vagrant] vagrant ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222 ansible_ssh_use... $ ansible-vagrant all -m ping # Same as: ansible-vagrant-update-hosts \ # && ansible all --inventory=./hosts_vagrant -m ping $ ansible-playbook-vagrant playbook.yml # Same as: ansible-vagrant-update-hosts \ # && ansible-playbook --extra-vars="vagrant_host=true" \ # --inventory=./hosts_vagrant playbook.ymlNotesAll*-vagrantcommands useANSIBLE_HOST_KEY_CHECKING=Falseto prevent errors withvagrant destroy && vagrant upItโ€™s a good idea to puthosts_vagrantunder.gitignoreansible-playbook-vagrantadds a global variable namedvagrantUsewhen: vagrant_host is (not) definedto run stuff based on the current environmentShortcutsansiblevforansible-vagrantansible-playbookvforansible-playbook-vagrant
ansible-validations
No description available on PyPI.
ansiblevarchecker
ansiblevarcheckerCLI to check what vars are defined / used to find undefined or extra vars not documented.Based on source for ansible 2.9 and striped down and modified version of jinja2schema.Known IssuesSub attributes of a dictionary are marked as defined if a different sub attribute is set e.g# Settingdict:sub:yay# Will cause the use of the following undefined var to be marked as defined{{dict.undefined}}Setting variables in jinja2 templates are seen as variable usage and will be marked as undefined if they have not been registered outside of the jinja2 templateBecause of the removed scalar typing (to fix issues with filter discovery and other edge cases), infer-ing assumes all if statements evaluate to a boolean which can fail when actually run. This is out of scope of what avc is meant to do and is expected behavior (aka, test your code before pushing)Python 3.6.x isn't tested and isn't 100% supported due tohttps://www.python.org/dev/peps/pep-0538/being introduced min 3.7. 3.6 can still be configured to work with UTF-8 encoding but this package is not tested against 3.6Tests can fail withImportError: cannot import name 'soft_unicode' from 'markupsafe'. To overcome this a downgraded version of markupsafe must be usedpip install MarkupSafe==2.0.1On my local machinepython -mneeds to come before theansiblevarcheckerotherwise aImportError: cannot import name 'main' from 'ansiblevarchecker'occurs
ansible-variables
ansible-variablesThe Ansible inventory provides a very powerful framework to declare variables in a hierarchical manner. There a lof of different places where a variable can be defined (inventory, host_vars, groups_vars, ...) and Ansible will merge them in a specific order (variable precedence).ansible-variableswill help to keep track of your host context variables:inventory file or script group varsinventory group_vars/allinventory group_vars/*inventory file or script host varsinventory host_vars/*Based on one host it will return a list with all variables, values and variable type.Tested withansible-core2.11 - 2.16.Installationpipinstallansible-variablesUsageThe command line usage is similar to the official Ansible CLI tools, especially like ansible-inventory, thus to see all possible commands and options runansible-variables --helpGet all variables for a hostThe basic usage is pretty simple, you only need to pass the Ansible hostname to it:ansible-variables mywebserverThis results in following simple rich formatted outputThe verbosity can be increased Ansible like with-v,-vvv, ...With-vthe inventory files where the variable is defined, will be printed. The last file wins.With-vvvit will also print all files which were considered to look for the variable.Get one specific variables for a hostIf you are only interested in one variable you can specify it with--var:ansible-variables mywebserver --var fooSame es above, the verbosity can also increase here.More customizationWith--helpyou will see which further arguments are possible, e.g. you can set the path to your inventory with-iansible-variables mywebserver -i /path/to/inventoryImplementationThis tool is tightly coupled to the Ansible library (ansible-core) and simple reuses what is already there. The whole structure and implementation was inspired and oriented by the implementation ofansible-inventory.To get the source and the inventory files in which Ansible will look for a variable, we are using adebug flagin Ansible'sget_varsmethod.As as result, the output ofansible-variablescan be fully trusted as it uses the same methods as Ansible to get the variable precedence.Limitationsas written in the description, this tool only shows host context variables and does not know anything about playbook or role variables or command line options.Creditsthe screenshots used in this README where created withtermshotLicenseThis project is licensed under theGNU General Public License v3.0
ansible-vault
ansible-vaultThis project aim to R/W an ansible-vault yaml file.This is not Ansible official project.You can install with pip.pip install ansible-vaultWhen you have an ansible-vault file, then you can read file. See below.fromansible_vaultimportVaultvault=Vault('password')data=vault.load(open('vault.yml').read())When you have to write data, then you can write data to file. See below.fromansible_vaultimportVaultvault=Vault('password')vault.dump(data,open('vault.yml','w'))# also you can get encrypted textprint(vault.dump(data))And seewiki.
ansible-vault-manager
Introduction:This tool is a manager to make easier and sharable ansible-vault integration. Itโ€™s almost a prerequisite to combine ansible-vault and CI/CD. With it you donโ€™t need anymore to share vault passphrase with other people. You can rotate them transparently for security good practices. You can use โ€œkeyring pluginsโ€ to extend it and store passphrases on AWS SSM, Bitwarden, or other secured storage system.Help :ansible-vault-manager-client --helpImportant note :The name of executable ends with-clientfor a specific reason ! Since ansible 2.5 ansible vault cares about this suffix, so itโ€™s very important to keep it !https://github.com/ansible/ansible/blob/v2.8.6/lib/ansible/parsing/vault/__init__.py#L367Examples :Create a new vaulted file :ansible-vault-manager-client create --vault-path <dir where create new file>It will ask you for filename, keyring plugin, keyring plugin options, and encryption passwordCreate a new vaulted file with generated password :pwgen | ansible-vault-manager-client create monfichier \ --vault-path vault_vars/ \ --plugin aws_ssm \ --plugin-param region=eu-west-1 \ --plugin-param profile=customer \ --plugin-param path=/ansible/dev/ \ --stdin-pwdAutomatic integration :Before run any ansible command (likeansible-playbook) you have to declare your identities list :# Check usable vault ids and add them to ansible env var USABLE_IDS=$(ansible-vault-manager-client get-usable-ids --vault-path "provisioning/inventory/vault_vars/") if [ "$USABLE_IDS" != "" ]; then export ANSIBLE_VAULT_IDENTITY_LIST="$USABLE_IDS" fiBUGS :Action create not clean new file or remote vault if an error occursInstallation :Global install :pip install ansible-vault-managerPipenv install :pipenv install ansible-vault-managerTODO :Implement actions rekey and encryptMake extensible via custom deported plugins added via a โ€œplugin pathโ€Make native plugin Hashi VaultMake native plugin S3Make native plugin MultiPassMake native plugin sshfsManage secured cache for credentials fetchingGood practices :In any playbook, you can add this play to include all vaulted vars, ordered by ansible groups logic You can create a non standard โ€œvault_varsโ€ dir in your inventory dir. All files into, matching to hosts groups, will be included. โ€œwith_fileglobโ€ permit to not fail if file not exists.- hosts: - all connection: local tasks: - name: Include vaulted vars include_vars: "{{ item }}" # prepend path to all groups, "all" group is not present in group_names, we force it with_fileglob: "{{ (group_names + ['all']) | map('regex_replace', '^(.*)$', inventory_dir + '/vault_vars/\\1') | list }}" tags: - alwaysIf you want, you could apply a similar process for โ€œhosts_varsโ€- hosts: - all connection: local tasks: - name: Include vaulted vars include_vars: "{{ item }}" with_fileglob: "{{ inventory_dir }}/hosts_vault_vars/{{ inventory_hostname }}" tags: - alwaysIn your regulars hosts_vars or group_vars, put ALL your vars ! But if itโ€™s a sensitive var to vault, original var should be equal to a new var.Example :group_vars/pp <= This file is not encrypted, and you can search vars into my_database_password: "{{ vault_my_database_password }}" vault_vars/pp <= This file is encrypted but you know it should contain vault_my_database_password vault_my_database_password: xxxxxxxxxMetadata file informations :A metadata file is used to retrieve all passwords to decrypt vaulted files. If you loose metadata, you canโ€™t know wich passwords where used to encrypt all vaulted files !!! When you create your first vaulted file a file named_metadata.ymlis created at the root of โ€œvault-pathโ€ location. This name is important and the file follow a structure.Detailled structure# A list of all "vault-id" used to encrypt files in this directory (see. https://docs.ansible.com/ansible/latest/user_guide/vault.html#multiple-vault-passwords) # In normal cases, you should never edit this section manually. vault_ids: # Plugin used to store password - plugin: aws_ssm # Config string specific to plugin to fetch password id: customer-account:eu-west-1:/ansible/admins/b32b92b8-6ba8-4941-ba48-3b2e73998631:1 # Could be a list, but probably always one file. Each file should has its own password for security privileges reasons. # This parameter is not mandatory, but usefull for debugging, or if you want change a password. # Without it, you can't know which file is encrypted with this ID. files: - prod - plugin: aws_ssm id: customer-account:eu-west-1:/ansible/dev/4daf2729-7783-43a3-8e3c-9da1b127d8cf:1 files: - webservers - plugin: bitwarden id: profile:organization:ansible-collection:12f5445a-7783-43a3-8e3c-9da1b127d8cf:1 files: - subdir/all # You can MANUALLY add this parameter is some use cases. It permit to include another metadata file (with the same format) and merge all vault_ids. # It can be usefull if you share vaulted vars between multiples playbooks scopes # This parameter contain a list of absolute or rlative path to current metadata dir include: - ../../../other_context/inventory/vault_vars/_metadata.yml - /mnt/other_secure_place/my_metadata.ymlPlugins doc :AWS System Manager (SSM parameter store) :AWS SSM permit to store simple secured key/value parameters. You can apply security policies based on key path, so you can split admin / devs / other permissions on vault credentials. All parameters are versionned, AWS keep each versions of parameters.profile: Boto profile used (AWS account)region: AWS region code where store parameterspath: Path of parameter in SSM, usefull for security policiesVault ID structure :[account profile]:[AWS region]:[parameter path]:[version]Local (or remote locally mounted) filesystem :This plugin provides a simple way to manage versionned password on a local file path. You can use for exemple an sftp / sshfs mount point. Be carefull, basepath must be common for every users of vault !basepath: Directory where vault passwords are storedVault ID structure :[basepath]:[filename]:[version]The file[basepath]/[filename].[version]contains vault passwordBitwarden :TODOVault ID structure :[organization]:[collection]:[name]:[version]Multipass Git :Multipass is a derived version ofhttps://www.passwordstore.org/for multi-users. A set of scripts is available here :https://github.com/toringe/multi-passTODOVault ID structure :[passwords namespace]:[parameter path]:[commit_hash]Multi Hashicorp Vault :You have to install and configure a vault agent, and use Token Helpers (https://www.vaultproject.io/docs/commands/token-helper.html) to permit access to multiples Hashicorp servers if necessary.TODOVault ID structure :[vault instance]:[parameter path]:[version]AWS S3 :TODO
ansible-vault-rekey
ansible-vault-rekeyRoll keys and re-encrypt secrets in any repo using Ansible VaultFree software: BSD licenseDocumentation:https://ansible-vault-rekey.readthedocs.io.UsageWARNING: Very few guardrails present. Running this without optionswilloverwrite data by default.Known issues / caveats:Shows a callous disregard for whitespace and commentsAssumes itโ€™s in a playbook directory if-risnโ€™t providedWill casually write secrets to STDOUT inโ€“debugmode$ ansible-vault-rekey --help Usage: ansible-vault-rekey [OPTIONS] (Re)keys Ansible Vault repos. Options: --debug --dry-run Skip any action that would overwrite an original file. -k, --keep-backups Keep unencrypted copies of files after a successful rekey. -r, --code-path TEXT Path to Ansible code. -p, --password-file TEXT Path to password file. Default: vault-password.txt -v, --vars-file TEXT Only operate on the file specified. Default is to check every YAML file in Ansible role/play dirs for encrypted assets. --help Show this message and exit.You can confirm that your secrets were rencryped properly by running debug on an encrypted var or file. eg:ansible --vault-password-file vault-password.txt -e "@group_vars/all.yml" -i localhost, -c local -m debug -a var=somesecurevar localhostInstallationpip install ansible-vault-rekeyWe have dependencies a couple of layers down which need to compile crypto libraries if you havenโ€™t already got them. On most systems, youโ€™ll need the following:libffi-dev / libffi-devellibssl-dev / openssl-develgccFeaturesTODOTestingWith Docker (recommended):docker build -t tmp . && docker run --rm -it -w /workspace -v $(pwd):/workspace tmpManually:pip install -r requirements.txt pytest & python -m pytest tests/*.pyCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History2.0.1 (2020-12-31)Fix improper encrypting YAML files2.0.0 (2020-12-31)Fix dependencies errorsDropped support for Python2 and Python 3.5Added support for Python 3.7, 3.8, 3.90.1.0 (2017-10-31)First release on PyPI.
ansible-vault-rotate
python-ansible-vault-rotateAdvanced Python CLI to rotate the secret used for ansible vault inline secrets and files in a projectFeaturesReencrypt vault filesReencrypt inline vaulted secretsInstallationIt is strongly recommended to use pipx instead of pip if possible:pipxinstallansible-vault-rotateOtherwise you can also use plain pip, but be warned that this might collide with your ansible installation globally!pipinstallansible-vault-rotateUsageRekey given vault secret with new secret specified on CLIansible-vault-rotate--old-vault-secret-sourcefile://my-vault-password\--new-vault-secret-sourcemy-new-secret\--update-source-secretRekey only specific files (e.g. when using multiple keys per stage)ansible-vault-rotate--old-vault-secret-sourcefile://my-vault-password-<stage>\--new-vault-secret-sourcemy-new-secret\--file-glob-patterngroup_vars/<stage>/*.yml\--update-source-secretGetting help about all argsansible-vault-rotate--helpDevelopmentFor development, you will need:Python 3.9 or greaterPoetryInstallpoetry installRun testspoetry run pytest
ansible-vault-var
ansible-vault-var - Get and set encrypted values in vars yaml file.Featuresget encrypted value as plain text from ansible vars yaml fileset encrypted value from plain text in ansible vars yaml filePrerequisitesGNU makepython >= 3.6pipenvUsageGet variablepython3 -m ansible_vault_var --vault-password-file=vault_password.txt \ get_var --var-name=secret_ingredient --vars-file=secret_vars.ymlSet variablepython3 -m ansible_vault_var --vault-password-file=vault_password.txt \ set_var --var-name=secret_ingredient --vars-file=secret_vars.yml --new-var-value=saltCopyright (c) 2021 byCornelius Buschka.MIT
ansible-vault-win
DescriptionAlthough Ansible only works on POSIX, you may want to edit your inventories and playbooks on Windows. This is a problem if you use any files or values encrypted with Ansible Vault. It may be a pain to find a separate POSIX machine just to run the ansible-vault CLI to encrypt/decrypt these vault files. This is an OS-independent port of a simplified version of just the ansible-vault CLI so that you can work with these encrypted files on Windows.See theansible-vaultdocs for more info.
ansible-viptela
Failed to fetch description. HTTP Status Code: 404
ansible-virl
No description available on PyPI.
ansible-waldur-module
Ansible module for WaldurWaldur-based solutions can be managed with Ansible modules to allow provisioning and management of infrastructure under Waldur through Ansible playbooks.Supported functionalityOpenStack management.SLURM HPC managementCommon client for Waldur APIs in Python.See also:http://docs.ansible.com/ansible/modules.htmlInstallationpipinstallansible-waldur-moduleExample usageConfigure an Ansible playbook with parametersname:Trigger master instancewaldur_marketplace_os_instance:access_token:"{{access_token}}"api_url:"{{api_url}}"flavor:m1.microfloating_ip:autoimage:CentOS 7 x86_64name:"{{instance_name}}"project:"OpenStackProject"offering:Instance in Tenantssh_key:ssh1.pubsubnet:vpc-1-tm-sub-net-2system_volume_size:40wait:falsePass parameters to an Ansible playbookANSIBLE_LIBRARY=/usr/share/ansible-waldur/ansible\-mwaldur_marketplace_os_instance\-a"api_url=https://waldur.example.com/api/ access_token=9036194e1ac54cada3248a8c6b203bf7 name=instance-name project='Project name'"\localhostRunning playbook using virtual Python environmentIf you've installed Ansible Waldur module to virtual Python environment you need to specify path to Python interpreter and path to module library along with path to playbook:ansible-playbook\-eansible_python_interpreter=/home/user/ansible-env/bin/python\-M/home/user/ansible-env/lib/python3.8/site-packages/\playbook.ymlContributingSee general guidelines:https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_general.htmlInstallpre-commitandtoxpipinstalltoxpre-commit pre-commitinstallWhen new module is implemented, don't forget to updatepy_modulessection insetup.pyfile.When new module is implemented, it should be covered with tests. Run tests usingtoxtoxModule name should consist of three parts separated by underscore:waldur, plugin name, entity name. For example,waldur_os_snapshotrefers to OpenStack (OS) as plugin name and snapshot as entity name.
ansible-windows-compat
Ansible Windows CompatInitial work on a compatibility library to allow Ansible modules written in Python to run on a Windows target. Only planned to support Ansible v2, and so far only ping works.
ansible-workspace
ansible-workspaceCreate a workspace for multiple tools to easier develop ansible playbooks with roles.Roles with a reference to a git repository will be cloned, checked out and added to the workspace.The.gitignorewill be configured to ignore the role repositories or symlinks.Installpipinstall-Uansible-workspaceor withpipxpipxinstallansible-workspaceWorkspacesansible-workspace--helpGeneralSymlinksIf you want your roles in e.g.~/ansible-rolesbut want to symlink them to./rolesuse the following command:ansible-workspace<tool>--roles-path~/ansible-roles--symlink-pathroles/VSCodeThe workspace consists of:A folder for the playbook directoryA folder for each role defined in the requirementsansible-workspacevscodecode~/workspaces/example-project.code-workspacetmuxpThe workspace consists of:A window for the playbook directoryA window to exectute ansible commandsA window for each role defined in the requirementsansible-workspacetmuxptmuxpload-y~/workspaces/example-project.tmuxp-workspace.ymlExamplesThe following roles are defined underroles/requirements.yml:---roles:-name:role1version:v1.0.3src:[email protected]:rwxd/ansible-role-subuid_subgid.gitscm:git-name:role2version:v1.0.2src:[email protected]:rwxd/ansible-role-subuid_subgid.gitscm:git-name:role3version:mastersrc:[email protected]:rwxd/ansible-role-subuid_subgid.gitscm:gitโฏansible-workspacevscode Cloning"[email protected]:rwxd/ansible-role-subuid_subgid.git"to"/tmp/test_repo/roles/role1"Checkingout"v1.0.3"on"[email protected]:rwxd/ansible-role-subuid_subgid.git"Cloning"[email protected]:rwxd/ansible-role-subuid_subgid.git"to"/tmp/test_repo/roles/role2"Checkingout"v1.0.2"on"[email protected]:rwxd/ansible-role-subuid_subgid.git"Cloning"[email protected]:rwxd/ansible-role-subuid_subgid.git"to"/tmp/test_repo/roles/role3"Adding"roles/role1"to.gitignore Adding"roles/role2"to.gitignore Adding"roles/role3"to.gitignore Createdworkspaceconfigat"/home/<name>/workspaces/test_repo.code-workspace"The workspace can now be opened withcode ~/workspaces/test_repo.code-workspace.
ansibly
#Ansibly Welcome to Ansibly
ansibug
AnsibugThe core component of the Ansible Debug Adapter Protocol used for debugging Ansible playbooks. See more documentation foransibugathttps://jborean93.github.io/ansibug/.Please note this library should be considered a preview. New features and behaviour changes should be expected during this preview period.Debug AdapterThis library combined with aDebug Adapter Protocolclient, like Visual Studio Code, can be used to run and debug Ansible playbook's interactively. It supports basic features like stepping in, over, and out of tasks in a play with support for getting and setting variables at runtime.More information about the debug adapter and debugging experience of Ansible can be found underthe docs.RequirementsThe following Python requirements must be met before using this library:Python 3.9+ (dependent onansible-coresupport)ansible-core >= 2.14.0The debugger aims to continue to support the currentansible-coreversions that have no reached End Of Life. See theansible-core support matrixto see the current versions and the control node python versions for those versions. There are no guarantees that all features will be supported across Ansible versions, new features might be reliant on changes only present in newer Ansible versions. Any such features will be explicitly called out in the documentation.InstallationThis library has been published on PyPI and can be installed with:python-mpipinstallansibugTo test out the changes locally run the following:gitclonehttps://github.com/jborean93/ansibug.git python-mpipinstall-e.[dev]pre-commitinstallThis will install the current code in editable mode and also include some development libraries needed for testing or other development features.TestingThis library usestoxto run the sanity and integration tests. Once the dev extras for this library has been installed, all the tests can be run by running thetoxcommand.As the support matrix for this library can take some time to run it might be beneficial to run only certain tests. The following factors are available in toxsanitypy3{9,10,11,12}ansible_{2.14,2.15,2.16,devel}Here are some example factors that can be invoked with tox:# Run only the sanity teststoxrun-fsanity# Run Ansible 2.16 on all its supported Python versionstoxrun-fansible_2.16# Run Python 3.12 on all the supported Ansible versionstoxrun-fpy312# Run Ansible 2.16 tests on Python 3.12toxrun-fpy312ansible_2.16
ansibull
No description available on PyPI.
ansi-capture
No description available on PyPI.
ansicode
Provides nicer support for generating ANSI codes from Python scripts.
ansicolor
No description available on PyPI.
ansicolors
ANSI colors for PythonAdd ANSI colors and decorations to your strings.Example Usagefrom __future__ import print_function # accomodate Python 2 from colors import * print(color('my string', fg='blue')) print(color('some text', fg='red', bg='yellow', style='underline'))The strings returned bycolorwill have embeddedANSI code sequencesstipulating text colors and styles. For example, the above code will print the strings:'\x1b[34mmy string\x1b[0m' '\x1b[31;43;4msome text\x1b[0m'You can choose the foreground (text) color with thefgparameter, the background color withbg, and the style withstyle.You can choose one of the 8 basic ANSI colors:black,red,green,yellow,blue,magenta,cyan, andwhite, plus a specialdefaultwhich is display-specific, but usually a rational โ€œno special colorโ€ setting.There are other ways to specify colors. Many devices support an idiosyncratic 256-color scheme developed as an extension to the original ANSI codes for thexterm terminal emulator. Colors (or grays) from this larger palette can be specified viaintvalue (0-255).To see them all:from __future__ import print_function from colors import color for i in range(256): print(color('Color #%d' % i, fg=i))The includedshow_colors.pyprogram is a much-expanded version of this idea that can be used to explore available color and style combinations on your terminal or output device.24-bit Color and CSS CompatibilityModern terminals go even further than thexterm256, often supporting a full 24-bit RGB color scheme. You can provide a full RGB value several ways:with a 3-elementtupleorlistofint, each valued 0 to 255 (e.g.(255, 218, 185)),a string containing a CSS-compatible color name (e.g.'peachpuff'),a string containing a CSS-style hex value (e.g.'#aaa'or'#8a2be2')a string containing a CSS-style RGB notation (e.g.'rgb(102,51,153)')These forms can be mixed and matched at will:print(color('orange on gray', 'orange', 'gray')) print(color('nice color', 'white', '#8a2be2'))Note that any color name defined in the basic ANSI color set takes primacy over the CSS color names. Combined with the fact that terminals do not always agree which precise tone of blue should qualify as ANSIblue, there can be some ambiguity regarding the named colors. If you need full precision, specify the RGB color exactly. Theparse_rgbfunction can be used to identify the correct definition according to the CSS standards.CaveatsUnfortunately there is no guarantee that every terminal will support all the colors and styles ANSI ostensibly defines. In fact, most implement a rather small subset. Colors are better supported than styles, for which youmightget one or two of the most popular such asboldorunderline.Might.Whatever colors and styles are supported, there is no guarantee they will be accurately rendered. Even at this late date, overfifty yearsafter the codes began to be standardized, support from terminals and output devices is limited, fragemented, and piecemeal.ANSI codes evolved in an entirely different historical context from todayโ€™s. Both the Web and the idea of broad standardization were decades in the future. Display technology was low-resolution, colors were limited on the rare occasions they were present, and color/style fidelity was not a major consideration. Vendors thought little or nothing of creating their own proprietary codes, implementing functions differently from other vendors, and/or co-opting codes previously in use for something else. Practical ANSI reference materials includemanyphrases such as โ€˜hardly ever supportedโ€™ and โ€˜non-standard.โ€™We still use ANSI codes today not because theyโ€™re especially good, but because theyโ€™re the best, most-standard approach that pre-Web displays even remotely agreed upon. Even deep into the Web era, text output endures as an important means of human-computer interaction. The good news, such is it is: ANSIโ€™s color and style specifications (โ€œSGRโ€ or โ€œSelect Graphic Renditionโ€ in ANSI terminology) are the most-used and best-adhered-to portion of the whole ANSI show.More Examples# use some partial functions from __future__ import print_function # so works on Python 2 and 3 alike from colors import red, green, blue print(red('This is red')) print(green('This is green')) print(blue('This is blue'))Optionally you can add a background color and/or styles.:print(red('red on blue', bg='blue')) print(green('green on black', bg='black', style='underline'))You can use multiple styles at once. Separate them with a+.:print(red('very important', style='bold+underline'))You can additionally specify one of the supported styles:none,bold,faint,italic,underline,blink,blink2,negative,concealed,crossed. While most devices support only a few styles, unsupported styles are generally ignored, so the only harm done is your text is less pretty and/or formatted than you might like. A good general rule is to enjoy the formatting if you get it, but donโ€™t depend on itโ€“especially donโ€™t depend on styles likeblink(e.g. to highlight critical data) orconcealed(e.g. to hide data). Most likely, they wonโ€™t.If you use a style often, you may want to create your own named style:from functools import partial from colors import color important = partial(color, fg='red', style='bold+underline')) print(important('this is very important!'))Utility FunctionsIn deailing with ANSI-styled text, it can be necessary to determine the โ€œequivalentโ€ text minus the styling. The functionstrip_color(s)does that, removing ANSI codes froms, returning its โ€œplain text equivalent.โ€You may also wish to determine the effective length of a string. If it contains ANSI codes, the builtinlen()function will return the length including those codes, even though they are logically 0-length. So plainlen(s)is probably not what you need.ansilen(s)in contrast returns the โ€œeffectiveโ€ length of the string, including only the non-ANSI characters.ansilen(s)is equivalent tolen(strip_color(s)),Licensecolorsis licensed under theISC license.
ansicolortags
Theansicolortagsmodule provides efficient and useful functions to use colours in a terminal application with Python 2 and 3, with aHTML-taglike style :<red>text<white>will printtextin red.All ANSI colors code are defined with this tag-like style.This point is the main interest of this module,because all others modules define function to print with some colours.The complete documentation can be found here :http://ansicolortags.readthedocs.io/!ColoursForegroundsYou can choose one of the 8 basic ANSI colours: black, red, green, yellow, blue, magenta, cyan, white. The names beginning with alower-scriptdesignforegroundcolours.For example:from ansicolortags import printc printc('<reset>This is default. <red>This is red<yellow> and yellow in foreground now<reset>').BackgroundsYou can choose one of the 8 basic ANSI colours: Black, Red, Green, Yellow, Blue, Magenta, Cyan, White. The names beginning with anupper-scriptdesignbackgroundcolors.For example:from ansicolortags import printc printc('<Default>this is default. <Blue>this have a blue background<Black> and black in background now<reset>').Other tagsThe following tags are also available:b,B: to turn on and off theboldmode,u,U: to turn on and off theunderlinemode,neg,Neg: to turn on and off thereverse videomode,blink,Blink: to turn on and off theblinkmode,el: to erase the current line,bell: to make the terminal ring.ShortcutsSome macros are also provided, like the tags<ERROR>,<INFO>or<WARNING>.And also<warning>and<question>, which respectively give a colored!and?.Theresettag is a special tag to reinitialize all previously changed parameters.Writing to a file ?This is possible with thewritecfunction. For example:import sys from ansicolortags import writec writec('<ERROR><u><red>The computer is going to explode!<reset>', fn=sys.stderr) # sys.stderr.flush() # this is useless : writec flush itself.Auto detectionOf course, the colors are disabled if the output does not support them.It works perfectly on any GNU/Linux (tested with Ubuntu 10+, Debian, Arch Linux) and Windows (with or without Cygwin), and should work fine one MAC OS X or on other UNIX-like.Other featuresOther functionsThere is also thextitle()function, to change the title of the terminal. This try to use the command-line toolxtitle, and if it fails it tries to use anANSI codeto change the title.There is also anotify()function to display a system notification (using the command-line toolnotify-send).Scriptansicolortags.pyis also a script. You can have his description (or use it) directly with:python -m ansicolortags --helpFor testingansicolortags.pycan be used to run some tests (with the--testoption).With GNU/Bashansicolortags.pycan be used to generate a GNU/Bash color profile (with the--generate--filecolor.shoptions).See here for this color.sh fileThisshfile can be imported with$ . color.shin any GNU/Bash scripts, or even in your~/.bashrcfile.License ?This module is licensed under the term of theMIT License, see the fileLICENSEfor more details.
ansi-colours
No description available on PyPI.
ansicon
Overviewansicon is a Python wrapper for loadingJason Hoodโ€™sANSICONInstallation$pipinstallansiconUsageimportansicon# Load ansiconansicon.load()# Have fun with terminal codesprint(u'\x1b[32mGreen\x1b[m')# Unload ansiconansicon.unload()# Check if ansicon is loadedifnotansicon.loaded():ansicon.load()ifansicon.loaded():ansicon.unload()
ansiconv
See documentation athttp://pythonhosted.org/ansiconv/
ansiconverter
๐ŸŒ€ ANSI ConverterConvert any colour to theANSI formatto write in colours in your terminal.โŒจ๏ธ InstallationRun this command to installansiconverter:python-mpipinstall-UansiconverterTo install fordevelopment:gitclonehttps://github.com/thomassamoth/ansiconverter.gitcdansiconverter pipinstall-e.[dev]TestsTo ensure the installation of this package has been successful, you can run thetests.Make sure you have installed thepytestmodule. Otherwise, run:pipinstallpytestAfter you downloaded the code and installed the package, run the tests by executing:python-mpytesttest/๐Ÿ’ป UsageConverter moduleโš ๏ธWarningSome colour combinations between background and foreground are incompatible. The result can be slightly different from what is expected.Convert fromRGBcolour toANSI# How to print a green text on a white backgroundfromansiconverterimportRGBtoANSIprint(RGBtoANSI(text='Green text on a white background',foregound=[0,255,0],background=[255,255,255]))Result:Result:Convert fromhexadecimaltoANSI# How to print a yellow text on a navy blue background, with hexadecimal values.fromansiconverterimportHEXtoANSIprint(HEXtoANSI('Some yellow text on blue background','#fdf31f','000080'))Result:Result:โ„น๏ธNoteAnother little tool has been added to convert RGB to hexadecimal and vice versa. It can't be used to write in color in the terminal but could be useful for other applications.Convert fromhexadecimaltoRGBfromansiconverterimportHEXtoRGBprint(HEXtoRGB("#0b38c1"))Result:[11,59,193]Convert fromRGBtohexadecimalfromansiconverterimportRGBtoHEXprint(RGBtoHEX([11,59,193]))Result:"#0b3bc1"๐ŸŽจ Styles moduleSeveral text styles are available as well. You can evencombine them with coloursStyleMethodboldbolditalicitalicfaintedfaintunderlinedunderlinebold & underlinedbold_and_underlinestrikethroughedstrikethroughreversed(colours inverted)reversefromansiconverterimportboldprint(bold("Some text in bold"))Replace.boldin the example with any method above to get the desired style.Combination of colours and stylesโš—๏ธ It is possible to combine text styles with colours by doing so:fromansiconverterimportHEXtoANSI,boldprint(bold(HEXtoANSI('A yellow text in bold','#f6cf6c')))Result:N.B: the order between the style and the text format isn't important and you can switch them.print(bold(HEXtoANSI('A yellow text in bold','#f6cf6c')))will work the same asprint(HEXtoANSI(bold('A yellow text in bold'),'#f6cf6c'))NoteThis structure of this repository is based on a talk byMark Smith, which is availablehere, and itslinked repositoryLicenseThis repository is licensed under the MIT license. See theLICENSEfile for more information.
ansictrls
AnsiCtrlsLibrary for working with ANSI Escape Sequences in a terminal.For more information see thedocumentation.History2019-06-25 (0.3.0)Add function clear()2019-05-12 (0.2.0)HTML-style colors can now use the short form, i. e. #F00 instead of #FF00002019-01-11 (0.1.1)Bugfix: sgr_print() was broken2018-12-14 (0.1.0)First public release
ansideps
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.Description: ========ansideps========.. image:: https://badge.fury.io/py/ansideps.png:target: http://badge.fury.io/py/ansideps.. image:: https://travis-ci.org/dhutty/ansideps.png?branch=master:target: https://travis-ci.org/dhutty/ansideps.. image:: https://pypip.in/d/ansideps/badge.png:target: https://crate.io/packages/ansideps?version=latestResolve Ansible role relationships.* use `--help` for usage instructions.Features--------* takes one or more role names, creates a graph of the relationships between the roles in the Ansible roles_path and returns the dependencies (ancestor or descendant)* can also write dot (graphviz) files with the entire graph.Requirements------------- Python >= 2.6 or >= 3.3License-------MIT licensed. See the bundled `LICENSE <https://github.com/dhutty/ansideps/blob/master/LICENSE>`_ file.Keywords: ansible dependencyPlatform: UNKNOWNClassifier: Development Status :: 2 - Pre-AlphaClassifier: Intended Audience :: DevelopersClassifier: License :: OSI Approved :: MIT LicenseClassifier: Natural Language :: EnglishClassifier: Programming Language :: Python :: 2Classifier: Programming Language :: Python :: 2.7Classifier: Programming Language :: Python :: 3Classifier: Programming Language :: Python :: 3.4Classifier: Programming Language :: Python :: Implementation :: CPythonClassifier: Programming Language :: Python :: Implementation :: PyPy
ansidoc
Ansidoc=======A simple tool to generate ansible role's documentation.Usage-----This tool generates a ``README.md`` file using data from multiple sources.* From role content:* role ``defaults/main.yml``* role ``vars/*.yml``* You content.* role ``docs/*.yml``* role ``docs/*.md``Content of your role ``vars/*`` and ``defaults/*`` will also be literally insertedin between ``yaml`` codeblocks. Put nice comments//explanations of variable'spurpose in them!The role ``docs`` directory may contain YAML files that will be parsed. Variableswithin will be use to enrich the resulting ``README.md`` file. All markdown fileswill also be include. Top header must be of level H2. Currently there are nomechanism to defined the inclusion order.Prepare your role^^^^^^^^^^^^^^^^^For best results, create a ``docs/<you-var-file>.yml`` file inside your role and fill thosevariables:.. code-block:: yaml---github_account: <your-role-github-account-username>todos: [] # (optional) list of todos to print in your README filecli^^^.. code-block:: shellusage: ansidoc [-h] [-v] [-V] [-d] [-s TARGET] [-nf] [-e EXCLUDE] [-p] dirpathpositional arguments:dirpath Either a 'roles_path' wich is a roles' directory or apath to a single role. If 'roles_path' basename is'roles' it will loop over subdirectories assuming eachof them contains a role.optional arguments:-h, --help show this help message and exit-v, --verbose increase output verbosity-V, --version show program's version number and exit-d, --dry-run dry run, Outputs pure markdown to stdout nothing iswritten to disk-s TARGET (docs | README.md) Create a symlink in PWD to TARGET.This is useful when used from sphinx as you cannot addrelative entries such as '../*' in the toctree. Ifunspecified, no symlink is created.-nf, --no-ansidoc-footerDo not render the ansidoc project footer.-e EXCLUDE, --exclude EXCLUDEcsv list of role names to exclude. Must matchdirectory name found under specified 'dirpath'-p, --private Consider role(s) private, e.g.: Skip installation fromgithub part from rendered template.>From sphinx^^^^^^^^^^^You can import in your code and pass arguments similarly as you would do on thecli.For example:.. code-block:: pythonfrom ansidoc import Ansidocansidoc = Ansidoc(dirpath=<path/to/role>, dry_run=True)ansidoc.run()wishlist--------* role dependency grapher* role variables analysis (to audit what is defined where)* create sphinx documentation for this program* make this a sphinx plugin* include mardown files in defined order (alphabetical?, number the files?)* override parts of template with custom one.* search paths to find templates (\ ``.ansidoc/templates/*``\ ?)* multi-role variables* search paths to find config (\ ``.ansidoc/config.yml``\ ?)* exclude list configurable in config fileLicense-------MIT.Similar Projects----------------* `Ansible-DocGen <https://github.com/toast38coza/Ansible-DocGen>`_
ansidocs
ansidocsAnsidocs is a command line tool designed to help collate and generate documentation for your Ansible project.See theexample_projectsfolder in this repo for examples of the READMEs generated by this tool.UsageAfter installing the pip package, a command line utility should be available in your virtual environment.To see available options and the help message, simply run:ansidocs# oransidocs-hTo generate documentation for a project in directory/my/project:ansidocsgen-d'/my/project'ConfigurationAnsidocs comes with support for the common Ansible project layouts: roles and collections. You can modify how these projects are processedor create your own project layout by modifying the configuration files.By default, config files are located in your user directory at~/.ansidocs. Files are placed here once the program is run, or by runningthe config generation command:ansidocsconfigYou can forcefully remove this directory and recreate it by using the refresh flag:ansidocsconfig-rCustomizing Project Layouts and READMEsIts possbile to customize or create your own project layout, as well as modify the existing templates used for README generation.Project LayoutsA project layout is a configuration entry that describes where different pieces of your project exist relative to the root directory.Although the types of project parts are limitted to what the program supports, you can add, remove, or move the project parts.To do this, modify the existing configuration file (by default at~/.ansidocs/ansidocs.yml). In that file, there is a dictionarycalledproject_layouts.Note:The meta file attribute is used to link a project layout to your project. So, no layouts should have the same meta filevalue, and the meta file must exist in your project for the program to recognize its layout.An example of the project layout struct can be found in your configuration file.Customizing README TemplatesEach project layout has the option to define a custom README template and add, remove, or reformat data. The templates are found in yourconfiguration directory, (by default at~/.ansidocs/templates). If the program finds a folder with the same name as your layout, it willlook in that directory for templates before falling back to thedefaultsdirectory.When a project's README is rendered, it occurs in 4 stages:render description.md.j2render usage.md.j2render footer.md.j2Compile those renderings as variables, and use them to render README.md.j2Special Documentation FilesIf your project layout defines adocsattribute and that directory exists, ansidocs will look in that directory for certain files and include them in the README generation.Some supported documents include:usage.md- This file will be injected at the top of theUsagesection in your README.md. The file should be pure markdown, there will be no templating or substitution done on this file.description.md- This file will be injected at the top of theDescriptionsection in your README.md. The file should be pure markdown, there will be no templating or substitution done on this file.defaults.yml- This file should contain descriptions for defaults defined in your project, if any. This file is YAML and should match the keys in yourdefaults/main.ymlor corresponding defaults file. Values should be strings that are used as descriptions when compiling the defaults markdown table
ansie
No description available on PyPI.
ansi-escape-room
This is a fork ofColoredAboutVery simple Python library for color and formatting in terminal. Collection of color codes and names for 256 color terminal setups. The following is a list of 256 colors for Xterm, containing an example of the displayed color, Xterm Name, Xterm Number and HEX.Video DemoThe following colors works with most terminals and terminals emulators. ANSI/VT100 escape sequences can be used in every programming languages.Attributes:+-----+------------------+|Code|Description|+-----+------------------+|1|bold||2|dim||3|italic||4|underlined||5|blink||7|reverse||8|hidden||0|reset||21|res_bold||22|res_dim||23|res_italic||24|res_underlined||25|res_blink||27|res_reverse||28|res_hidden|+------------------------+256 Foreground and Background Colors - Full Chart:+-----+---------------------+|Code|Description|+-----+---------------------+|0|black||1|red||2|green||3|yellow||4|blue||5|magenta||6|cyan||7|light_gray||8|dark_gray||9|light_red||10|light_green||11|light_yellow||12|light_blue||13|light_magenta||14|light_cyan||15|white||16|grey_0||17|navy_blue||18|dark_blue||19|blue_3a||20|blue_3b||21|blue_1||22|dark_green||23|deep_sky_blue_4a||24|deep_sky_blue_4b||25|deep_sky_blue_4c||26|dodger_blue_3||27|dodger_blue_2||28|green_4||29|spring_green_4||30|turquoise_4||31|deep_sky_blue_3a||32|deep_sky_blue_3b||33|dodger_blue_1||34|green_3a||35|spring_green_3a||36|dark_cyan||37|light_sea_green||38|deep_sky_blue_2||39|deep_sky_blue_1||40|green_3b||41|spring_green_3b||42|spring_green_2a||43|cyan_3||44|dark_turquoise||45|turquoise_2||46|green_1||47|spring_green_2b||48|spring_green_1||49|medium_spring_green||50|cyan_2||51|cyan_1||52|dark_red_1||53|deep_pink_4a||54|purple_4a||55|purple_4b||56|purple_3||57|blue_violet||58|orange_4a||59|grey_37||60|medium_purple_4||61|slate_blue_3a||62|slate_blue_3b||63|royal_blue_1||64|chartreuse_4||65|dark_sea_green_4a||66|pale_turquoise_4||67|steel_blue||68|steel_blue_3||69|cornflower_blue||70|chartreuse_3a||71|dark_sea_green_4b||72|cadet_blue_2||73|cadet_blue_1||74|sky_blue_3||75|steel_blue_1a||76|chartreuse_3b||77|pale_green_3a||78|sea_green_3||79|aquamarine_3||80|medium_turquoise||81|steel_blue_1b||82|chartreuse_2a||83|sea_green_2||84|sea_green_1a||85|sea_green_1b||86|aquamarine_1a||87|dark_slate_gray_2||88|dark_red_2||89|deep_pink_4b||90|dark_magenta_1||91|dark_magenta_2||92|dark_violet_1a||93|purple_1a||94|orange_4b||95|light_pink_4||96|plum_4||97|medium_purple_3a||98|medium_purple_3b||99|slate_blue_1||100|yellow_4a||101|wheat_4||102|grey_53||103|light_slate_grey||104|medium_purple||105|light_slate_blue||106|yellow_4b||107|dark_olive_green_3a||108|dark_green_sea||109|light_sky_blue_3a||110|light_sky_blue_3b||111|sky_blue_2||112|chartreuse_2b||113|dark_olive_green_3b||114|pale_green_3b||115|dark_sea_green_3a||116|dark_slate_gray_3||117|sky_blue_1||118|chartreuse_1||119|light_green_2||120|light_green_3||121|pale_green_1a||122|aquamarine_1b||123|dark_slate_gray_1||124|red_3a||125|deep_pink_4c||126|medium_violet_red||127|magenta_3a||128|dark_violet_1b||129|purple_1b||130|dark_orange_3a||131|indian_red_1a||132|hot_pink_3a||133|medium_orchid_3||134|medium_orchid||135|medium_purple_2a||136|dark_goldenrod||137|light_salmon_3a||138|rosy_brown||139|grey_63||140|medium_purple_2b||141|medium_purple_1||142|gold_3a||143|dark_khaki||144|navajo_white_3||145|grey_69||146|light_steel_blue_3||147|light_steel_blue||148|yellow_3a||149|dark_olive_green_3||150|dark_sea_green_3b||151|dark_sea_green_2||152|light_cyan_3||153|light_sky_blue_1||154|green_yellow||155|dark_olive_green_2||156|pale_green_1b||157|dark_sea_green_5b||158|dark_sea_green_5a||159|pale_turquoise_1||160|red_3b||161|deep_pink_3a||162|deep_pink_3b||163|magenta_3b||164|magenta_3c||165|magenta_2a||166|dark_orange_3b||167|indian_red_1b||168|hot_pink_3b||169|hot_pink_2||170|orchid||171|medium_orchid_1a||172|orange_3||173|light_salmon_3b||174|light_pink_3||175|pink_3||176|plum_3||177|violet||178|gold_3b||179|light_goldenrod_3||180|tan||181|misty_rose_3||182|thistle_3||183|plum_2||184|yellow_3b||185|khaki_3||186|light_goldenrod_2a||187|light_yellow_3||188|grey_84||189|light_steel_blue_1||190|yellow_2||191|dark_olive_green_1a||192|dark_olive_green_1b||193|dark_sea_green_1||194|honeydew_2||195|light_cyan_1||196|red_1||197|deep_pink_2||198|deep_pink_1a||199|deep_pink_1b||200|magenta_2b||201|magenta_1||202|orange_red_1||203|indian_red_1c||204|indian_red_1d||205|hot_pink_1a||206|hot_pink_1b||207|medium_orchid_1b||208|dark_orange||209|salmon_1||210|light_coral||211|pale_violet_red_1||212|orchid_2||213|orchid_1||214|orange_1||215|sandy_brown||216|light_salmon_1||217|light_pink_1||218|pink_1||219|plum_1||220|gold_1||221|light_goldenrod_2b||222|light_goldenrod_2c||223|navajo_white_1||224|misty_rose1||225|thistle_1||226|yellow_1||227|light_goldenrod_1||228|khaki_1||229|wheat_1||230|cornsilk_1||231|grey_100||232|grey_3||233|grey_7||234|grey_11||235|grey_15||236|grey_19||237|grey_23||238|grey_27||239|grey_30||240|grey_35||241|grey_39||242|grey_42||243|grey_46||244|grey_50||245|grey_54||246|grey_58||247|grey_62||248|grey_66||249|grey_70||250|grey_74||251|grey_78||252|grey_82||253|grey_85||254|grey_89||255|grey_93||256|default|+-----+---------------------+256 Colors Foreground (text):256 Colors Background:Installation$pipinstallansi-escape-room--upgrade# Uninstall:$pipuninstallansi-escape-roomDependenciesNone, only Python programming language.Usage ExamplesHow to use the module in your own python code:>>>fromcoloredimportfg,bg,attr>>>>>>print('%s Hello World !!! %s'%(fg(1),attr(0)))HelloWorld!!!>>>>>>print('%s%s Hello World !!! %s'%(fg(1),bg(15),attr(0)))HelloWorld!!!Use description:>>>print('%s%s Hello World !!! %s'%(fg('white'),bg('yellow'),attr('reset')))HelloWorld!!!>>>>>>print('%s%s Hello World !!! %s'%(fg('orchid'),attr('bold'),attr('reset')))HelloWorld!!!>>>>>>color=bg('indian_red_1a')+fg('white')>>>reset=attr('reset')>>>print(color+'Hello World !!!'+reset)HelloWorld!!!Or use HEX code:>>>color=fg('#C0C0C0')+bg('#00005f')>>>res=attr('reset')>>>print(color+"Hello World !!!"+res)HelloWorld!!!Or the convenientstylize(text, *styles)wrapper to save some keystrokes:>>>importcolored>>>fromcoloredimportstylize>>>print(stylize("This is green.",colored.fg("green")))Thisisgreen.>>>print("This is not.")Thisisnot.>>>angry=colored.fg("red")+colored.attr("bold")>>>print(stylize("This is angry text.",angry))Thisisangrytext.>>>print(stylize("This is VERY angry text.",angry,colored.attr("underlined")))ThisisVERYangrytext.>>>print("But this is not.")Butthisisnot.Or the variantstylize_interactive(text, *styles)for readline-friendliness:>>>importcolored,sys>>>fromcoloredimportstylize_interactive,fg>>>sys.ps1=stylize_interactive("myPrompt: ",fg('red'))myPrompt:Use directly likecoloramabut with more colors:>>>fromcoloredimportfore,back,style>>>>>>print(fore.LIGHT_BLUE+back.RED+style.BOLD+"Hello World !!!"+style.RESET)Import colored module:>>>importcolored>>>>>>colored.fg(1)'\x1b[38;5;1m'>>>>>>colored.fg(257)Traceback(mostrecentcalllast):File"<input>",line1,in<module>File"/usr/lib64/python2.7/site-packages/colored/colored.py",line381,infgreturncolored(color).foreground()File"/usr/lib64/python2.7/site-packages/colored/colored.py",line350,inforegroundcolor=self.reserve_paint[str(self.color)]KeyError:'257'>>>>>>colored.bg(30)'\x1b[48;5;30m'>>>>>>colored.fore.BLUE'\x1b[38;5;4m'etc.Screenshot:
ansiescapes
ANSI escape codesfor manipulating the terminal - A Python port ofsindresorhusโ€™sansi-escapesNode.js module.Installation$pipinstallansiescapesUsageimportansiescapesimportsys# Moves the cursor two rows up and to the leftsys.stdout.write(ansiescapes.cursorUp(2)+ansiescapes.cursorLeft)#=> '\u001B[2A\u001B[1000D'APIcursorTo(x, [y])Set the absolute position of the cursor.x0y0is the top left of the screen.cursorMove(x, [y])Set the position of the cursor relative to its current position.cursorUp(count)Move cursor up a specific amount of rows. Default is1.cursorDown(count)Move cursor down a specific amount of rows. Default is1.cursorForward(count)Move cursor forward a specific amount of rows. Default is1.cursorBackward(count)Move cursor backward a specific amount of rows. Default is1.cursorLeftMove cursor to the left side.cursorSavePositionSave cursor position.cursorRestorePositionRestore saved cursor position.cursorGetPositionGet cursor position.cursorNextLineMove cursor to the next line.cursorPrevLineMove cursor to the previous line.cursorHideHide cursor.cursorShowShow cursor.eraseLines(count)Erase from the current cursor position up the specified amount of rows.eraseEndLineErase from the current cursor position to the end of the current line.eraseStartLineErase from the current cursor position to the start of the current line.eraseLineErase the entire current line.eraseDownErase the screen from the current line down to the bottom of the screen.eraseUpErase the screen from the current line up to the top of the screen.eraseScreenErase the screen and move the cursor the top left position.scrollUpScroll display up one line.scrollDownScroll display down one line.clearScreenClear the terminal screen.beepOutput a beeping sound.image(input, [options])Display an image.Currently only supported on iTerm2 >=3Seetermimgfor a higher-level module.inputType:BufferBuffer of an image. Usually read in withopen.Example:importansiescapesimportsysfromcodecsimportopenwithopen('image.png','rb')asimageFile:f=imageFile.read()b=bytearray(f)sys.stdout.write(ansiescapes.image(b))optionswidthheightType:stringnumberThe width and height are given as a number followed by a unit, or the word โ€œautoโ€.N: N character cells.Npx: N pixels.N%: N percent of the sessionโ€™s width or height.auto: The imageโ€™s inherent size will be used to determine an appropriate dimension.preserveAspectRatioType:booleanDefault:truesetCwd([path])Type:stringDefault:os.getcwd()Inform iTerm2of the current directory to help semantic history and enableCmd-clicking relative paths.LicenseMIT. See theLICENSE filefor more info.
ansi-escapes
ansi-escapesANSI escape codesfor manipulating the terminalA port of the Node.js packageansi-escapesto Python.Installpython3 -m pip install -U ansi-escapesUsagefromansi_escapesimportansiEscapesimportsys# Moves the cursor two rows up and to the leftsys.stdout.write(ansiEscapes.cursorUp(2)+ansiEscapes.cursorLeft)#>>> '\u001B[2A\u001B[1000D'APIcursorTo(x, y?)Set the absolute position of the cursor.x0y0is the top left of the screen.cursorMove(x, y?)Set the position of the cursor relative to its current position.cursorUp(count)Move cursor up a specific amount of rows. Default is1.cursorDown(count)Move cursor down a specific amount of rows. Default is1.cursorForward(count)Move cursor forward a specific amount of columns. Default is1.cursorBackward(count)Move cursor backward a specific amount of columns. Default is1.cursorLeftMove cursor to the left side.cursorSavePositionSave cursor position.cursorRestorePositionRestore saved cursor position.cursorGetPositionGet cursor position.cursorNextLineMove cursor to the next line.cursorPrevLineMove cursor to the previous line.cursorHideHide cursor.cursorShowShow cursor.eraseLines(count)Erase from the current cursor position up the specified amount of rows.eraseEndLineErase from the current cursor position to the end of the current line.eraseStartLineErase from the current cursor position to the start of the current line.eraseLineErase the entire current line.eraseDownErase the screen from the current line down to the bottom of the screen.eraseUpErase the screen from the current line up to the top of the screen.eraseScreenErase the screen and move the cursor the top left position.scrollUpScroll display up one line.scrollDownScroll display down one line.clearScreenClear the terminal screen. (Viewport)clearTerminalClear the whole terminal, including scrollback buffer. (Not just the visible part of it)beepOutput a beeping sound.link(text, url)Create a clickable link.Supported terminals.Usesupports-hyperlinksto detect link support.image(filePath, options?)(Not yet implemented.)Display an image.Currently only supported on iTerm2 >=3Seeterm-imgfor a higher-level module.inputType:BufferBuffer of an image. Usually read in withfs.readFile().optionsType:objectwidthheightType:string | numberThe width and height are given as a number followed by a unit, or the word "auto".N: N character cells.Npx: N pixels.N%: N percent of the session's width or height.auto: The image's inherent size will be used to determine an appropriate dimension.preserveAspectRatioType:booleanDefault:trueiTerm.setCwd(path?)Type:stringDefault:process.cwd()Inform iTerm2of the current directory to help semantic history and enableCmd-clicking relative paths.iTerm.annotation(message, **options)Creates an escape code to display an "annotation" in iTerm2.An annotation looks like this when shown:See theiTerm Proprietary Escape Codes documentationfor more information.messageType:stringThe message to display within the annotation.The|character is disallowed and will be stripped.optionsType:objectlengthType:numberDefault: The remainder of the lineNonzero number of columns to annotate.xType:numberDefault: Cursor positionStarting X coordinate.Must be used withyandlength.yType:numberDefault: Cursor positionStarting Y coordinate.Must be used withxandlength.isHiddenType:booleanDefault:falseCreate a "hidden" annotation.Annotations created this way can be shown using the "Show Annotations" iTerm command.Relatedansi-styles- ANSI escape codes for styling strings in the terminalLicenseMITContactA library byShawn Presser. If you found it useful, please considerjoining my patreon!My Twitter DMs are always open; you shouldsend me one! It's the best way to reach me, and I'm always happy to hear from you.Twitter:@theshawwnPatreon:https://www.patreon.com/shawwnHN:sillysaurusxWebsite:shawwn.com
ansi-escape-sequences
Ansi"ansi-escape-sequences" is a Simple tool to use ansi escape sequencesInstallationUse the package managerpipto installansi-escape-sequences.pipinstallansi-escape-sequencesLicenseMIT
ansifmt
AnsiFmtANSI escape sequences to format strings that are printed to terminal.UsageimportAnsiFmtasfmtstring="Hello, world"# Print the string with underlineprint(fmt.underline(string))# Set it to have red backgroundprint(fmt.bg(string,1))# Color can be either an integer, a hex color string or a tuple of (red, green, blue)print(fmt.fg(string,'#3cde2f'))# Formats can be nested since each function returns a formatted stringprint(fmt.bg(fmt.fg(fmt.bold(string),4),15))Functionsbg(str, color)fg(str, color)blink(str)bold(str)dim(str)double_underline(str)hide(str)invert(str)italic(str)overline(str)strike(str)underline(str)colorcan either be an integer of ANSI color codes, a hex color string, or a tuple of (red, green, blue) values.
ansiformat
ANSI FormatWARNING: This library is under not so active development. Nothing works just yet and might not be working for the next X years.ANSI format is a library that helps to pretty format text with ANSI escapes on CLI. This includes tables, sections, man pages, progress bars and almost anything that is structured and should look pretty.
ansify
ansifyAwesomeansifyis a Python CLI to create ANSI/ASCII art from images.ๅฅฝ็Žฉ็š„็ปˆ็ซฏๅ›พ็‰‡่‰บๆœฏๅทฅๅ…ทๅทฅๅ…ท็‰น็‚นไปปๆ„ๅ›พ็‰‡่ฝฌๆˆไปปๆ„ๅญ—็ฌฆๆ”ฏๆŒๅฝฉ่‰ฒ่พ“ๅ‡บไฝฟ็”จ่ฏดๆ˜Žๅฎ‰่ฃ…ๅทฅๅ…ท ansifypipinstall-UansifyLet's goๅŽŸๅ›พ้ป‘็™ฝansify--columns120--no-colorexamples/ycy.jpgๅฝฉ่‰ฒansify--columns120examples/ycy.jpgๅƒ็ด ansify--columns120--grayscalepixelexamples/ycy.jpg่‡ชๅฎšไน‰ๅญ—็ฌฆansify--columns120--diy-grayscale"ไฝ ๆˆ‘็ˆฑ่ถ…่ถŠ"examples/ycy.jpgๅ…ถไป–็คบไพ‹ansify--columns80--diy-grayscale" ่ฐๅ’ฌๆˆ‘่‹นๆžœ"examples/apple.pngansify--columns80--grayscaleemojiexamples/apple.pngansifyhttps://b-ssl.duitang.com/uploads/item/201712/06/20171206200408_txunr.thumb.700_0.jpegๅ‚ๆ•ฐ่ฏดๆ˜Ž$ansify--help Usage:ansify[OPTIONS]IMAGECLItocreateANSI/ASCIIartfromimages. Arguments:IMAGEImagefilePATHorURL.[required]Options:-c,--columnsINTEGEROutputcolumns,numberofcharactersperline.[default:252]-o,--outputPATHSaveANSI/ASCIIarttotheOUTPUTfile.-s,--scaleFLOATThelargerthescale,thethinnertheart.[default:0.43]-g,--grayscale[simple|morelevels|pixel|dragon|emoji]Chooseabuilt-ingrayscale.[default:simple]-d,--diy-grayscaleTEXTCustomizeyourgrayscale.-n,--no-colorOutputaANSI/ASCIIartwithoutcolor.[default:False]-r,--reverse-grayscaleReversethegrayscale.[default:False]-R,--reverse-colorReversethecolor.[default:False]-q,--quiteHideoutputinformation.[default:False]-v,--versionPrintstheversionoftheansifypackage.--helpShowthismessageandexit.ๅฟ…่ฆๅ‚ๆ•ฐ๏ผšIMAGE: ๆœฌๅœฐๅ›พ็‰‡ๆ–‡ไปถ่ทฏๅพ„๏ผŒๆˆ–่€…็ฝ‘็ปœๅ›พ็‰‡ URLๅฏ้€‰ๅ‚ๆ•ฐ๏ผš-c, --columns๏ผš่ฝฌๅŒ–ๅŽๅ›พ็‰‡็š„ๅˆ—ๆ•ฐ๏ผˆๆฑ‰ๅญ—ๅ ไธคไธชๅญ—็ฌฆ๏ผŒๅˆ—ๆ•ฐไผšๅ‡ๅŠ๏ผ‰๏ผŒ้ป˜่ฎคไธบ็ปˆ็ซฏ็š„ๅฎฝๅบฆ-o, --output๏ผšๆŒ‡ๅฎšๆ–‡ไปถๅๅฆ‚output.txtๅŽ๏ผŒๅฐ†่พ“ๅ‡บๅญ—็ฌฆไฟๅญ˜ๅˆฐๆ–‡ไปถ-s, --scale๏ผšๅ—็ปˆ็ซฏ้…็ฝฎ๏ผˆๅญ—้—ด่ทใ€่กŒ้ซ˜๏ผ‰ไธŽๅญ—็ฌฆ้•ฟๅฎฝๆฏ”็š„ๅฝฑๅ“๏ผŒ่พ“ๅ‡บๅ›พๅƒ็š„้•ฟๅฎฝๆฏ”ไธŽๅŽŸๅ›พๆœ‰ๅทฎๅˆซใ€‚ๅฟ…่ฆๆ—ถไฝฟ็”จๆญคๅ‚ๆ•ฐ่ฐƒๆ•ด้•ฟๅฎฝๆฏ”๏ผŒ่ฏฅๅ€ผ่ถŠๅคง๏ผŒๅ›พ็‰‡่ถŠ้ซ˜็˜ฆ-g, --grayscale๏ผš้ข„่ฎพ็š„ๅ‡ ็ง็ฐ้˜ถ้€’ๅขž๏ผˆๅญ—็ฌฆ่ถŠๆฅ่ถŠๅฏ†้›†๏ผ‰ๅญ—็ฌฆ๏ผŒ[simple|morelevels|pixel|dragon|emoji]-d, --diy-grayscale๏ผš่‡ชๅฎšไน‰็ฐ้˜ถๅญ—็ฌฆ๏ผŒๅฏไปฅๆ˜ฏๅ•ๅญ—็ฌฆ๏ผŒๅคšๅญ—็ฌฆๆœ€ๅฅฝ็ฐ้˜ถ้€’ๅขžๆˆ–้€’ๅ‡-n, --no-color๏ผš็ฆ็”จๅฝฉ่‰ฒ-r, --reverse-grayscale๏ผš็ฐ้˜ถๅญ—็ฌฆๅ่ฝฌ๏ผŒ็ปˆ็ซฏ่ƒŒๆ™ฏไธบไบฎ่‰ฒๆ—ถๅฏไปฅ่ฏ•่ฏ•็œ‹-R, --reverse-color๏ผš้ขœ่‰ฒๅ่ฝฌ-q, --quite๏ผš่พ“ๅ‡บ็ป“ๆžœไธญ๏ผŒๅฑ่”ฝ้™คๅญ—็ฌฆๅ›พ็š„ๅ…ถไป–ไฟกๆฏๅ…ถไป–๏ผš-v, --version๏ผšๆ‰“ๅฐๅทฅๅ…ท็‰ˆๆœฌไฟกๆฏ--help๏ผšๆ‰“ๅฐๅทฅๅ…ทไฝฟ็”จ่ฏดๆ˜ŽRelease History1.0.0Initial release on PyPI.๐Ÿ›ก LicenseThis project is licensed under the terms of theMITlicense. SeeLICENSEfor more details.๐Ÿ“ƒ Citation@misc{ansify, author = {lonsty}, title = {Awesome `ansify` is a Python CLI to create ANSI/ASCII art from images.}, year = {2021}, publisher = {GitHub}, journal = {GitHub repository}, howpublished = {\url{https://github.com/lonsty/ansify}} }CreditsThis project was generated withpython-package-template.
ansigenome
AnsigenomeAnsigenome is a command line tool designed to help you manage your Ansible roles.Scan your roles and organize your documentationCreate dependency graphs in secondsGenerated from theDebOpsproject.โ€ฆand more!Table of contentsUse caseInstallationQuick startTemplate variablesContributingAuthorUse caseAre you someone with 1 or 100+ roles? Then you will benefit from using Ansigenome, letโ€™s go over what Ansigenome can do for you:Gather metrics on your rolesStandardize your readmes in an automated wayAugment existing meta filesExport graphs and requirements filesCreate brand new rolesRun shell commands in the context of each roleGather metrics on your rolesJust runansigenome scanat a path containing all of your roles oransigenome scan /path/to/rolesand it will gather stats such as:Number of defaults, facts, files and lines found in each role and total themVerify if youโ€™re missing meta or readme filesWill it change my roles?Nope. This command is completely read only. All of your custom formatting and content is safe.Standardize your readmes in an automated wayWhen I started to get to about 5 roles I dreaded making readmes for each one because thereโ€™s so much boilerplate and duplication. Weโ€™re programmers, so letโ€™s use tools to help us.ansigenome gendocwill do the same asscanexcept it will read yourmeta/main.ymlfile and generate a readme based on the stats it found and also format your readme based on a jinja2 template.It can generate both RST and MD readmes.You can use the default template or optionally supply a custom template using blocks to customize the entire readme to your liking.Will it change my roles?It will not modify your meta file but itwill overwrite your existing readme filefor each role itโ€™s ran against. You can still add custom info to the readme, but this will be done through the meta file, donโ€™t worry about that just yet.Can I see an example of what it generates?Absolutely. This project sprung out of need while working on theDebOps project. Thereโ€™s about 60 roles all using an Ansigenome generated readme.All of them were fully generated with 0 manual edits.Augment existing meta filesYou might have 35 roles already written and might want Ansigenome to help you make the adjustment over to using Ansigenome.ansigenome genmetawill take a peek at your meta files for each role, replace certain fields with values you provided to its config (more on this later) and add ansigenome-only fields to that meta file.If you wanted to migrate over to using Ansigenome then this is what youโ€™ll want to run beforeansigenome gendoc. After runninggenmetayou will be able to take your old readme files and move some of it to the new meta file thatgenmetamade for you.Will it change my roles?It will rewrite your meta file for each role but itwill not mess with your formatting. It will only augment a few fields that are missing and overwrite things like thegalaxy_info.companyname with what you supplied in the Ansigenome config (more on this later, weโ€™re almost there).Export graphs and requirements filesGraphsJust runansigenome export-o<path to png output file>and it will use Graphviz to create a dependency graph.You can also tweak the size and DPI of the graph with a few flags or even set the output format to be-fdotso you can pipe it to a different Graphviz graphing utility.Requirements filesHave a go withansigenome export-treqs-o<path to output file>to generate a file for consumption byansible-galaxyinstall-r<file>. It also supports the-fymlflag to use the new yaml format.JSON dumpYou can also dump everything Ansigenome gathered to json by runningansigenome export-tdump-o<path to output file>.You could then feed that to some database back end or a javascript based graphing utility, etc..Any chance to output to stdout instead of a file?Yes, all of the export commands will output to stdout if you omit the-oflag. The only exception to this is the PNG graph.Will it change my roles?Not at all. It just reads a few files.Create brand new rolesEveryone loves making new roles right? Well,ansigenome init <role name/path>will do just that for you. Whatโ€™s different from usingansible-galaxyinit? Here, Iโ€™ll tell you:Creates an โ€œAnsigenome readyโ€ meta fileCreates atests/directory and.travis.ymlfile for you automaticallyIt uses a tool calledRolespecfor the test code. Donโ€™t worry, you donโ€™t need to download anything.Youโ€™ll also never have to write messy Travis configs again but you can still benefit from Travis itself.Will it change my roles?Nah, but it will make a brand new shiny role for you.Run shell commands in the context of each roleSometimes you just want to run a shell command against all of your roles. Similar to how Ansible lets you run adhoc commands on hosts.ansigenome-m'touch foo'would create thefoofile in the root directory of each role.InstallationIf you have Ansible installed then you already have all of the dependencies you need to run Ansigenome. Pick one of the way below:# Pick an installation method that agrees with you. pip install ansigenome easy_install ansigenome # If you want to live on the edge... git clone https://github.com/nickjj/ansigenome cd ansigenome ; sudo python setup.py developQuick startSo Ansigenome is installed, well done. Just runansigenome configand answer a few questions. You only need to do this once.At this point you can run any of the commands below.Usage: ansigenome [config|scan|gendoc|genmeta|export|init|run] [--help] [options] ansigenome config --help create a necessary config file to make ansigenome work ansigenome scan --help scan a path containing Ansible roles and report back useful stats ansigenome gendoc --help generate a README from the meta file for each role ansigenome genmeta --help augment existing meta files to be compatible with Ansigenome ansigenome export --help export roles to a dependency graph, requirements file and more ansigenome init --help init new roles with a custom meta file and tests ansigenome run --help run shell commands inside of each role's directory Options: --version show program's version number and exit -h, --help show this help message and exit ansigenome command --help for more info on a commandTipsDo not forget to check out the--helpfor each commandLearn how jinja2 extends works, you can use it for the readme templateYouโ€™re best off copying the base README and place it next to the custom j2Then you can{% extends "README.md.j2" %}gendocaccepts-fmdto generate markdown readmes instead of rstscan,gendoc,genmetaandrundonโ€™t require a roles pathIt will try$PWD/playbooks/rolesthen$PWDThis allows you to run Ansigenome from your roles path easilyYou can write a config out to a custom path with-o<path>The non-home version of the config will be used if foundFeel free to edit the config file by hand later to change valuesTheexport-treqscommand accepts a-vflag to read in a VERSION fileTheinitcommand accepts a-cflagSupply a comma separated list of Galaxy categoriesscan,gendoc,genmeta,runanddumpaccept an-lflagSupply a comma separated list of roles to white listIf you are the only author you do not need to specifyansigenome_info.authorsTemplate variablesHereโ€™s the available variables you can use in your meta file or optional custom readme template:# Access a single author (taken from your config). author.name author.company author.url author.email author.twitter author.github # Access all of the authors. authors # License. license.type license.url # SCM (source control management). scm.type scm.host scm.user scm.repo_prefix # Dynamic items (they are calculated/normalized for you automatically). role.name role.galaxy_name role.slug # Standard items (you can access any property of these objects). dependencies galaxy_info ansigenome_info # ansigenome_info fields. galaxy_id : String based ID to find your role on the Galaxy travis : Boolean to determine if this role is on Travis-CI status : Dictionary with info about the status name : String, currently supported are: beta, deprecated note : String containing additional information about the status synopsis : String block containing what your role does usage : String block containing a detailed usage guide custom : String block containing anything you want authors : List containing information about each authorYou can find many meta example files at theDebOps projectpage.Custom readme templateYou might decide that the current template doesnโ€™t suite your style. Thatโ€™s completely reasonable. You can supply your own readme template and extend the base one.Just add the path to the custom readme template to your config file. Then copy the base template from this repo to somewhere on your workstation, perhaps next to your custom template.Then in your custom template you can extend it like this:{% extends "README.md.j2" %} <insert the blocks you want to replace here>Available blocks to replacetitleansigenome_managedbadgesstatusbetadeprecatedsynopsisinstallationdependenciesstandalonedefaultsfactsusageauthorsfooterContributingIf you would like to contribute then check outAnsibleโ€™s contribution guidebecause this project expects the same requirements and it contains great tips on using git branches.In addition to that your code must pass the default pep8 style guide. I have Travis running a test to ensure the code follows that guide but your best bet is to find a plugin for your editor if you donโ€™t have one already.AuthorAnsigenome was created by Nick [email protected] thanks to@drybjedfor coming up with the name of the tool. This project idea spawned from trying to break up theDebOps projectinto multiple roles. Neither of us wanted to manually make 50 repos and 50 readmes so I decided to learn Python and make this tool instead.LicenseGPLv3
ansi-interactive-search
py-ansi-interactive-search
ansilbe
No description available on PyPI.
ansilog
#033[1;31m [ANSIlog] 033[0m: Utilities for colorful output, logging, and # basic terminal control.ansilogis a CLI-focused module that provides colorful output primitives and basic terminal control. It currently supports 16-color terminal escape sequences, along with various ANSI control sequences, attributes, and some extra terminal control features. It also offersansilog.StreamHandler, which can be added to loggers to enable colorized log levels and other colorized output.ansilogis smart enough to know when it is writing to attyor a file, and will strip all ANSI sequences before writing to files.Colors and attributes are wrapped in a convenient tag interface, with theansilog.print()function andansilog.StreamHandlerbeing able to convert these tags to output strings and strip ANSI sequences from them when necessary.The tags help automate the labor of resetting to terminal defaults (and previous highlights) when switching between highlight modes. You can include any number of string-able objects in the tag factory function and they will be concatenated.ANSIlog respects theNO_COLORenvironment variable in that all color and format sequences will be ignored if it is set, however cursor escapes and explicitly constructed escape sequences (alaseq()) will not be suppressed.` from ansilog import *print('Welcometo the ',bright(fg.red('U'),fg.white('S'),fg.blue('A')),'!',sep = '') `For more precise control, you can output the colors and attributes directly as well, but you must remember to reset afterwards.` from ansilog import *print('Welcometo the ', bright, fg.red, 'U', fg.white, 'S', fg.blue, 'A', reset,'!',sep = '') `### License ANSIlog is released under a 3 clause BSD license. See LICENSE for more details.
ansimagic
ansimagicColorifyForegroundBackgroundPresets
ansimarkup
AnsimarkupAnsimarkup is an XML-like markup for producing colored terminal text.fromansimarkupimportansiprintasprintprint("<b>bold text</b>"))print("<red>red text</red>","<red,green>red text on a green background</red,green>")print("<fg #ffaf00>orange text</fg #ffaf00>")InstallationThe latest stable version of ansimarkup can be installed from PyPi:python3-mpipinstallansimarkupUsageBasicfromansimarkupimportparse,ansiprint# parse() converts the tags to the corresponding ansi escape sequence.parse("<b>bold</b> <d>dim</d>")# ansiprint() works exactly like print(), but first runs parse() on all arguments.ansiprint("<b>bold</b>","<d>dim</d>")ansiprint("<b>bold</b>","<d>dim</d>",sep=":",file=sys.stderr)Colors and styles# Colors may be specified in one of several ways.parse("<red>red foreground</red>")parse("<RED>red background</RED>")parse("<fg red>red foreground</fg red>")parse("<bg red>red background</bg red>")# Xterm, hex and rgb colors are accepted by the <fg> and <bg> tags.parse("<fg 86>aquamarine foreground</fg 86>")parse("<bg #00005f>dark blue background</bg #00005f>")parse("<fg 0,95,0>dark green foreground</fg 0,95,0>")# Tags may be nested.parse("<r><Y>red text on a yellow foreground</Y></r>")# The above may be more concisely written as:parse("<r,y>red text on a yellow background</r,y>")# This shorthand also supports style tags.parse("<b,r,y>bold red text on a yellow background</b,r,y>")parse("<b,r,>bold red text</b,r,>")parse("<b,,y>bold regular text on a yellow background</b,,y>")# Unrecognized tags are left as-is.parse("<b><element1></element1></b>")For a list of markup tags, please refer totags.py.User-defined tagsCustom tags or overrides for existing tags may be defined by creating a newAnsiMarkupinstance:fromansimarkupimportAnsiMarkup,parseuser_tags={# Add a new tag (e.g. we want <info> to expand to "<bold><green>")."info":parse("<b><g>")# The ansi escape sequence can be used directly."info":"e\x1b[32m\x1b[1m",# Tag names may also be callables."err":lambda:parse("<r>")# Colors may also be given convenient tag names."orange":parse("<fg #d78700>"),# User-defined tags always take precedence over existing tags."bold":parse("<dim>")}am=AnsiMarkup(tags=user_tags)am.parse("<info>bold green</info>")am.ansiprint("<err>red</err>")# Calling the instance is equivalent to calling its parse method.am("<b>bold</b>")==am.parse("<b>bold</b>")Alignment and lengthAligning formatted strings can be challenging because the length of the rendered string is different that the number of printable characters. Consider this example:>>>a='|{:30}|'.format('abc')>>>b='|{:30}|'.format(parse('<b>abc</b>'))>>>print(a,b,sep='\n')| abc || abc |This can be addressed by using theansistringfunction or theAnsiMarkup.string(markup)method, which has the following useful properties:>>>s=ansistring('<b>abc</b>')>>>print(repr(s),'->',s)<b>abc</b> -> abc # abc is printed in bold>>>len(s),len(am.parse('<b>abc</b>'),s.delta3, 11, 8With the help of thedeltaproperty, it is easy to align the strings in the above example:>>>s=ansistring('<b>abc</b>')>>>a='| {:{width}} |'.format('abc',width=30)>>>b='| {:{width}} |'.format(s,width=(30+s.delta))>>>print(a,b,sep='\n')| abc || abc |Escaping raw stringsBothansiprint()andparse()pass arguments of typerawuntouched.>>>fromansimarkupimportansiprint,parse,raw>>>ansiprint("<b><r>",raw("<l type='V'>2.0</l>"),"</r></b>")<l type='V'>2.0</l> # printed in bold red (note the leading space caused)>>>s=parse("<b><r>",raw("<l type='V'>2.0</l>"),"</r></b>")>>>print(s)<l type='V'>2.0</l> # printed in bold redBuilding a template string may also be sufficient:>>>fromansimarkupimportparse>>>s=parse("<b><r>%s</r></b>")>>>print(s%"<l type='V'>2.0</l>")<l type='V'>2.0</l> # printed in bold redOther featuresThe default tag separators can be changed by passing thetag_separgument toAnsiMarkup:fromansimarkupimportAnsiMarkupam=AnsiMarkup(tag_sep="{}")am.parse("{b}{r}bold red{/b}{/r}")Markup tags can be removed using thestrip()method:fromansimarkupimportAnsiMarkupam=AnsiMarkup()am.strip("<b><r>bold red</b></r>")Thestrictoption instructs the parser to raiseMismatchedTagif opening tags don't have corresponding closing tags:fromansimarkupimportAnsiMarkupam=AnsiMarkup(strict=True)am.parse("<r><b>bold red")# ansimarkup.MismatchedTag: opening tag "<r>" has no corresponding closing tagCommand-lineAnsimarkup may also be used on the command-line. This works as if all arguments were passed toansiprint():$ python -m ansimarkup Usage: python -m ansimarkup [<arg> [<arg> ...]] Example usage: python -m ansimarkup '<b>Bold</b>' '<r>Red</r>' python -m ansimarkup '<b><r>Bold Red</r></b>' python -m ansimarkup < input-with-markup.txt echo '<b>Bold</b>' | python -m ansimarkupLogging formatterAnsimarkup also comes with a formatter for the standard libraryloggingmodule. It can be used as:importloggingfromansimarkup.logformatterimportAnsiMarkupFormatterlog=logging.getLogger()hdl=logging.StreamHandler()fmt=AnsiMarkupFormatter()hdl.setFormatter(fmt)log.addHandler(hdl)log.info("<b>bold text</b>")WindowsAnsimarkup uses thecoloramalibrary internally, which means that Windows support for ansi escape sequences is available by first running:importcoloramacolorama.init()For more information on Windows support, consult the "Usage" section of thecoloramadocumentation.PerformanceWhile the focus of ansimarkup is convenience, it does try to keep processing to a minimum. Thebenchmark.pyscript attempts to benchmark different ansi escape code libraries:Benchmark 1: <r><b>red bold</b></r> colorama 0.1959 ฮผs colr 1.8022 ฮผs ansimarkup 3.1681 ฮผs termcolor 5.3734 ฮผs rich 9.0673 ฮผs pastel 10.7440 ฮผs plumbum 14.0620 ฮผs Benchmark 2: <r><b>red bold</b>red</r><b>bold</b> colorama 0.5360 ฮผs colr 4.5575 ฮผs ansimarkup 4.5727 ฮผs termcolor 15.8462 ฮผs rich 21.2631 ฮผs pastel 22.9391 ฮผs plumbum 33.1179 ฮผsLimitationsAnsimarkup is a simple wrapper aroundcolorama. It does very little in the way of validating that markup strings are well-formed. This is a conscious decision with the goal of keeping things simple and fast.Unbalanced nesting, such as in the following example, will produce incorrect output:<r><Y>1</r>2</Y>TodoMany corner cases remain to be fixed.More elaborate testing. The current test suite mostly covers the "happy paths".Replacetag_list.indexinsub_endwith something more efficient (i.e. something like an ordered MultiDict).Similar librariespastel: bring colors to your terminalplumbum.colors: small yet feature-rich library for shell script-like programs in Pythoncolr: easy terminal colors, with chainable methodsrich: rich text and beautiful formatting in the terminal (seerich.print()andrich.markup.render())LicenseAnsimarkup is released under the terms of theRevised BSD License.
ansinject
ANS INJECTImage byDarwin LaganzonfromPixabayAndroid Network Security Config InjectorThis tool is simply an easier way to use some collection of other tools which can inject a network security config into an Android APK. Mainly it's sole pupose is making it easier to use the tools in the requirements list below with one line of command.This is useful when you want to test an app that uses HTTPS but you don't have a valid certificate. This tool will allow you to bypass the certificate check.DisclaimerThis tool is provided as is. I am not responsible for any damage caused by this tool. Use it at your own risk.Requirementsadb(Part of the Android SDK)zipalign(Part of the Android SDK)jarsigner(Part of the JDK)keytool(Part of the JDK)apktool(Need to be installed manually)InstallationpipinstallansinjectUsageansinject--helpansinjectinject[input_apk][output_apk]--temp-dir[temp_dir]Basicly the script will do the following:Extract the APKCopy the following network security config onto/res/xml/network_security_config.xml<?xml version="1.0" encoding="utf-8"?><network-security-config><base-configcleartextTrafficPermitted="true"><trust-anchors><certificatessrc="system"/><certificatessrc="user"/></trust-anchors></base-config></network-security-config>Rebuild the APKGenerate a keystore in order to sign the APKSign the APKAlign the outputLicenseThis project is licensed under the MIT License - see theLICENSEfile for detailsAcknowledgementsstackoverflow - Capturing mobile phone traffic on wiresharkgist - unoexperto - How to patch Android app to sniff its HTTPS traffic with self-signed certificateexandroid - Capture all android network traffic
ansinv
A Simple Ansible Inventory Generator=Overview=This simple library makes it easier to write theglue codebetween infrastructure bringup/orchestration and software provisioning stages of a one-click deployment.Head over to thewiki pagefor more explanation about this project.=Installation=pip install ansinv=Working with inventory hosts=Creating a host with optionalhost variables:host1 = ansinv.AnsibleHost("192.168.10.11", affinity=12, scan="no")Get a hostโ€™s ip/name usingAnsibleHost.nameattribute:print(host1.name)Read/Update a hostโ€™s host variables usingAnsibleHost.hostvarsattribute:print(host1.hostvars["scan"]) host1.hostvars["affinity"] = 5 host1.hostvars.update(x=100)=Working with inventory groups=Creating a group with optionalgroup variables:group1 = ansinv.AnsibleGroup("group1", ssh_port=8800)Get a groupโ€™s name usingAnsibleGroup.nameattribute:print(group1.name)Read/Update a groupโ€™s group variables using theAnsibleGroup.groupvarsattribute:print(group1.groupvars["ssh_port"]) group1.groupvars["ssh_port"] = 22 group1.groupvars.update(x=100)Adding hosts to a group usingAnsibleGroup.add_hostsmethod:group1.add_hosts(host1, host2, ...) # host1, host2, etc. must already exist group1.add_hosts(ansinv.AnsibleHost("192.168.12.12", hostvar1="value")) # creating and adding hosts at the same timePlease note:Adding a host actually creates acopyof the host object under the group. So to make modifications to a host object after it has been added, useAnsibleGroup.hostmethod as described below.Get access to a member host usingAnsibleGroup.host('hostname')method:group1.host("192.168.1.12").hostvars["hostvar1"] = "new value"Please note:The host() method will always return the first occurrence of the given โ€˜hostnameโ€™, even if there are multiple hosts with same name in the group. This behavior assumes that even though you are allowed to have multiple hosts with same name but you will never actually require such a case.Get a list of all host objects in a group usingAnsibleGroup.hostsattribute:print(group1.hosts[0].name)Establish parent-child relation between groups usingAnsibleGroup.add_childrenmethod:child1 = AnsibleGroup("master") child2 = AnsibleGroup("worker") parent = AnsibleGroup("cluster") parent.add_children(child1, child2) parent.add_children(parent) # ValueError when trying to add itself as a child child1.add_children(parent) # ValueError when trying to add a parent group as a childCheck whether the group is a parent of given group usingAnsibleGroup.is_parent_ofmethod:group1.is_parent_of(group2) # Returns a bool valueCheck whether the group is a child of given group usingAnsibleGroup.is_child_ofmethod:group1.is_child_of(group2) # Returns a bool valueGet a list of all child objects usingAnsibleGroup.childrenattribute:print(group1.children[0].name)=Working with the inventory itself=Creating an inventory:inv = AnsibleInventory() # empty inventory inv = AnsibleInventory(AnsibleHost("h1"), AnsibleHost("h2")) # inventory initialized with two ungrouped hostsAdd (ungrouped) hosts to the inventory usingAnsibleInventory.add_hostsmethod:h1 = AnsibleHost("h1") h2 = AnsibleHost("h2") inv.add_hosts(h1, h2)Please note:The hosts added directly to the inventory are โ€˜ungroupedโ€™ hosts i.e. they will not appear under other groups.Add groups to the inventory usingAnsibleInventory.add_groupsmethod:g1 = AnsibleGroup("g1") g2 = AnsibleGroup("g2") inv.add_groups(g1, g2)Please note:Adding a host/group actually creates acopyof the host/group object under the inventory. So to make modifications to a host/group object after it has been added, useAnsibleInventory.host(hostname)/AnsibleInventory.group(groupname)methods as described below.Get anungroupedhost object from the inventory usingAnsibleInventory.hostmethod:print(inv.host("h1")) inv.host("h1").hostvars["somevar"] = 111 # modify an ungrouped host after it has been added to the inventoryGet a group object from the inventory usingAnsibleInventory.group('groupname')method:inv.group("g1").groupvars["x"] = 1111 inv.group("g1").host("h1").hostvars["somevar"] = 333Please note:The group() method will always return the first occurrence of the given โ€˜groupnameโ€™, even if there are multiple groups with same name in the inventory. This behavior assumes that even though you are allowed to have multiple groups with same name but you will never actually require such a case.Get a list of all group objects from the inventory usingAnsibleInventory.groupsattribute:for grp in inv.groups: print(grp.name)Get the whole inventory as a string object:The string version of the inventory is in the INI format which you can simply write to a file and pass the file to Ansible.inv = AnsibleInventory() ... # add some groups and hosts print(str(inv)) with open("inventory", "w") as f: f.write(str(inv))For more explanation and a full example please visit thewiki page.
ansipants
ansipantsA Python module and command-line utility for converting .ANS format ANSI art to HTML.Installationpip install ansipantsCommand-line usagepython -m ansipants input.ans > output.htmlFor additional options, runpython -m ansipants --help.The output is a fragment of HTML, in UTF-8 encoding, intended to be inserted into a preformatted text element (<pre>...</pre>). Further styling is up to you - for the proper MS-DOS experience,The Ultimate Oldschool PC Font Pack by VileRis recommended.Python APIExample code:fromansipantsimportANSIDecoderwithopen('input.ans','rt',encoding='cp437')asf:decoder=ANSIDecoder(f)print(decoder.as_html())classansipants.ANSIDecoder(stream=None, palette='vga', width=80, strict=False)Parameters:stream- the ANSI input data as a file-like object. This should be opened for reading in text mode, which means you'll need to specify the appropriate encoding - for ANSI art created for DOS this will most likely becp437.palette- the colour palette to use; either'vga'or'workbench'width- the number of columns the text should wrap atstrict- If True, the decoder will raise anansipants.ANSIDecodeErrorexception on any unrecognised or malformed escape codes; if False, it will skip past them.ANSIDecoder.as_html()Returns the HTML output as a string.ANSIDecoder.as_html_lines()Returns the HTML output as an iterator, yielding one line at a time.AuthorMatt [email protected]
ansipython
ansi escape codes in python
ansiqa
A utility for managing Ansible Roles. Designed to be run inside therolesdirectory.Inspired by [ansigenome](https://github.com/nickjj/ansigenome/)Host Dependsdepends functionality requires on graphviz to be installed.Features### Statsansiqa statsPrints stats about roles. With no arguments,statswill print the following for each:Number of tasksNumber of variables setNumber of defaults setIf a README.* file is presentIf meta/main.yml is presentIf extras/main.yml is present (used by Ansiqa to generate READMEs)### Metaansiqa metaGenerate base meta files for roles from values in the AnsiQA config file.### Extraansiqa extraGenerate base extra files for roles from values in the AnsiQA config file, stored inextra/main.yml. These values are used by AnsiQA to generate READMEs.### Docsansiqa docsGenerate a README by filling a Jinja2 template. The readme template must end in .j2, and can be put in the following places:Specified in the AnsiQA config file, by the root level tokentemplateFound in the current working directory, matching the README.*.j2 globFound in the userโ€™s home directory, matching the README.*.j2 globThis template is fed a role dictionary, which contains the following tokens` 'name': the role name 'path': the role absolute path 'defaults': the defaults provided by the role, formatted as yaml 'files': a list of files by the role 'handlers': a list of handlers provided by the role 'meta': a dict containing the values in meta/main.yml 'tasks': a list of tasks provided by the role 'templates': a list of templates provided by the role 'tests': a boolean value, if the tests directory exists 'vars': the variables provided by the role, formatted as yaml 'extra': a dict containing the values in extra/main.yml `### Dependsansiqa dependsDependency introspection. With no arguments,dependsprints the number of dependencies each role has, the number of times each role is depended on, and the โ€œdependency depthโ€ of each role (how long the longest dependency chain is.)With theโ€“graphflag, ansiqa generates a GraphViz graph to visualize the dependency tree.ConfigurationThe configuration file should be a yaml file named.ansiqaand be located either in the current working directory or in the userโ€™s home directory. It can have the following root level tokens` meta: A dict containing the default values for the meta/main.yml extra: A dict containing the default values for the extra/main.yml template: A string containing the path to the README template, first checking the current working directory for the path, then the home directory, and finally checking it as an absolute path. `
ansiscaf
help create file tree for ansible
ansiscape
ansiscapeansiscapeis a Python package and CLI tool for creating and interpreting ANSI escape codes.Support fornamed,8-bitand24-bit colours.Create formatted strings withnested sequencesandproperty reversions.Convert embedded escape codes intoexplanatory dictionaries.Write sequences asfully resolved stringsandexplanatory JSON.Full documentation is published atansiscape.readthedocs.io.InstallationansiscaperequiresPython 3.8 or later.pipinstallansiscapeBasic CLI usageansiscapeon the command line will read from stdin and emit a JSON document describing the text and its escape codes.For example:ls--color|ansiscape["ansiscape\nbuild.sh\ncoverage.xml\ndocs\nhtmlcov\nLICENSE\nlint.sh\nMANIFEST.in\nmkdocs.yml\nmypy.ini\nPipfile\nPipfile.lock\npyproject.toml\nREADME.md\nsetup.py\ntest-cli.sh\ntests\ntest.sh"]Full documentation is published atansiscape.readthedocs.io.Basic Python usageansiscapeprovides a library of functions for formatting text.For example, to make text bold:fromansiscapeimportheavyprint(heavy("Hello, world!"))Hello, world!These functions can be nested to create complex formatted strings. Specific instructions can also be embedded:fromansiscapeimportInterpretation,Sequence,heavyfromansiscape.enumsimportMetaInterpretation,Weightsequence=Sequence(Interpretation(weight=Weight.HEAVY),"Hello, world!",Interpretation(weight=MetaInterpretation.REVERT),)print(sequence)Hello, world!Full documentation is published atansiscape.readthedocs.io.๐Ÿ‘‹ Hello!Hello!I'mCariad Ecclestonand I'm an independent/freelance software engineer. If my work has value to you, please considersponsoring.If you ever raise a bug, request a feature or ask a question then mention that you're a sponsor and I'll respond as a priority. Thank you!
ansistrip
AnsistripModule to strip ANSI Escape codes from a string.InstallationInstall with pippip3 install -U ansistripUsageIn [1]: import ansistrip In [2]: text = "\x1b[1m\x1b[38;5;10mtest\x1b0m" In [3]: ansistrip.ansi_strip(text) Out[3]: 'test'
ansi-styles
ansi-stylesANSI escape codesfor styling strings in the terminalA port of the Node.js packageansi-stylesto Python.Installpython3 -m pip install -U ansi-stylesUsagefromansi_stylesimportansiStylesasstylesprint(f'{styles.green.open}Hello world!{styles.green.close}')# Color conversion between 256/truecolor# NOTE: When converting from truecolor to 256 colors, the original color# may be degraded to fit the new color palette. This means terminals# that do not support 16 million colors will best-match the# original color.print(f'{styles.color.ansi(styles.rgbToAnsi(199,20,250))}Hello World{styles.color.close}')print(f'{styles.color.ansi256(styles.rgbToAnsi256(199,20,250))}Hello World{styles.color.close}')print(f'{styles.color.ansi16m(*styles.hexToRgb("#abcdef"))}Hello World{styles.color.close}')LicenseMITContactA library byShawn Presser. If you found it useful, please considerjoining my patreon!My Twitter DMs are always open; you shouldsend me one! It's the best way to reach me, and I'm always happy to hear from you.Twitter:@theshawwnPatreon:https://www.patreon.com/shawwnHN:sillysaurusxWebsite:shawwn.com
ansit
No description available on PyPI.
ansitable
GitHub repository:https://github.com/petercorke/ansitableDependencies:coloredSynopsisPainless creation of nice-lookingtables of dataormatricesin Python.What's new:0.9.5:methods to format table as MarkDown or LaTeXwork with Python 3.40.9.3:create matrices as well as tablesoption to suppress color outputTablesPainless creation of nice-looking tables of data for Python.Starting simple1|fromansitableimportANSITable,Column2|3|table=ANSITable("col1","column 2 has a big header","column 3")4|table.row("aaaaaaaaa",2.2,3)5|table.row("bbbbbbbbbbbbb",5.5,6)6|table.row("ccccccc",8.8,9)7|table.print()Line 3 constructs anANSITableobject and the arguments are a sequence of column names followed byANSITablekeyword arguments - there are none in this first example. Since there are three column names this this will be a 3-column table. Lines 4-6 add rows, 3 data values for each row.Line 7 prints the table and yields a tabular display with column widths automatically chosen, and headings and column data all right-justified (default)col1 column 2 has a big header column 3 aaaaaaaaa 2.2 3 bbbbbbbbbbbbb 5.5 6 ccccccc 8.8 9By default output is printed to the console (stdout) but we can also:provide afileoption to.print()to allow writing to a specified output stream, the default isstdout.obtain a multi-line string version of the entire table asstr(table).The more general solution is to provide a sequence ofColumnobjects which allows many column specific options to be given, as we shall see later. For now though, we could rewrite the example above as:table=ANSITable(Column("col1"),Column("column 2 has a big header"),Column("column 3"))or astable=ANSITable()table.addcolumn("col1")table.addcolumn("column 2 has a big header")table.addcolumn("column 3")where the keyword arguments to.addcolumn()are the same as those forColumnand are given below.We can specify aPythonformat()style format stringfor any column - by default it is the general formatting option"{}". You may choose to left or right justify values via the format string,ansitableprovides control over how those resulting strings are justified within the column.table=ANSITable(Column("col1"),Column("column 2 has a big header","{:.3g}"),# CHANGEColumn("column 3","{:-10.4f}"))table.row("aaaaaaaaa",2.2,3)table.row("bbbbbbbbbbbbb",5.5,6)table.row("ccccccc",8.8,9)table.print()which yieldscol1 column 2 has a big header column 3 aaaaaaaaa 2.2 3.0000 bbbbbbbbbbbbb 5.5 6.0000 ccccccc 8.8 9.0000Alternatively we can specify the format argument as a function that converts the value to a string.The data in column 1 is quite long, we might wish to set a maximum column width which we can do using thewidthargumenttable=ANSITable(Column("col1",width=10),# CHANGEColumn("column 2 has a big header","{:.3g}"),Column("column 3","{:-10.4f}"))table.row("aaaaaaaaa",2.2,3)table.row("bbbbbbbbbbbbb",5.5,6)table.row("ccccccc",8.8,9)table.print()which yieldscol1 column 2 has a big header column 3 aaaaaaaaa 2.2 3.0000 bbbbbbbbbโ€ฆ 5.5 6.0000 ccccccc 8.8 9.0000where we see that the data in column 1 has been truncated.If you don't like the ellipsis you can turn it off, and get to see one more character, with theANSITableoptionellipsis=False. The Unicode ellipsis character u+2026 is used.BordersWe can add a table border made up of regular ASCII characterstable=ANSITable(Column("col1"),Column("column 2 has a big header"),Column("column 3"),border="ascii"# CHANGE)table.row("aaaaaaaaa",2.2,3)table.row("bbbbbbbbbbbbb",5.5,6)table.row("ccccccc",8.8,9)table.print()which yields+--------------+---------------------------+----------+ | col1 | column 2 has a big header | column 3 | +--------------+---------------------------+----------+ | aaaaaaaaa | 2.2 | 3 | |bbbbbbbbbbbbb | 5.5 | 6 | | ccccccc | 8.8 | 9 | +--------------+---------------------------+----------+Or we can construct a border using theANSI box-drawing characterswhich are supported by most terminal emulatorstable=ANSITable(Column("col1"),Column("column 2 has a big header"),Column("column 3"),border="thick"# CHANGE)table.row("aaaaaaaaa",2.2,3)table.row("bbbbbbbbbbbbb",5.5,6)table.row("ccccccc",8.8,9)table.print()which yieldsโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“ โ”ƒ col1 โ”ƒ column 2 has a big header โ”ƒ column 3 โ”ƒ โ”ฃโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‹โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‹โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ซ โ”ƒ aaaaaaaaa โ”ƒ 2.2 โ”ƒ 3 โ”ƒ โ”ƒbbbbbbbbbbbbb โ”ƒ 5.5 โ”ƒ 6 โ”ƒ โ”ƒ ccccccc โ”ƒ 8.8 โ”ƒ 9 โ”ƒ โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ปโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ปโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”›Note: this actually looks better on the console than it does in GitHub markdown.Other border options include "thin", "rounded" (thin with round corners) and "double".Header and column alignmentWe can change the alignment of data and heading for any column with the alignment flags"<"(left),">"(right) and"^"(centered).table=ANSITable(Column("col1"),Column("column 2 has a big header",colalign="^"),# CHANGEColumn("column 3"),border="thick")table.row("aaaaaaaaa",2.2,3)table.row("bbbbbbbbbbbbb",5.5,6)table.row("ccccccc",8.8,9)table.print()which yieldsโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“ โ”ƒ col1 โ”ƒ column 2 has a big header โ”ƒ column 3 โ”ƒ โ”ฃโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‹โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‹โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ซ โ”ƒ aaaaaaaaa โ”ƒ 2.2 โ”ƒ 3 โ”ƒ โ”ƒbbbbbbbbbbbbb โ”ƒ 5.5 โ”ƒ 6 โ”ƒ โ”ƒ ccccccc โ”ƒ 8.8 โ”ƒ 9 โ”ƒ โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ปโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ปโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”›where the data for column 2 has been centered.Heading and data alignment for any column can be set independentlytable=ANSITable(Column("col1",headalign="<"),# CHANGEColumn("column 2 has a big header",colalign="^"),Column("column 3",colalign="<"),# CHANGEborder="thick")table.row("aaaaaaaaa",2.2,3)table.row("bbbbbbbbbbbbb",5.5,6)table.row("ccccccc",8.8,9)table.print()yieldsโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ณโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”“ โ”ƒcol1 โ”ƒ column 2 has a big header โ”ƒ column 3 โ”ƒ โ”ฃโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‹โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•‹โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ซ โ”ƒ aaaaaaaaa โ”ƒ 2.2 โ”ƒ 3 โ”ƒ โ”ƒbbbbbbbbbbbbb โ”ƒ 5.5 โ”ƒ 6 โ”ƒ โ”ƒ ccccccc โ”ƒ 8.8 โ”ƒ 9 โ”ƒ โ”—โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ปโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”ปโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”›where we have left-justified the heading for column 1 and the data for column 3.ColorIf you have thecoloredpackage installed then you can set the foreground and background color and style (bold, reverse, underlined, dim) of the header and column data, as well as the border color.table=ANSITable(Column("col1",headalign="<",colcolor="red",headstyle="underlined"),# CHANGEColumn("column 2 has a big header",colalign="^",colstyle="reverse"),# CHANGEColumn("column 3",colalign="<",colbgcolor="green"),# CHANGEborder="thick",bordercolor="blue"# CHANGE)table.row("aaaaaaaaa",2.2,3)table.row("bbbbbbbbbbbbb",5.5,6)table.row("ccccccc",8.8,9)table.print()which yieldsIt is also possible to change the color of individual cells in the table by prefixing the value with a color enclosed in double angle brackets, for example<<red>>.table=ANSITable("col1","column 2 has a big header","column 3")table.row("aaaaaaaaa",2.2,3)table.row("<<red>>bbbbbbbbbbbbb",5.5,6)table.row("<<blue>>ccccccc",8.8,9)table.print()All optionsANSITableThese keyword arguments control the styling of the entire table.KeywordDefaultPurposecolsep2Gap between columns (in spaces)offset0Gap at start of each row, shifts the table to the leftborderno borderBorder style: 'ascii', 'thin', 'thick', 'double'bordercolorBorder color, seepossible valuesellipsisTrueAdd an ellipsis if a wide column is truncatedheaderTrueInclude the column header rowcolumnsSpecify the number of columns ifheader=Falseand no header name orColumnarguments are givencolorTrueEnable colorColor is only possible if thecoloredpackage is installedIfcoloris False then no color escape sequences will be emitted, useful override for tables included in Sphinx documentation.ColumnThese keyword arguments control the styling of a single column.KeywordDefaultPurposefmt"{}"format string for the column value, or a callable that maps the column value to a stringwidthmaximum column width, excess will be truncatedcolcolorText color, seepossible valuescolbgcolorText background color, seepossible valuescolstyleText style: "bold", "underlined", "reverse", "dim", "blink"colalign">"Text alignment:">"(left),"<"(right),"^"(centered)headcolorHeading text color, seepossible valuesheadbgcolorHeading text background color, seepossible valuesheadstyleHeading text style: "bold", "underlined", "reverse", "dim", "blink"headalign">"Heading text alignment:">"(left),"<"(right),"^"(centered)Note that many terminal emulators do not support the "blink" style.Output in other tabular formatsThe main use for this package is to generate tables on the console that are easy to read, but sometimes you might want the table in a different format to include in documentation.table=ANSITable("col1","column 2 has a big header","column 3")table.row("aaaaaaaaa",2.2,3)table.row("bbbbbbbbbbbbb",-5.5,6)table.row("ccccccc",8.8,-9)table.print()can be rendered into Markdowntable.markdown() | col1 | column 2 has a big header | column 3 | | ------------: | ------------------------: | -------: | | aaaaaaaaa | 2.2 | 3 | | bbbbbbbbbbbbb | -5.5 | 6 | | ccccccc | 8.8 | -9 |or LaTextable.latex() \begin{tabular}{ |r|r|r| }\hline \multicolumn{1}{|r|}{col1} & \multicolumn{1}{|r|}{column 2 has a big header} & \multicolumn{1}{|r|}{column 3}\\\hline\hline aaaaaaaaa & 2.2 & 3 \\ bbbbbbbbbbbbb & -5.5 & 6 \\ ccccccc & 8.8 & -9 \\ \hline \end{tabular}In both cases the method returns a string and column alignment is supported. MarkDown doesn't allow the header to have different alignment to the data.MatricesPainless creation of nice-looking matrices for Python.We can create a formatter for NumPy arrays (1D or 2D)fromansitableimportANSIMatrixformatter=ANSIMatrix(style='thick')and then use it to format a NumPy arraym=np.random.rand(4,4)-0.5m[0,0]=1.23456e-14formatter.print(m)yieldsโ” โ”“ โ”ƒ 0 -0.385 -0.106 0.296 โ”ƒ โ”ƒ 0.0432 0.339 0.119 -0.468 โ”ƒ โ”ƒ 0.405 -0.306 0.0165 -0.439 โ”ƒ โ”ƒ 0.203 0.4 -0.499 -0.487 โ”ƒ โ”— โ”›we can also add suffixesformatter.print(m,suffix_super='T',suffix_sub='3')yieldsโ” โ”“T โ”ƒ 0 -0.239 0.186 -0.414 โ”ƒ โ”ƒ 0.49 0.215 -0.0148 0.0529 โ”ƒ โ”ƒ 0.0473 0.0311 0.45 0.394 โ”ƒ โ”ƒ-0.192 0.193 -0.455 0.0302 โ”ƒ โ”— โ”›3By default output is printed to the console (stdout) but we can also:provide afileoption to.print()to allow writing to a specified output stream, the default isstdout.obtain a multi-line string version of the entire table using the.str()method instead of.print().The formatter takes additional arguments to control the numeric format and to control the suppression of very small values.ANSIMatrixThese keyword arguments control the overall styling and operation of the formatter.KeywordDefaultPurposestyle"thin""thin","round","thick","double"fmt"{:< 10.3g}"format for each elementsquishTrueset small elements to zerosquishtol100elements less thansquishtol * epsare set to zeroFormatterA formatter takes additional arguments to the styling for a particular call.KeywordDefaultPurposesuffix_super""superscript suffix textsuffix_sub""subscript suffix text
ansitagcolor
BugsThe normal terminal color libraries provide an easy way to print text with colors and styles. _ansitagcolor_ provides a binding between a tag (e.g. error, warn, info) and a givenstyle. Tags are registered at aterminstance and text can be processed withterm.cprintor replace theprintwithterm.printr.Author: Alexander Weigl License: MIT Date: 2014-03-14 Version: 0.2Getting StartedInstall with pip:pip install --user ansitagcolorRun in python:from __future__ import print_function import ansitagcolor as ansi t = ansi.term() print = t.printr t.register("error", style( foreground = ansi.Color16Table.White, background = ansi.Color16Table.Red) ) print("{error Error Message!}")
ansitcontrib-vagrant
No description available on PyPI.
ansiterm
ansiterm Packageansiterm - change color and style (bold, reverse) of text on displayDESCRIPTIONThis manual page documentsansitermmodule, a Python module providing functions for generating ANSI escape sequences to change the color and the style (i.e., bold and reverse) of text displayed on the screen.A majority of terminal emulators support ANSI escape sequences.ansitermmodule provides handy functions for changing the color and the style.Please refer tohttps://en.wikipedia.org/wiki/ANSI_escape_codefor the introduction of ANSI escape sequences.EXAMPLEfromansitermimportcolorforboldin(False,True):forreversein(False,True):fornamein['reset','bold','underline','reverse','gray','red','green','yellow','blue','magenta','cyan','white']:astr=color('text in{}with bold={}, reverse={}'.format(name,bold,reverse),name,bold=bold,reverse=reverse)print(astr)FUNCTIONSansitermmodule provides the following functions.color(astr, name='bold', bold=False, reverse=False)Embed ANSI escape sequences around string ASTR to change the text style to NAME. Make the text boldface and reversed video if BOLD or REVERSE is True, respectively.The following functions are provided as short-cuts. For instance, blue(astr) and reest(astr) are equivalent to color(astr, 'blue') and color(astr, 'reset), respectively.reset(astr, bold=False, reverse=False)bold(astr, bold=True, reverse=False)gray(astr, bold=False, reverse=False)red(astr, bold=False, reverse=False)green(astr, bold=False, reverse=False)yellow(astr, bold=False, reverse=False)blue(astr, bold=False, reverse=False)magenta(astr, bold=False, reverse=False)cyan(astr, bold=False, reverse=False)white(astr, bold=False, reverse=False)INSTALLATIONpip3installansitermAVAILABILITYThe latest version ofansitermmodule is available at PyPI (https://pypi.org/project/ansiterm/) .SEE ALSOperl(1), perlfunc(1), getopt(3), Getopt::Std(3perl)AUTHORHiroyuki Ohsaki <ohsaki[atmark]lsnl.jp>
ansi-text
ANSI TextThis repo contains code for reading and manipulating text that has had formatting applied using ANSI escape sequences (colored foreground, colored background, bold, underline, etc.).This isn't really all that useful for composing ANSI formatted text, it's more of a utility for easily editing text that already has had ANSI formatting applied to it. Once text has been read into an AnsiText object, the text can then be accessed and manipulated in a number of ways.IntroductionANSI escape sequences are special sequences of characters that tell a terminal, terminal-like interpreter, Jupyter Notebook, etc. to do something. They can do a lot of stuff, but for the purposes of this README we'll just say "ANSI escape sequences are magical strings of characters that can change the color of text or apply formatting (like making the text bold or underlined)." If you'd like to learn more,this Wikipedia article goes more in depth.Here is an example of some ANSI formatted text:There's a chunk at the beginning that tells the terminal to to set the text color to blue:\x1b[38;5;12mThen there's the text:ANSI formatted textAnd finally there's a sequence that tells the terminal to reset all attributes to their default values:\x1b[0mReading text into AnsiText object:If you have a string of text that already has ANSI formatting applied to it, you can read it into an AnsiText object when the AnsiText object is created:>>>text='\x1b[38;5;12mANSI formatted text\x1b[0m'>>>atext=AnsiText(text)or by using the 'read' method:>>>text='\x1b[38;5;12mANSI formatted text\x1b[0m'>>>atext.read(text)Reading from AnsiText object:Operations that use thestr() method, such as print() or str(), will receive the formatted text. If you use str(), you'll be able to see the escape sequences used to format the text. If you use print(), the colored string will be visible in your terminal:The unformatted text can be accessed using the 'text' attribute:>>>text='\x1b[38;5;12mANSI formatted text\x1b[0m'>>>atext=AnsiText(text)>>>atext.textANSIformattedtextEditing AnsiText object:When the text is read into the AnsiText object it will detect if the formatting changes through the string. The plaintext and formatting information for each of these is stored in an AnsiSubString object.These substrings can be accessed either through the groups attribute, or by indexing into the AnsiText object. This also allows for item assignment, which will replace the plaintext for a given group while retaining the ANSI formatting. This means that the size of the text can change (see below, where 'stuff' is replaced with 'Doggos!').Alternate indexing modeThere are some use cases where the method of indexing demonstrated above wouldn't make sense. For example, if the color of the text changes with each letter, as would be the case if a gradient has been applied to it. In this situation it would be very cumbersome to edit the text, since the user would need to assign each letter to a separate group.The alternate indexing mode addresses this problem. When this mode is active, indexing operations will refer to the unformatted text as a whole. No matter how many groups there are in, AnsiText object atext accessed as atext[n] will return the character at position 'n' in the unformatted text.You can think of the unformatted text as a list: this allows for slicing operations, etc., but it may lead to some unexpected behavior. The text will always be truncated to the length of the original unformatted text, and if you provide a string that's larger than the span of the slice it will "run over", overwriting text past the stop value.The user can cause the AnsiText object to use the alternate indexing mode either by setting the 'index_groups' argument to False when the object is created, or by setting the 'index_groups' attribute to False.
ansito
ansitoTranslate ANSI codes to any other format.Currently, only Conky format is supported.Requirementsansito requires Python 3.6 or above.To install Python 3.6, I recommend usingpyenv.# install pyenvgitclonehttps://github.com/pyenv/pyenv~/.pyenv# setup pyenv (you should also put these three lines in .bashrc or similar)exportPATH="${HOME}/.pyenv/bin:${PATH}"exportPYENV_ROOT="${HOME}/.pyenv"eval"$(pyenvinit-)"# install Python 3.6pyenvinstall3.6.8# make it available globallypyenvglobalsystem3.6.8InstallationWithpip:python3.6-mpipinstallansitoWithpipx:# install pipx with the recommended methodcurlhttps://raw.githubusercontent.com/cs01/pipx/master/get-pipx.py|python3 pipxinstall--pythonpython3.6ansitoUsage (as a library)TODOUsage (command-line)usage: ansito [-h] FILENAME positional arguments: FILENAME File to translate, or - for stdin. optional arguments: -h, --help show this help message and exitExample:command-that-output-colors|ansito-Real-word example withtaskwarriorin a Conky configuration file:${texecpi60flock~/.tasktasklimit:10rc.defaultwidth:80rc._forcecolor:onrc.verbose:affected,blanklist|ansito-|sed-r's/([^ ])#/\1\\#/g'
ansitoimg
AnsiToImgConvert an ANSI string to an image. Great for adding terminal output into a readme.Example OutputDocumentationInstall With PIPLanguage informationBuilt forInstall Python on WindowsChocolateyWindows - Python.orgInstall Python on LinuxAptDnfInstall Python on MacOSHomebrewMacOS - Python.orgHow to runWindowsLinux/ MacOSBuildingTestingDownload ProjectCloneUsing The Command LineUsing GitHub DesktopDownload Zip FileCommunity FilesLicenceChangelogCode of ConductContributingSecuritySupportRationaleExample OutputDocumentationA high-level overview of how the documentation is organized organized will help you know where to look for certain things:Tutorialstake you by the hand through a series of steps to get started using the software. Start here if youโ€™re new.TheTechnical Referencedocuments APIs and other aspects of the machinery. This documentation describes how to use the classes and functions at a lower level and assume that you have a good high-level understanding of the software.Install With PIPpipinstallansitoimgHead tohttps://pypi.org/project/ansitoimg/for more infoLanguage informationBuilt forThis program has been written for Python versions 3.8 - 3.11 and has been tested with both 3.8 and 3.11Install Python on WindowsChocolateychocoinstallpythonWindows - Python.orgTo install Python, go tohttps://www.python.org/downloads/windows/and download the latest version.Install Python on LinuxAptsudoaptinstallpython3.xDnfsudodnfinstallpython3.xInstall Python on [email protected] - Python.orgTo install Python, go tohttps://www.python.org/downloads/macos/and download the latest version.How to runWindowsModulepy -3.x -m [module]or[module](if module installs a script)Filepy -3.x [file]or./[file]Linux/ MacOSModulepython3.x -m [module]or[module](if module installs a script)Filepython3.x [file]or./[file]BuildingThis project useshttps://github.com/FHPythonUtils/FHMaketo automate most of the building. This command generates the documentation, updates the requirements.txt and builds the library artefactsNote the functionality provided by fhmake can be approximated by the followinghandsdown--cleanup-odocumentation/reference poetryexport-frequirements.txt--outputrequirements.txt poetryexport-frequirements.txt--withdev--outputrequirements_optional.txt poetrybuildfhmake auditcan be run to perform additional checksTestingFor testing with the version of python used by poetry usepoetryrunpytestAlternatively usetoxto run tests over python 3.8 - 3.11toxDownload ProjectCloneUsing The Command LinePress the Clone or download button in the top rightCopy the URL (link)Open the command line and change directory to where you wish to clone toType 'git clone' followed by URL in step 2gitclonehttps://github.com/FHPythonUtils/AnsiToImgMore information can be found athttps://help.github.com/en/articles/cloning-a-repositoryUsing GitHub DesktopPress the Clone or download button in the top rightClick open in desktopChoose the path for where you want and click CloneMore information can be found athttps://help.github.com/en/desktop/contributing-to-projects/cloning-a-repository-from-github-to-github-desktopDownload Zip FileDownload this GitHub repositoryExtract the zip archiveCopy/ move to the desired locationCommunity FilesLicenceMIT License Copyright (c) FredHappyface (See theLICENSEfor more information.)ChangelogSee theChangelogfor more information.Code of ConductOnline communities include people from many backgrounds. TheProjectcontributors are committed to providing a friendly, safe and welcoming environment for all. Please see theCode of Conductfor more information.ContributingContributions are welcome, please see theContributing Guidelinesfor more information.SecurityThank you for improving the security of the project, please see theSecurity Policyfor more information.SupportThank you for using this project, I hope it is of use to you. Please be aware that those involved with the project often do so for fun along with other commitments (such as work, family, etc). Please see theSupport Policyfor more information.RationaleThe rationale acts as a guide to various processes regarding projects such as the versioning scheme and the programming styles used. Please see theRationalefor more information.
ansitom
UNKNOWN
ansiwrap
ansiwrapwraps text, like the standardtextwrapmodule. But it also correctly wraps text that contains ANSI control sequences that colorize or style text.Wheretextwrapis fooled by the raw string length of those control codes,ansiwrapis not; it understands that however much those codes affect color and display style, they have no logical length.The API mirrors thewrap,fill, andshortenfunctions oftextwrap. For example:from __future__ import print_function from colors import * # ansicolors on PyPI from ansiwrap import * s = ' '.join([red('this string'), blue('is going on a bit long'), green('and may need to be'), color('shortened a bit', fg='purple')]) print('-- original string --') print(s) print('-- now filled --') print(fill(s, 20)) print('-- now shortened / truncated --') print(shorten(s, 20, placeholder='...'))It also exports several other functions:ansilen(giving the effective length of a string, ignoring ANSI control codes)ansi_terminate_lines(propagates control codes though a list of strings/lines and terminates each line.)strip_color(removes ANSI control codes from a string)See also the encloseddemo.py.
ansiwrap-hotoffthehamster
ansiwrapwraps text, like the standardtextwrapmodule. But it also correctly wraps text that contains ANSI control sequences that colorize or style text.Wheretextwrapis fooled by the raw string length of those control codes,ansiwrapis not; it understands that however much those codes affect color and display style, they have no logical length.The API mirrors thewrap,fill, andshortenfunctions oftextwrap. For example:from __future__ import print_function from colors import * # ansicolors on PyPI from ansiwrap import * s = ' '.join([red('this string'), blue('is going on a bit long'), green('and may need to be'), color('shortened a bit', fg='purple')]) print('-- original string --') print(s) print('-- now filled --') print(fill(s, 20)) print('-- now shortened / truncated --') print(shorten(s, 20, placeholder='...'))It also exports several other functions:ansilen(giving the effective length of a string, ignoring ANSI control codes)ansi_terminate_lines(propagates control codes though a list of strings/lines and terminates each line.)strip_color(removes ANSI control codes from a string)See also the encloseddemo.py.
anslapi
anslapiA python3 module for creating a simple API with AWS Lambda and API Gateway.Installpython3-mpipinstallanslapiConfigurationCreate an api gateway with the methods that are needed, and set up authentication, schemas, etc. as wished. Create a Lambda function and configure our function as the target for each method. Use Lambda proxy mode.Usage examplefromanslapiimportAPIHandlerdefget_user(userid):return"[email protected]"defadd(event):importjsonresult={"status":"FAIL"}j=json.loads(event["body"])if"userid"inj:result["response"]=cls.get_user(j["userid"])result["status"]="SUCCESS"return(200,result)else:result["reason"]="Invalid request"return(400,result)deflambda_handler(event,context):ah=APIHandler()ah.add_handler('/add','POST',Actions.add)response=ah.handle(event)returnresponse
ansprogen
A project generator tools for easy create project skeleton.
ans.protocol.amk
Python client for ans.protocol.amk built on 13:48:43 on 18 September 2023ยฉ 2022 ANSYS, Inc.This software is published only for use by ANSYS, Inc. and its subsidiaries (collectively โ€œAnsysโ€).Publication of this software does not transfer any rights to any person outside of Ansys.You may not use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the software for any purpose.
ans-pycli
ans-pycliQuickly build CLI for your own python projects with lightweight moduleHow to Installpippipinstallans-pyclipoetrypoetryaddans-pycli
ans-python
No description available on PyPI.
ansq
ansq - Async NSQWritten with native Asyncio NSQ packageInstallationpython -m pip install ansqOverviewReaderโ€” high-level class for building consumers withnsqlookupdsupportWriterโ€” high-level producer class supporting async publishing of messages tonsqdover the TCP protocolNSQConnectionโ€” low-level class representing a TCP connection tonsqd:full TCP wrapperone connection forsubandpubself-healing: when the connection is lost, reconnects, sends identify and auth commands, subscribes to previous topic/channelFeaturesSUBPUBDiscoveryBackoffTLSDeflateSnappySamplingAUTHUsageConsumerA simple consumer reads messages from "example_topic" and prints them to stdout.importasyncioimportansqasyncdefmain():reader=awaitansq.create_reader(topic="example_topic",channel="example_channel",)asyncformessageinreader.messages():print(f"Message:{message.body}")awaitmessage.fin()awaitreader.close()if__name__=="__main__":asyncio.run(main())ProducerA simple producer sends a "Hello, world!" message to "example_topic".importasyncioimportansqasyncdefmain():writer=awaitansq.create_writer()awaitwriter.pub(topic="example_topic",message="Hello, world!",)awaitwriter.close()if__name__=="__main__":asyncio.run(main())ContributingCreate and activate a development virtual environment.python-mvenvvenvsourcevenv/bin/activateInstallansqin editable mode and its testing dependencies.python-mpipinstall-e.[testing]Run tests.pytest
ansqlite
ansqliteA python3 module to assist in small sqlite3 database use cases.Installpython3-mpipinstallansqliteUsagefromansqliteimportDatabase,Datatype,PrimaryKeyTypetablename='tablename'db=Database(database_path='/path/to/database/file.db',schemas={tablename:[{"name":"timestamp","datatype":Datatype.INTEGER,"primary_key":PrimaryKeyType.Descending,},{"name":"value","datatype":Datatype.REAL,},],'othertablename':[{"name":"hash","datatype":Datatype.TEXT,"primary_key":PrimaryKeyType.Ascending,},{"name":"text","datatype":Datatype.TEXT,},],})db.insert_data(table_name=tablename,data=[{'timestamp':1699304400,'value':4.496},{'timestamp':1699300800,'value':6.812},{'timestamp':1699297200,'value':7.847},{'timestamp':1699293600,'value':9.548}])db.execute_and_commit(sql=f'UPDATE{tablename}SET value=1.00 WHERE timestamp=1699300800;',errmsg='Failed to set value')rows=db.execute_and_fetchall(sql=f'SELECT * FROM{tablename}where timestamp >= 1699297200 and timestamp < 1699304400 limit 10;',errmsg='Failed to retrieve data')print(rows)
anssdk
PY-ANS-SDKA python sdk to resolve .algo names and perform name operations on ANS .algo names.DocumentationInstall Packagepippip3 install anssdkImportfrom anssdk.ans import ANSSetupalgod_client = "" # set up your algodV2 client algod_indexer = "" # set up your algod indexer #indexer is not required if the intention is to only resolve .algo names, but it is required to view the names owned by an algorand wallet address #indexer and client must point to mainnet sdk = ANS(algod_client, algod_indexer)Resolve .algo nameResolve .algo name to get the address of the owner. The owner of the account is authorized to manage the domain including setting properties and transfername = "ans.algo" owner = sdk.name(name).get_owner() print(owner)Get value propertyThe value property is set by the owner to return a different address when resolving the domain names.name = "ans.algo" value_property = sdk.name(name).get_value() print(value_property)Get content propertyThe content property is set by the user to host a website on web3 infrastructure. This is expected to be either a Skylink content ID or an IPFS content IDname = "ans.algo" content = sdk.name(name).get_content() print(content)Get text recordReturn text record (socials, avatar etc) set by the owner.name = "ans.algo" key = "discord" record = sdk.name(name).get_text(key) print(record)Get domain informationReturn the entire domain information for the given domains.name = "ans.algo" information = sdk.name(name).get_all_information() print(information)Register a new namePrepare name registration transactionsname_to_register = "" #.algo name to register address = "" # owner's algorand wallet address period = 0 # duration of registration try: name_registration_txns = sdk.name(name_to_register).register(address, period) # Returns a tuple of size two # name_registration_txns[0] includes the array of transactions # name_registration_txns[1] has the logic sig if(len(name_registration_txns[0]) == 2): # Lsig account previous opted in (name expired) # Sign both transactions # Send all to network elif(len(name_registration_txns[0]) == 4): # name_registration_txns[2] must be signed by the sdk # Sign name_registration_txns index 0,1,3 # Submit transactions as a group signed_group_txns = [] txns = [ signed_group_txns[0], signed_group_txns[1], signed_group_txns[2], # must be signed by the sdk signed_group_txns[3] ] # send to network except: passUpdate Name (Set name properties)This method returns transactions to set the social media handles of a domain nametry: name = "" #.algo name address = "" # owner's algorand address edited_handles = { 'discord': '', 'github': '' } update_name_property_txns = sdk.name(name).update(address, edited_handles) # Returns an array of transactions # Sign each and send to network except: passRenew NameRetrieve transactions to renew a name. The ANS registry currently supports renewal only by the owner hence the transactions will fail if the input address is not the current owner of the name.try: name = "" # .algo name owner = "" # owner address period = 0 # period for renewal name_renewal_txns = sdk.name(name).renew(owner, period) # Returns an array of transactions # Sign each and send to network except: passInitiate transferThis method returns a transaction to initiate name transfer. The owner is required to set the price for transfer and the recipient's algorand account address.try: name = "" # .algo name to initiate transfer owner = "" # current owner new_owner = "" # new owner's address price = 0 # price at which the seller is willing to sell the name name_transfer_transaction = sdk.name(name).init_transfer( owner, new_owner, price) # Returns a transaction to be signed by `owner` # Sign and send to network except: passAccept transferRetrieve the transactions to complete the transfer by providing the current owner's address, the transfer recipient's address, and the price set by the ownertry: name = "" # .algo name to accept transfer owner = "" # current owner new_owner = "" # new owner's address price = 0 # price set in the previous transaction accept_name_transfer_txns = sdk.name(name).accept_transfer( new_owner, owner, price) # Returns an array of transactions to be signed by `newOwner` # Sign each and send to network except: passGet domains owned by an addressReturns domains owned by an algorand addressaddress="" # provide an algorand address here socials=True # return socials along with domain information metadata=True # return metadata along with domain information limit=1 #limit the number of domains to retrieve domains = sdk.address(address).get_names(socials, metadata, limit) print(domains)Get default domainIf configured, this method returns the default domain set by an address. If not configured, this method returns the most recently purchased domain by an addressaddress="" # provide an algorand address here default_domain = sdk.address(address).get_default_domain() print(default_domain)
anstu-sign-up
ๅฎ‰็ง‘ๅกซๆŠฅ่‡ชๅŠจๅŒ–่„šๆœฌๅกซๆŠฅ่ฟ‡็จ‹่‡ชๅŠจๅŒ–๏ผŒ้€‚็”จไบŽๅฎ‰ๅพฝ็ง‘ๆŠ€ๅญฆ้™ขๆŸๅกซๆŠฅ็ณป็ปŸ๏ผŒๆ‘†่„ฑ่ขซ็ญๅง”ๅ‚ฌๅกซๆŠฅ็š„ๅฐดๅฐฌ๏ผŒไปฅ้€ ็ฆๅŠณ่‹ฆๅคงไผ—ๅ…่ฎธ่‡ชๅฎšไน‰ๅกซๆŠฅไฟกๆฏๆ”ฏๆŒๅคšไบบๅกซๆŠฅ๏ผˆ้œ€่ฆ็›ธๅบ”้…็ฝฎๆ–‡ไปถ๏ผ‰ๆ”ฏๆŒWindows, LinuxไธŽไบบๅทฅๅกซๅ†™ๅ‡ ็ปๆ— ๅทฎๅˆซไฝฟ็”จๆ–นๆณ•Windows็”จๆˆทๆไพ›ไธ€้”ฎ่„šๆœฌ, ๅ…ทไฝ“ไฝฟ็”จๆ–นๆณ•ๅ‚่งhelp.txtๆ–‡ไปถLinux็”จๆˆท้œ€่‡ชๅปบpython่™šๆ‹Ÿ็Žฏๅขƒ๏ผˆๆไพ›requirements.txt๏ผ‰ไฝฟ็”จ้กป็Ÿฅไปฅไธ‹ๆƒ…ๅ†ตๅ‡ไธ่ดŸ่ดฃๅ› ไฝฟ็”จๆœฌ่„šๆœฌ่€Œ่ขซๆŸฅๅค„ๅนถ่ฎฐ่ฟ‡ๅ› ไฝฟ็”จๆœฌ่„šๆœฌ่€Œ้€ ๆˆๅกซๅ†™ๅ†…ๅฎนไธไธบๅฎž้™…ไฟกๆฏ๏ผˆๆœ‰bugๅœจissueๆๅ‡บ๏ผ‰ๅ› ไฝฟ็”จๆœฌ่„šๆœฌ่€Œ้€ ๆˆๆœฌไบบๅฎž่ดจๆ€ง็š„ๆŸๅคฑๆœฌ่„šๆœฌๅˆถไฝœๆœฌๆ„ไป…ไธบๆ–นไพฟๆ—ฅๅธธ็”Ÿๆดป๏ผŒๅ‡ๅฐ‘้‡ๅคๅทฅไฝœ็š„็›ฎ็š„ใ€‚ไธชไบบๅบ”ๅœจไฟ่ฏ่‡ช่บซ่บซไฝ“ๅฅๅบท็š„ๆƒ…ๅ†ตไธ‹ไฝฟ็”จ๏ผŒ็งฏๆž้…ๅˆๅญฆๆ ก้˜ฒ็–ซๅทฅไฝœ๏ผŒๆ—ถๅˆปๆฃ€ๆŸฅ่‡ช่บซ่บซไฝ“ๆƒ…ๅ†ต๏ผŒ่‹ฅๅฏŸ่ง‰ๅˆฐๅผ‚ๅธธๆƒ…ๅ†ต๏ผŒ่ฏทๅ…ณๅœ่ฏฅ่„šๆœฌ๏ผŒ่ฎค็œŸๅกซๅ†™ๅกซๆŠฅไฟกๆฏๅนถไธŠๆŠฅใ€‚่ฏทไฝŽ่ฐƒไฝฟ็”จ
ansunit
No description available on PyPI.
ansurr
ANSURR | Accuracy of NMR Structures Using RCI and Rigidity v2.1.2ANSURR uses backbone chemical shifts to validate the accuracy of NMR protein structures as described herehttps://www.nature.com/articles/s41467-020-20177-1. This repository contains the code required to install and run ANSURR on a Linux or a Mac. ANSURR v1.2.1 is also available on NMRbox (https://nmrbox.org/software/ansurr). Please let me know if you have any issues.InstallationANSURR v2 is installed using pip (https://packaging.python.org/en/latest/tutorials/installing-packages/).pip install ansurrYou will also need java in order to re-reference chemical shifts using PANAV (recommended) (https://java.com/en/download/help/download_options.html).Running ANSURRANSURR requires two input files, a NMR protein structure in PDB format and a shifts file in NEF format or NMR Star v3 format. To re-reference chemical shifts using PANAV before running ANSURR (recommended):ansurr -p xxxx.pdb -s xxxx.nef -rTo run without re-referencing chemical shifts:ansurr -p xxxx.pdb -s xxxx.nefOptions:-pinput pdb file-sinput shifts file-hprint the help message-linclude free ligands when computing flexibility.-monly output the ANSURR scores in a text file-ninclude non-standard residues when computing flexibility. Note that RCI will not be calculated for non-standard residues and so they will not be used to compute validation scores. Regardless, including non-standard residues is a good idea to avoid breaks in the protein structure which would otherwise make those regions too floppy.-ocombine chains into a single structure when calculating flexibility. This is useful when the structure is an oligomer as oligomerisation will often result in changes in flexibility.-rre-reference chemical shifts using PANAV before running ANSURR (recommended).-qsuppress output to the terminal-vprint version details-wcompute ANSURR scores for the well-defined residues identified by CYRANGE. These scores are computed using a separate benchmark for well-defined residues.OutputA directory called<yourpdbfile>_<yourshiftfile>is made to save the output generated. This directory will be overwritten if you run ANSURR again with input files with the same names as before. This directory contains two directories calledANSURR_outputandother_output.ANSURR_outputcontains:scores.out- a text file with the validation scores for each model<yourpdbfile>_<yourshiftfile>_ansurr.nef- a NEF file with most output generated by ANSURR<yourpdbfile>_<yourshiftfile>.png- a graphical summary of the validation scores for each modelout/- text files for each model which detail the following for each residue: flexibility predicted by RCI, flexibility predicted by FIRST, secondary structure according to DSSP, well-defined regions of the ensemble according to CYRANGE, backbone chemical shift completeness and which atom types have chemical shift datafigs/- plots of protein flexibility predicted by RCI (blue) and FIRST (orange) for each model. Alpha helical and beta sheet secondary structure indicated by red and blue dots, respectively. Green dots indicate regions that are well-defined according to CYRANGE. Black crosses indicate residues with no chemical shift data (not used to compute validation scores).other_outputcontains output from various programs run as part of ANSURR:PANAV/- re-referenced chemical shiftsRCI/- flexibility predicted from chemical shifts using RCIextracted_pdbs/- PDB files for each model extracted from the NMR structureDSSP/- secondary structure for each model according to the program DSSPFIRST/- flexibility predicted for each model using FIRSTHelpContact Nick Fowler (njfowler.com) for support, queries or suggestions.Known IssuesThe Mac version of ANSURR gives slightly different ANSURR scores (mean difference of 1.2) for 0.5% of models tested so far. 99.5% of models have identical ANSURR scores between the linux/Mac versions.Secondary structure is currently not computed in the Mac version.AcknowledgementsRandom Coil Index (RCI) | Berjanskii, M.V. & Wishart, D.S. A simple method to predict protein flexibility using secondary chemical shifts. Journal of the American Chemical Society 127, 14970-14971 (2005).Floppy Inclusions and Rigid Substructure Topography (FIRST) | Jacobs, D.J., Rader, A.J., Kuhn, L.A. & Thorpe, M.F. Protein flexibility predictions using graph theory. Proteins-Structure Function and Genetics 44, 150-165 (2001).Probabilistic Approach to NMR Assignment and Validation (PANAV) | Bowei Wang, Yunjun Wang and David S. Wishart. "A probabilistic approach for validating protein NMR chemical shift assignments". Journal of Biomolecular NMR. Volume 47, Number 2 / June 2010: 85-99DSSP | A series of PDB related databases for everyday needs. Wouter G Touw, Coos Baakman, Jon Black, Tim AH te Beek, E Krieger, Robbie P Joosten, Gert Vriend. Nucleic Acids Research 2015 January; 43(Database issue): D364-D368. | Dictionary of protein secondary structure: pattern recognition of hydrogen-bonded and geometrical features. Kabsch W, Sander C, Biopolymers. 1983 22 2577-2637.adjustText - automatic label placement for matplotlib |https://github.com/Phlya/adjustTextCYRANGE | D.K. Kirchner & P. Gรผntert, BMC Bioinformatics 2011, 12 170.