Saravanan666/pypi-org huggingface dataset:
Package: nornir-network-backup
nornir-network-backupA nornir playbook to store network equipment config backups and relevant "show" command facts.You can define the main configuration backup command or fact commands per device type.This backup tool uses Netmiko for connecting to devices and Textfsm to parse facts.Requirements:nornirnornir-utilsnornir-netmikoThis is a beta version. Extra options and documentation will follow soon !Functiontake the running config of 1 or more hosts and save it to a filethe file will be overwritten every dayoptional take a diff of the previous file and save it as wellrun "show" commands and save each output to a separate file in a facts folderfiles will be overwritten every timeall files in a single facts foldersave a file with meta data: info about the last backup time, commands executed, failed + successful commandsthe commands may change depending on vendor or hw type or softwarecommands which can be parsed with textfsm will be saved as YAML, if they cannot be parsed then it will be .config text filesit should be possible to run the backup file for a single hostor run agains a complete filegenerate an overall report with:last run timehosts succeededhosts failedhosts skippedOutput folder structure|- backup folder
|  |-- facts folder
|  |-- reports folderCommandsnnbbackup
nnbbackup-single-hostUsagepoetryrunnnbbackup-single-hostEnvironment VariablesUsed by nornir_utils.plugins.inventory.load_credentials transform function, in case username + password are not defined by CLINORNIR_USERNAMENORNIR_PASSWORD
Package: nornir-progressbar
nornir_progressbarnornir_progressbar is a runner plugin for turning your task executions into
nice-looking tqdm progress bars. It can be used with both of Nornir's
standard Runners:SerialRunnerThreadedRunnerInstallationInstall thepackagefrom PyPi with pip.pip install nornir-progressbarUsageBe sure to register the RunnerPlugin within your Nornir script before using it.To use the Multi-threaded execution, register the class ThreadedProgressBarRunner:fromnornir_progressbar.plugins.runnersimportThreadedProgressBarRunnerfromnornir.core.plugins.runnersimportRunnersPluginRegisterfromnornirimportInitNornirRunnersPluginRegister.register("ProgressBar",ThreadedProgressBarRunner)nr=InitNornir(config_file='sample_config.yaml')For serial executions, use SerialProgressBarRunner instead:fromnornir_progressbar.plugins.runnersimportSerialProgressBarRunnerfromnornir.core.plugins.runnersimportRunnersPluginRegisterfromnornirimportInitNornirRunnersPluginRegister.register("ProgressBar",SerialProgressBarRunner)nr=InitNornir(config_file='sample_config.yaml')Your nornir config file should point to the new runner plugin:---inventory:plugin:SimpleInventoryoptions:host_file:"inventory/hosts.yaml"group_file:"inventory/groups.yaml"defaults_file:"inventory/defaults.yaml"runner:plugin:ProgressBaroptions:num_workers:10And that's it! Whenever you execute a nornir task, a progress bar will appear for
each host in the inventory, incrementing for each host that finishes execution.
The name of the task being run is used as the progress bar's description.ConfigurationThe plugin uses tqdm to render the progress bar. Keyword arguments can be passed directly
to the tqdm() call by setting them under the plugin options. Adding a 'desc' argument will
provide a custom description to the progress bar. Consulttqdm's documentationfor all the keyword arguments supported.---inventory:plugin:SimpleInventoryoptions:host_file:"inventory/hosts.yaml"group_file:"inventory/groups.yaml"defaults_file:"inventory/defaults.yaml"runner:plugin:ProgressBaroptions:num_workers:10desc:Toto tataleave:FalseThe above configuration yields a single progress bar with description "Toto tata"
that gets replaced every time a task finishes execution.Use theasciioption to get an ASCII progress bar.---inventory:plugin:SimpleInventoryoptions:host_file:"inventory/hosts.yaml"group_file:"inventory/groups.yaml"defaults_file:"inventory/defaults.yaml"runner:plugin:ProgressBaroptions:num_workers:10ascii:True
Package: nornir-pygnmi
pyGNMI plugin for NornirThis repository contains GNMI plugin for Nornir leveraging pyGNMI libraryUsageSample code example:# Modulesfromnornir.init_nornirimportInitNornirfromnornir_utils.plugins.functionsimportprint_resultfromnornir_pygnmi.tasksimportgnmi_capabilities# StaticsNORNIR_CONFIG="./config.yaml"# Bodyif__name__=="__main__":# Initialise Nornirnrn=InitNornir(config_file=NORNIR_CONFIG)# Run taskresult1=nrn.run(task=gnmi_capabilities)print_result(result1)Installationpipinstallnornir_pygnmiDev LogRelease0.2.0:Added newgnmi_subscribe()task. It supports all telemery subscription modes; however, from the Nornir perspective, the most benefitial is theoncemode. In this case, the task will return a list containing output of all requested data. Such an approach is recommended by some vendors (e.g., Nokia) to collect huge data sets, which are not fitting into a singleGet()RPC implemented innornir_pygnmiasgnmi_get()task.Release0.1.2:Addedexamples.Modified communication of the task’s status for all tasks.Release0.1.1:Addedgnmi_set()task.Added placeholders for not-implemented methods.Release0.1.0:First alpha release.(c)2022, karneliuk.com
Package: nornir-pyntc
nornir-pyntcOverviewA pyntc plugin for Nornir.DocumentationFull web-based HTML documentation for this library can be found over on theNornir-Pyntc Docswebsite:User Guide- Overview, Using the library, Getting Started.Administrator Guide- How to Install, Configure, Upgrade, or Uninstall the library.Developer Guide- Extending the library, Code Reference, Contribution Guide.Release Notes / Changelog.Frequently Asked Questions.Contributing to the DocsAll the Markdown source for the library documentation can be found under thedocsfolder in this repository. For simple edits, a Markdown capable editor is sufficient - clone the repository and edit away.If you need to view the fully generated documentation site, you can build it withmkdocs. A container hosting the docs will be started using the invoke commands (details in theDevelopment Environment Guide) onhttp://localhost:8001. As your changes are saved, the live docs will be automatically reloaded.Any PRs with fixes or improvements are very welcome!QuestionsFor any questions or comments, please check theFAQfirst. Feel free to also swing by theNetwork to Code Slack(channel#networktocode), sign uphereif you don't have an account.
Package: nornir-rich
nornir_richInstallpipinstallnornir-richUsageFeaturesPrint functionsprint_resultprint_failed_hostsprint_inventoryProcessorsprogressbarPrint examplefromnornir_rich.functionsimportprint_resultresults=nr.run(task=hello_world)print_result(results)print_result(results,vars=["diff","result","name","exception","severity_level"])Progress bar examplefromtimeimportsleepfromnornir_rich.progress_barimportRichProgressBardefrandom_sleep(task:Task)->Result:delay=randrange(10)sleep(delay)returnResult(host=task.host,result=f"{delay}seconds delay")nr_with_processors=nr.with_processors([RichProgressBar()])result=nr_with_processors.run(task=random_sleep)ImagesPrint InventoryPrint ResultProgress BarMoreexamples
Package: nornir-scrapli
nornir_scrapliDocumentation:https://scrapli.github.io/nornir_scrapliSource Code:https://github.com/scrapli/nornir_scrapliExamples:https://github.com/scrapli/nornir_scrapli/tree/master/examplesnornir_scrapli -- scrapli's plugin for nornirKey Features:Easy: It's easy to get going with scrapli -- check out the documentation and example links above, and you'll be
connecting to devices in no time.Fast: Do you like to go fast? Of course you do! All of scrapli is built with speed in mind, but if you really
feel the need for speed, check out thessh2transport plugin to take it to the next level!Great Developer Experience: scrapli has great editor support thanks to being fully typed; that plus thorough
docs make developing with scrapli a breeze.Well Tested: Perhaps out of paranoia, but regardless of the reason, scrapli has lots of tests! Unit tests
cover the basics, regularly ran functional tests connect to virtual routers to ensure that everything works IRL!Pluggable: scrapli provides a pluggable transport system -- don't like the currently available transports,
simply extend the base classes and add your own! Need additional device support? Create a simple "platform" inscrapli_communityto easily add new device support!But wait, there's more!: Have NETCONF devices in your environment, but love the speed and simplicity of
scrapli? You're in luck! Check outscrapli_netconf!RequirementsMacOS or *nix1, Python 3.7+1Although many parts of scraplidorun on Windows, Windows is not officially supportedInstallationpip install nornir-scrapliSee thedocsfor other installation methods/details.A simple ExamplefromnornirimportInitNornirfromnornir_scrapli.tasksimportsend_commandnr=InitNornir(config_file="nornir_data/config.yaml")command_results=nr.run(task=send_command,command="show version")print("send_command result:")print(command_results["iosxe-1"].result)
Package: nornir-sql
Welcome to Nornir SQL inventory plugin!If your device inventory is spread across SQL database tables and you would like to use it as Nornir inventory, you may
consider looking on this project.Documentation:https://viktorkertesz.github.io/nornir_sqlSource code:https://github.com/viktorkertesz/nornir_sqlInstallationInstall frompypipip install nornir-sqlInstall fromGitHUBpip install git+https://github.com/viktorkertesz/nornir_sql.gitSimple examplefromnornirimportInitNornirhost_query="""\SELECT ciname AS name, ip AS hostname, region AS 'data.region'
FROM host_table
WHERE status='deployed'
"""inventory={"plugin":"SQLInventory","options":{"sql_connection":"sqlite:///inventory.db","hosts_query":hosts_query,}}nr=InitNornir(inventory=inventory)print(nr.inventory.hosts['FW1']['region'])ConfigurationThis plugin is based on SQLAlchemy and supports all databases that SQLAlchemy does.These configuration options can be used:sql_connection: SQLAlchemy connection stringFormat:{driver}://[user]:[password]@{DBSERVER}/{DATABASE}SQLite example:sqlite:///somedb.dbMSSQL example with domain user authentication:mssql+pymssql://ACME\\dbuser:verysecret@DBSRV1/INFRAhosts_query: Select statement which returns hosts inventory elements.The select must return at minimum thenamefield!Field names must match the expected Nornir inventory elements!Thedataelements are expected indata.[element]format. Quotation is needed!Ifgroupsare returned, the followinggroups_queryalso has to be specified!groups_query: Select statement which returns groups inventory elements.Same requirements apply as for thehosts_query.groups_file: path to a YAML file containing group definitions. Format is that same as used bySimpleInventoryThis parameter is ignored whengroups_queryorgroupsare specified!Using this parameter requires group assignments outside of this plugin!
Checkdocs!groups: group definition as dict. Same restrictions and features apply as by usinggroups_file!Ignored whengroups_queryis specified!Using this parameter requires group assignments outside of this plugin!
Checkdocs!defaults: This is a dictionary which contains inventory elements. These will be applied to hosts.
Package: nornir-task-duration
nornir_task_durationNornir processor pluginwhich calculates the duration of each taskThis plugin will store the duration of each task as attribute in the Nornir result objects.Installationpipinstallnornir_task_durationPurposeThe plugin will add new class attributes to the Nornir results:total_duration: this is the total duration to process all hosts, this is added to the AggregatedResulthost_duration: this is the totoal duration to process a single host, this is added to the host's MultiResultduration: this is added to the Result of each taskUsageThis example shows the usage of the processor and an example how to print a summary. You may want to use the duration during the task execution or in another print plugin.fromnornirimportInitNornirfromnornir.core.taskimportResult,Task,AggregatedResult,MultiResultfromnornir_task_duration.plugins.processorsimportTaskDurationnr=InitNornir(inventory={"plugin":"YAMLInventory","options":{"host_file":"tests/inventory/hosts.yaml","group_file":"tests/inventory/groups.yaml","defaults_file":"tests/inventory/defaults.yaml",},})nrp=nr.with_processors([TaskDuration()])results=nrp.run(task=some_task)defprinter(res):iftype(res)isAggregatedResult:print(f"TOTAL DURATION:{res.total_duration}")forrinres:print(f" * HOST:{r}- DURATION:{res[r].host_duration}")printer(res[r])iftype(res)isMultiResult:forrinres:printer(r)iftype(res)isResult:print(f"  -- task:{res.name}- duration:{res.duration}")printer(results)# TOTAL DURATION:12#   * HOST:test1 - DURATION:9#      -- task:ROOT-TASK - duration:9#      -- task:task1 - duration:4#      -- task:task2 - duration:3#      -- task:task2 - duration:3#   * HOST:test2 - DURATION:12#      -- task:ROOT-TASK - duration:12#      -- task:task1 - duration:4#      -- task:task2 - duration:3#      -- task:task2 - duration:3
Package: norris-cli
norris-cliA simple cli app that brightens up your day with Chuck Norris jokes fromchucknorris.io.InstallationInstall norris-cli from PyPipip install norris-cliHow to use$ norris-cli --help
Usage: norris-cli [OPTIONS]

  If I had a nickel for every Chuck Norris joke out there...

Options:
  -c, --category [dev|movie|food|celebrity|science|sport|political|religion|animal|history|music|travel|career|money|fashion]
  --help                          Show this message and exit.Get a random joke$ norris-cli
Chuck Norris doesn't call the wrong number. You answer the wrong phone.Specify a categoryYou can see all available categories by runningnorris-cli --help$ norris-cli -c dev
Chuck Norris can't test for equality because he has no equal.$ norris-cli -c food
Chuck Norris' favorite cereal is Kellogg's Nails 'N' Gravel.Enjoy!
Package: norsecorpus
Corpus of Old Norse textsThis package provides Old Norse texts with code to parse them.SourcesAlthough texts are in public domain, we must thank those who digitalised and normalized these texts.Heimskringla.noInstallation$pipinstall--user--upgradenorsecorpusHow to usenorsecorpusimportnorsecorpus.readerasncravailable_texts=ncr.get_available_texts()filename="volsunga.xml"volsunga=ncr.read_tei_words(available_texts["volsunga.xml"])You have now the Völsunga saga.
Package: norske-kommuner
Norske KommunerPydantic models on Norwegian municipalities (Norske kommuner).fromnorske_kommunerimportkommuner,get_kommune_by_nr#  Loop over all kommuner:forkommuneinkommuner.values():print(kommune)#  Get kommunenummerprint(kommuner['Stavanger'].kommunenummer)# 1103# Can also get kommune by kommunenrprint(get_kommune_by_nr('1103'))#  Stavanger# Each kommune is a pydantic model and have pydantic functionality like exporting to jsonprint(kommuner['Stavanger'].json())Last line will output{"avgrensningsboks":{"coordinates":[[[5.49903313381,58.884658939559],[5.49903313381,59.312103554166],[6.131310442607,59.312103554166],[6.131310442607,58.884658939559],[5.49903313381,58.884658939559]]],"crs":{"properties":{"name":"EPSG:4258"},"type":"name"},"type":"Polygon"},"fylkesnavn":"Rogaland","fylkesnummer":"11","gyldigeNavn":[{"navn":"Stavanger","prioritet":1,"sprak":"Norwegian"},{"navn":null,"prioritet":2,"sprak":null},{"navn":null,"prioritet":3,"sprak":null}],"kommunenavn":"Stavanger","kommunenavnNorsk":"Stavanger","kommunenummer":"1103","punktIOmrade":{"coordinates":[5.712610778068,59.10201328799],"crs":{"properties":{"name":"EPSG:4258"},"type":"name"},"type":"Point"},"samiskForvaltningsomrade":false}Uses data and models from "Åpent API fra Kartverket for administrative enheter"
Package: norskfaktura
Norsk FakturaNorsk Faktura er et fakturaprogram for moderne linux, laget for å tilfredsstille norske juridiske krav. Det lagrer all informasjon lokalt på maskinen.InstallasjonEksterne avhengigheterDet er en del pakker som må installeres på systemet via vanlig pakkebehandling før man kan installere programmet via pipKjør denne kommandoen på fedora:sudo dnf install gcc gobject-introspection gobject-introspection-devel cairo cairo-devel pkgconf-pkg-config python3-devel cairo-gobject-develKjør denne kommandoen på ubuntu 18.04:sudo apt install gcc python3-pip gobject-introspection python3-gi libcairo-dev pkgconf python3-dev libcairo-gobject2 libgirepository1.0-devref:https://stackoverflow.com/a/54795222Installering via pipNår de eksterne avhengighetene er tilfredsstilt kan man installere programmet via pip:pip install --user norskfakturaFor ubuntu 18.04:pip3 install --user norskfakturaDette gir systemet kommandoennorskfakturasom kan brukes til å starte programmet via terminalen, men sannsynligvis vil man gjerne ha et menyikon man kan trykke på. Da kan man kjøre:nf-install-iconsog man vil etterpå (under Gnome) finne programmet blant alle andre programmer som 'Norsk Faktura'.Oppdatering av programmetMan kan installere eventuelle oppdateringer også v.h.a pip:pip install --user norskfaktura --upgradeKonfigureringNår du starter applikasjonen for første gang vil du få opp et vindu for å legge inn informasjon om ditt firma/organisasjon. Om du oppdager at du har gjort noe feil, eller vil gjøre endringer senere, kan du komme tilbake til denne skjermen ved å klikke på "instillinger"-knappen nede i høyre hjørne av hovedbildet.Foruten første fakturanummer og filstiene til pdf-mappen og logoen, så skriver du inn resten av feltene slik du vil at de skal vises på fakturaen.Lage og bruke et virtuelt miljø for utvikling:Merk: det er per nå ikke mulig å utvikle programmet fra innsiden av et virtuelt miljø på en enkel måte, se #10Lager et virtuelt mmiljø under mappen 'env':python -m venv envAktivere det virtuelle miljøet:source env/bin/activateDeaktivere det virtuelle miljøet:deactivateHvordan kjøre testerDet er enda ikke skrevet tester, men når de kommer på plass kjører man dem med denne kommandoen:python3 setup.py test
Package: norsourceparser
norsourceparserSimple conversion of Norsource-xml files into tc-xml.Free software: MIT licenseDocumentation:https://norsourceparser.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2017-01-10)First release on PyPI.
Package: nort
Nort (WIP)What do I actually want?generate entries automaticallygrepableautomatically copy undone tasks from yesterday into todayinstallationpip3 install nortCommandsnort new test --tags tag1 tag2 tag3generates note called test with tags tag1, tag2 and tag3nort searchTODOnort view [name]opens note in viewer, specified in settingsnort listlists all notesnort list --tags tag1lists notes that have tag1OptionsOptions can be configured in the~/.nort.yamlfile (or~/.config/nort/nort.yaml)viewer: which viewer gets used bynort vieweditor: which editor gets used bynort newandnort editnort_path: where to save the notesHow to store meta infobooks can be own folders, or just tagslike notable:Notebooks/peter/corresponds to a notebook called peter---signifies start and end of metadatainside---yaml is used---
tags: [Notebooks/Work/protocols/2021/April, Todo]title: Work on 16.04.2021---Template FileTODOimplement nort newimplement nort list
Package: nortax
NorTaxCopyright 2023Lewi Lie UbergReleased under the MIT licenseA Python client for the tax table portion of the Norwegian tax authority's API.UsageImport the Tax class from the nortax packageCreate a Tax objectPrint the representation of the Tax objectChange some attributes of the Tax objectPrint the Tax objectGet specific values from the Tax objectGet the URLGet the tax tableGet the income typeGet the periodGet the yearGet the gross incomeGet the tax deductionGet the net incomeGet the whole tableUsageUsing the NorTax package is easy. Just follow the steps below.Import the Tax class from the nortax packagePython REPL:fromnortaximportTaxCreate a Tax objectPython REPL:tax=Tax(gross_income=25000,tax_table="7100",income_type="Pension",period="2 weeks",year=2022,)Print the representation of the Tax objectPython REPL:print(repr(tax))Output:Tax(gross_income=25000,tax_table='7100',income_type='Pension',period='2 weeks',year=2022)Change some attributes of the Tax objectPython REPL:tax.gross_income=65625tax.tax_table="7107"tax.income_type="Wage"tax.period="Monthly"tax.year=2023Print the Tax objectPython REPL:print(tax)Output:URL:str=https://api-tabellkort.app.skatteetaten.no/?valgtTabell=7107&valgtInntektType=Lonn&valgtPeriode=PERIODE_1_MAANED&valgtLonn=65625&visHeleTabellen=True&valgtAar=2023&hentHeleTabellen=True
Taxtable:valid_tables=7107Incometype:income_type=Wage
Period:period=Monthly
Year:int=2023Grossincome:int=65625Taxdeduction:int=21078Netincome:int=44547Returnwholetable:{'5600':0,'5700':1,'5800':30}...Get specific values from the Tax objectGet the URLPython REPL:print(f"URL:{tax.url}")Output:URL:https://api-tabellkort.app.skatteetaten.no/?valgtTabell=7107&valgtInntektType=Lonn&valgtPeriode=PERIODE_1_MAANED&valgtLonn=65625&visHeleTabellen=True&valgtAar=2023&hentHeleTabellen=TrueGet the tax tableIt is possible to get specific values from the Tax object. They are all available as attributes. Except for the whole table, which is available as a method.Python REPL:print(f"Tax table:{tax.tax_table}")Output:Taxtable:7107Get the income typePython REPL:print(f"Income type:{tax.income_type}")Output:Incometype:WageGet the periodPython REPL:print(f"Period:{tax.period}")Output:Period:MonthlyGet the yearPython REPL:print(f"Year:{tax.year}")Output:Year:2023Get the gross incomePython REPL:print(f"Gross income:{tax.gross_income}")Output:Grossincome:65625Get the tax deductionPython REPL:print(f"Tax deduction:{tax.deduction}")Output:Taxdeduction:21078Get the net incomePython REPL:print(f"Net income:{tax.net_income}")Output:Netincome:44547Get the whole tablePython REPL:print(f"Return whole table:{json.dumps(tax.get_whole_table(),indent=4)}")Output:Returnwholetable:{"5600":0,"5700":1,"5800":30,"5900":59,"6000":88,"6100":116,"6200":145,"6300":174,"6400":203,"6500":...
Package: north101-pimoroni-pico-stubs
Pimoroni Pico MicroPython StubsThis repository contains type stubs that help you write code for Pimoroni Pico MicroPython's many built-in modules.Type stubs include details about the constants, functions, classes and methods available in each module, and what arguments they accept.VSCode SetupRequired ExtensionsYou must install the VSCode Python extension and additionally Pylance to support type hints.To install extensions, press Ctrl+Shift+P or Cmd+Shift+P and in the pop-up box type "Extensions" and select "Extensions: Install Extensions".A search box should open on the left-hand side of your editor, find and install the following::link:Python:link:PylanceVSCode SettingsTo open VSCode settings press Ctrl+Shift+P or Cmd+Shift+P and in the pop-up box type "Settings" and choose "Preferences: Open Workspace Settings (JSON)".If the file is empty you can go right ahead and add the lines below:{"python.languageServer":"Pylance","python.analysis.typeCheckingMode":"basic","python.analysis.diagnosticSeverityOverrides":{"reportMissingModuleSource":"none"},"python.analysis.typeshedPaths":["./typings/",],}MicroPython stubsTo get MicroPython type hints you'll need to install the following package into the./typingsdirectory of your project.If the terminal is not open press Ctrl+Shift+P or Cmd+Shift+P and in the pop-up box type "Terminal" and select "Terminal: Create New Terminal (In Active Workspace)".Finally in the terminal run the following command:pipinstallpimoroni-pico-stubs--target./typings--no-user