semvec/pypi-packages huggingface dataset:
simplefetch 0.1.0
Simplified Paramiko Library to Fetch Data From MultiVendor Network Devices
Requires Python: >=3.6

# simplefetch
Simplified Paramiko Library to Fetch Data From MultiVendor Network Devices

# Supports

* Cisco IOS
* Cisco IOS-XE
* Cisco NX-OS
* Cisco IOS-XR
* Juniper Junos
* Huawei VRP5/8
* ZTE ZXROS 
* DELL OS10
* Ericsson IPOS

Script is based on paramiko and catches device-prompt to understand the output is fetched, thus there is a strong possibility that script could work with many network devices from different vendors, i  only do not have the chance to test.

# Accepted Network Device OS Types
* huawei-vrp
* cisco-ios
* cisco-iosxe
* cisco-iosxr
* cisco-nxos
* junos
* dell-os10
* zte-zxros 
* ericsson-ipos
* nokia-sros

For the above device type pagination commands (e.g. "terminal length 0") send automatically. 

# Simple Example
```
import simplefetch

test_router = simplefetch.SSH("192.168.1.1", port=22,user="admin", passwd="secret", network_os="cisco-ios")
print (test_router.fetchdata("show version"))
test_router.disconnect()
```

# Example with Logging 

```
import simplefetch,logging
logging.basicConfig(filename='info.log', filemode='a', level=logging.INFO,
                    format='%(asctime)s [%(name)s] %(levelname)s (%(threadName)-10s): %(message)s')
					
test_router = simplefetch.SSH("192.168.1.1" port=22, user="admin", passwd="secret", network_os="cisco-ios")
print (test_router.fetchdata("show version"))
test_router.disconnect() 
```
# Example with Multithreading Python3
```
# -*- coding: utf-8 -*-
import simplefetch
import logging, time
from threading import Thread
timestr = time.strftime("%Y%m%d-%H%M%S")
log_filename="connection_logs"+str(timestr)+".txt"

#================== Logging
logging.basicConfig(filename=log_filename, filemode='a', level=logging.INFO,
                    format='%(asctime)s [%(name)s] %(levelname)s (%(threadName)-10s): %(message)s')
		    
#==================USER, PASS, ROUTER_LIST==============
username= "username"
password="password"
router_list=["router_name1","192.168.1.1"]

#================== MEMORY check function for huawei devices
def get_memory_usages(router_name):
	try:
		connection = simplefetch.SSH(user=username, passwd=password, network_os="huawei-vrp")
		try:
			display_health_raw= connection.fetchdata("display startup")
			print (router_name)
			print (display_health_raw)
		except:
			logging.warning ("could not get output of command from %s",router_name)
			connection.disconnect()
	except:
		logging.warning ("connection unsuccessful to %s",router_name)
		
#================== multithread part 
import concurrent.futures 
with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor: 
	for items in router_list:
		executor.submit(get_memory_usages,items) 
executor.shutdown(wait=True)
```
decode-server-flask 1.0.0
Flask middleware for Decode Auth

# Decode Server Flask

A middleware for Flask for authenticating requests from [Decode Auth Server](https://decodeauth.com/).


## Installing

Install using pip:

```sh
pip install decode_server_flask
```

## A simple example

To integrate your Flask app with Decode Auth you only need to import the middleware and register it with the app.
A simple example on how to do it:

```python
from flask import Flask
from decode_server_flask import decode_server_flask
from os import environ

app = Flask(__name__)

# To setup the middleware, you need to get the Decode's RSA Public Key.
# You can read the key from an ENV variable.
decode_public_key = os.environ["DECODE_PUBLIC_KEY"]

# Or you can read the key from file.
public_key_file = open("decode-key.pub", "r")
decode_public_key = public_key_file.read()

# Then just pass the key to the middleware
app.wsgi_app = decode_server_flask(app.wsgi_app, decode_public_key)


# Now all the routes are protected!
# To call them you need a valid JWT which only the Decode Auth server can generate.
@app.route("/me", methods=["GET"])
def me_api():
    return {
        "user": "Paul Muad'Dib",
        "affiliation": "Fremen",
        "house": "Atreides",
    }
```


## Developing

To install Decode Server Flask, alogn with the tools you need to develop and run tests, run the following in your virtualenv:

```sh
pip install -e .[dev]
```

## Pushing updates

```sh
# First build the redistributable
python setup.py bdist_wheel sdist

# and then push it to pypi.org
twine upload dist/*
```