Pyfilesystem2 over SMB using pysmb
Project description
Requirements
pyfilesystem2 |
|||
six |
|||
pysmb |
Installation
Install directly from PyPI, using pip
pip install fs.smbfs
Usage
Use fs.open_fs to open a filesystem with an SMB FS URL:
import fs
smb_fs = fs.open_fs('smb://username:password@SAMBAHOSTNAME:port/share')
The opener can use either an IPv4 address or a NetBIOS hostname, using the NetBIOS name service to find the other token.
Otherwise, use the SMBFS constructor:
import fs.smbfs
smb_fs = fs.smbfs.SMBFS(
host, # name or IP of the SMB server host
username, # username to connect with,
# defaults to 'guest' for anonymous connection
passwd, # password to connect with,
# defaults to '' for anonymous connection
timeout, # timeout for NetBIOS and TCP requests
port, # Port the SMB server is listening on
name_port, # Port the NetBIOS naming service is listening on
direct_tcp, # True if the Server is directly accessible through TCP,
# leave to False for maximum compatibility
)
Once created, the SMBFS filesystem behaves like any other filesystem (see the Pyfilesystem2 documentation), except if it was open in the root directory of the server, in which case the root directory of the SMBFS instance will be read-only (since SMB clients cannot create new shares).
See also
fs, the core Pyfilesystem2 library
fs.archive, enhanced archive filesystems for Pyfilesystem2
fs.proxy, miscellaneous proxy filesystems for Pyfilesystem2
fs.sshfs, Pyfilesystem2 over SSH using paramiko
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
Hashes for fs.smbfs-0.2.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83fd4134d8ccf3d6430304e19c7da787a19cac859c281d66587d7ccf24c4b42b |
|
MD5 | 1faeb5c9641a564b26c9f792bebdac32 |
|
BLAKE2b-256 | 8a5e68f7ff8e48bdc0cf638cea7044e92f08b16fe46b4efbd96f5f706872db20 |