Test whether a Windows drive is connected, and connect it.
Project description
Installation
pip install driveconnect
Or:
pip install git+https:\\github.com\gwangjinkim\driveconnect.git
Or:
pipenv install git+https:\\github.com\gwangjinkim\driveconnect.git#egg=driveconnect
Or:
poetry add driveconnect # version number: driveconnect==0.1.8
Or (from github repo):
poetry add git+ssh://git@github.com/gwangjinkim/driveconnect.git#main
Usage
import driveconnect as dcn
import pycryptaes as pca
import logging
# instanciate encryptor
ca = pca.AES()
# set logger
logging.basicConfig(filename='mylog.log', filemode='a', level=logging.DEBUG)
# test, wether a drive e.g. 'G:' is connected:
dcn.is_drive_connected(drive_letter='G') # it works also with "G:"
## False
# in the terminal/console/REPL to save some typing:
home = "C:/Users/myusername"
p = lambda x: f"{home}/{x}" # helper function
args = (p(".key"), p(".user"), p(".pass"))
# set the credentials for the server in local folders
ca.generate_key_user_pass(*args)
# connect to the server
# leading '\\' can be left out in server address and the 'M:' as well as 'M' both work
dcn.connect_drive('G:', '\\serveraddress\folder', co=co)
# or for connections where no credentials are needed:
dcn.connect_drive('G:', '\\serveraddress\folder', _print=True)
# or with logger
dcn.connect_drive('G:', '\\serveraddress\folder', log=logging, level="info", _print=True)
# disconnect from the server
dcn.disconnect_drive('G:', _print=True)
# or with logger:
dcn.disconnect_drive('G:', log=logging, level="info")
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
driveconnect-0.1.13.tar.gz
(3.8 kB
view hashes)
Built Distribution
Close
Hashes for driveconnect-0.1.13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbf4e019d63808107e5f903fd0e1a805cf63a5d8dcd16f2032b1f2346806aaf4 |
|
MD5 | f1b4019b96bcdc8674eaf04e8bea6d35 |
|
BLAKE2b-256 | 66eebf352290294e4997d62630147fa8e472b3a57c79c13004a32a9abfab5c5e |