scrapli_scp
Project description
Welcome to Scrapli SCP project!
This project is about to add smart SCP capability to Scrapli based connections. By smart, I mean various checks before and after the file copy to ensure the file copy is possible and successful.
These are the checks done by default:
checksum
existence of file at destination (also with hash)
available space at destination
scp enablement on device (and tries to turn it on if needed)
restore configuration after transfer if it was changed
check MD5 after transfer
Requirements
scrapli, scrapli-community, asyncssh, aiofiles
Installation
$ pip install scrapli-scp
Simple example
You can find it in test folder but the main part:
async with AsyncScrapli(**device) as conn:
scp = AsyncSrapliSCP(conn)
result = await scp.file_transfer("put", src=filename, dst=".", force_scp_config=True)
print(result)
Progress bar example
from rich.progress import Progress
with Progress(refresh_per_second=100) as progress:
task = progress.add_task("Getting config...")
def progress_handler(srcpath: bytes, dstpath: bytes, copied: int, total: int): # arg signature is important!
progress.update(task, completed=copied, total=total, description=dstpath.decode())
async with AsyncScrapli(**device) as conn:
scp: AsyncSCPFortiOS = AsyncSrapliSCP(conn)
result = await scp.get_config(
filename=filename,
overwrite=True,
force_scp_config=True,
progress_handler=progress_handler
)
print(result)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file scrapli_scp-0.1.0.tar.gz.
File metadata
- Download URL: scrapli_scp-0.1.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8e08b5990e941d6f3bc8de6530ab71186136a3ccebac6e60adf4b8306242f2c
|
|
| MD5 |
998c20b4006cb9f40a42e7e48cb3ee22
|
|
| BLAKE2b-256 |
85b7234b7e32c802ad7c9d385dbe942eaac54a4ca5e43e5ec0bde550cede46fc
|
Provenance
The following attestation bundles were made for scrapli_scp-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on realvitya/scrapli_scp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scrapli_scp-0.1.0.tar.gz -
Subject digest:
d8e08b5990e941d6f3bc8de6530ab71186136a3ccebac6e60adf4b8306242f2c - Sigstore transparency entry: 962500877
- Sigstore integration time:
-
Permalink:
realvitya/scrapli_scp@7433547ff467f8a73a42db6980ec2fabb4e3a48e -
Branch / Tag:
refs/heads/master - Owner: https://github.com/realvitya
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7433547ff467f8a73a42db6980ec2fabb4e3a48e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file scrapli_scp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: scrapli_scp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9de4a64219096b914af2fafc55ed44933e355d4ee44961c1a9bcedec3ca3fa92
|
|
| MD5 |
299744c37a3791b4cc34816eb3c0062b
|
|
| BLAKE2b-256 |
daaca57616e1038d96aed91fbaf7f4fbcfef02946682f132259e7f6d38fe661f
|
Provenance
The following attestation bundles were made for scrapli_scp-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on realvitya/scrapli_scp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
scrapli_scp-0.1.0-py3-none-any.whl -
Subject digest:
9de4a64219096b914af2fafc55ed44933e355d4ee44961c1a9bcedec3ca3fa92 - Sigstore transparency entry: 962500879
- Sigstore integration time:
-
Permalink:
realvitya/scrapli_scp@7433547ff467f8a73a42db6980ec2fabb4e3a48e -
Branch / Tag:
refs/heads/master - Owner: https://github.com/realvitya
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@7433547ff467f8a73a42db6980ec2fabb4e3a48e -
Trigger Event:
workflow_dispatch
-
Statement type: