wcp-library 1.1.3__tar.gz → 1.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {wcp_library-1.1.3 → wcp_library-1.1.4}/PKG-INFO +1 -1
  2. {wcp_library-1.1.3 → wcp_library-1.1.4}/pyproject.toml +1 -1
  3. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/ftp/sftp.py +10 -6
  4. {wcp_library-1.1.3 → wcp_library-1.1.4}/README.md +0 -0
  5. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/__init__.py +0 -0
  6. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/async_credentials/__init__.py +0 -0
  7. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/async_credentials/api.py +0 -0
  8. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/async_credentials/oracle.py +0 -0
  9. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/async_credentials/postgres.py +0 -0
  10. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/async_sql/__init__.py +0 -0
  11. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/async_sql/oracle.py +0 -0
  12. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/async_sql/postgres.py +0 -0
  13. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/credentials/__init__.py +0 -0
  14. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/credentials/ftp.py +0 -0
  15. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/credentials/oracle.py +0 -0
  16. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/credentials/postgres.py +0 -0
  17. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/emailing.py +0 -0
  18. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/ftp/__init__.py +0 -0
  19. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/ftp/ftp.py +0 -0
  20. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/informatica.py +0 -0
  21. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/logging.py +0 -0
  22. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/sql/__init__.py +0 -0
  23. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/sql/oracle.py +0 -0
  24. {wcp_library-1.1.3 → wcp_library-1.1.4}/wcp_library/sql/postgres.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wcp-library
3
- Version: 1.1.3
3
+ Version: 1.1.4
4
4
  Summary: Common utilites for internal development at WCP
5
5
  Home-page: https://github.com/Whitecap-DNA/WCP-Library
6
6
  Author: Mitch-Petersen
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "wcp-library"
3
- version = "1.1.3"
3
+ version = "1.1.4"
4
4
  description = "Common utilites for internal development at WCP"
5
5
  authors = ["Mitch-Petersen <mitch.petersen@wcap.ca>"]
6
6
  readme = "README.md"
@@ -10,17 +10,21 @@ logger = logging.getLogger(__name__)
10
10
 
11
11
 
12
12
  class SFTP:
13
- def __init__(self, host: str, port: int=22):
14
- self.host: str = host
15
- self.port: int = port
16
- self._username: Optional[str] = None
17
- self._password: Optional[str] = None
13
+ def __init__(self, host: Optional[str]=None, port: Optional[int]=21, password_vault_dict: Optional[dict]=None):
14
+ self.host: str = host if not password_vault_dict else password_vault_dict['Host']
15
+ self.port: int = port if not password_vault_dict else password_vault_dict['Port']
16
+ self._username: Optional[str] = None if not password_vault_dict else password_vault_dict['UserName']
17
+ self._password: Optional[str] = None if not password_vault_dict else password_vault_dict['Password']
18
18
 
19
19
  self.ssh = paramiko.SSHClient()
20
20
  # AutoAddPolicy automatically adds the hostname and new host key to the local HostKeys object
21
21
  self.ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
22
22
 
23
- self.sftp_connection: Optional[paramiko.SFTP] = None
23
+ if not (self._username and self._password):
24
+ self.sftp_connection: Optional[paramiko.SFTP] = None
25
+ else:
26
+ self.ssh.connect(self.host, self.port, self._username, self._password)
27
+ self.sftp_connection = self.ssh.open_sftp()
24
28
 
25
29
  def login(self, username: str, password: str) -> None:
26
30
  """
File without changes