Git Product home page Git Product logo

fs.smbfs's Introduction

fs.smbfs star me

Source PyPI Actions Codecov Codacy License Versions Format GitHub issues Downloads Changelog

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. Otherwise, if NetBIOS is not available, a new SMB connection can be established by using the IPv4 address and giving the hostname with the hostname URL parameter.

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

Constructor

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

with each argument explained below:

  • host: either the host name (not the FQDN) of the SMB server, its IP address, or both in a tuple. If either the IP address or the host name is not given, NETBIOS is queried to get the missing data.
  • user: the username to connect with, defaults to "guest" for anonymous connection.
  • passwd: an optional password to connect with, defaults to "" for anonymous connection.
  • timeout: the timeout, in seconds, for NetBIOS and TCP requests.
  • port: the port the SMB server is listening on.
  • name_port: the port the NetBIOS naming service is listening on.
  • direct_tcp: set to True if the server is accessible directly through TCP, leave as False for maximum compatibility.
  • domain: the network domain to connect with, i.e. the workgroup on Windows. Usually safe to leave as empty string, the default.

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 reproducible situation.

Credits

fs.smbfs is developped and maintainted by:

The following people contributed to fs.sshfs:

This project obviously owes a lot to the PyFilesystem2 project and all its contributors.

See also

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

fs.smbfs's People

Contributors

althonos avatar frafra avatar josiahwitheford avatar mivade avatar telamonian avatar vegemash avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.