Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Pyfilesystem2 over SMB using pysmb

Project description

Source PyPI Travis Codecov Codacy Format License

Requirements

pyfilesystem2 PyPI fs Source fs License fs
six PyPI six Source six License six
pysmb PyPI pysmb Source pysmb License pysmb

Installation

Install directly from PyPI, using pip

pip install fs.smbfs

Usage

Opener

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.

The following parameters can be passed as URL parameters: timeout, name-port, direct-tcp.

Constructor

import fs.smbfs
smb_fs = fs.smbfs.SMBFS(
    host, username='guest', passwd='', timeout=15,
    port=139, name_port=137, direct_tcp=False
)

with each argument explained below:

host
the name or IP address of the SMB server
user
the username to connect with, defaults to ‘guest’ for anonymous connection.
passwd
an optional password, defaults to ‘’ for anonymous connection.
timeout
the timeout, in seconds, for NetBIOS and TCP requests.
port
the port the SMB server is listening on.
naming_port
the port the NetBIOS naming service is listening on
direct_tcp
set to True if the server is accessible directly 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).

Feedback

Found a bug ? Have an enhancement request ? Head over to the GitHub issue tracker of the project if you need to report or ask something. If you are filling in on a bug, please include as much information as you can about the issue, and try to recreate the same bug in a simple, easily reproductible situation.

See also

  • fs, the core Pyfilesystem2 library
  • fs.archive, enhanced archive filesystems for Pyfilesystem2
  • fs.sshfs, Pyfilesystem2 over SSH using paramiko

Project details


Release history Release notifications

This version
History Node

0.3.3

History Node

0.3.2

History Node

0.3.1

History Node

0.3.0

History Node

0.2.4

History Node

0.2.3

History Node

0.2.2

History Node

0.2.1

History Node

0.2.0

History Node

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
fs.smbfs-0.3.3-py2.py3-none-any.whl (15.5 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Feb 24, 2018
fs.smbfs-0.3.3.tar.gz (11.6 kB) Copy SHA256 hash SHA256 Source None Feb 24, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page