talklib 2.0.1__tar.gz → 2.0.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: talklib
3
- Version: 2.0.1
3
+ Version: 2.0.3
4
4
  Summary: A package to automate processing of shows/segments airing on the TL
5
5
  Author-email: Ben Weddle <ben.weddle@gmail.com>
6
6
  Maintainer-email: Ben Weddle <ben.weddle@gmail.com>
@@ -104,7 +104,7 @@ Requires-Dist: zipp==3.17.0
104
104
  [![GitHub issues](https://img.shields.io/github/issues/Nashville-Public-Library/talklib.png)](https://github.com/Nashville-Public-Library/talklib/issues)
105
105
  [![last-commit](https://img.shields.io/github/last-commit/Nashville-Public-Library/talklib)](https://github.com/Nashville-Public-Library/talklib/commits/master)
106
106
 
107
- ## A package to automate processing of shows/segments airing on the TL
107
+ ## A package to automate processing TL shows/segments and podcasts
108
108
 
109
109
  [Skip to Examples](#examples)
110
110
 
@@ -124,7 +124,9 @@ Use this module to process the following types of shows/segments:
124
124
  ## Requirements
125
125
 
126
126
  ### -[Python](https://www.python.org/downloads/)
127
- Use Python 3.10 or higher
127
+ Use Python 3.10 or higher.
128
+
129
+ Make sure to select "add to PATH" during installation.
128
130
 
129
131
  ### -[FFmpeg](https://www.ffmpeg.org/download.html#build-windows)
130
132
  You need Windows binaries for both FFmpeg & FFprobe installed on the PC and added to the PATH:
@@ -143,11 +145,13 @@ See [below](#disable-twilio) for how to disable Twilio.
143
145
  ### -Environment Variables
144
146
  This package uses Environment Variables to help with portability and keep sensitive info separated. The entire list of these is in the `ev.py` file. Make sure to set **all** of these on your PC(s). They are case-sensitive!
145
147
 
146
- **ONCE YOU SET/CHANGE/UPDATE ENVIRONMENT VARIABLES ON YOUR PC, YOU NEED TO RESTART WIREREADY**
148
+ > **ONCE YOU SET/CHANGE/UPDATE ENVIRONMENT VARIABLES ON YOUR PC, YOU NEED TO RESTART WIREREADY**
147
149
 
148
150
  ---
149
151
  ## Installation
150
152
 
153
+ AFTER you have all of the above [requirements](#requirements), inst
154
+
151
155
  - Open a terminal/command prompt
152
156
  - ````bash
153
157
  pip install talklib
@@ -169,7 +173,10 @@ Before we begin, a general note:
169
173
  - Instead, we tell WR to run a Batch script (`.bat` file) which in turn will run the Python script (`.py` file).
170
174
  - Ensure the Batch & Python scripts are in the same directory.
171
175
  - A sample `.bat` file (`Example.bat`) is included in the [misc](https://github.com/Nashville-Public-Library/misc/tree/main/talklib_examples) repo.
172
- - PLEASE NOTE: the `.bat` file will run all Python files in the folder. This is one reason it is best to separate your Python files into different folders, each with its own `.bat` file.
176
+ - Download this file and place it in the same folder as your Python file.
177
+ - Right-Click the file and click `Unblock` so that it can be executed.
178
+ - It is a best practice to give the `.bat` and `.py` files the same name, though it is not necessary.
179
+ - PLEASE NOTE: the `.bat` file will run **all** Python files in the folder. This is one reason it is best to separate your Python files into different folders, each with its own `.bat` file.
173
180
 
174
181
  Here is what an example directory structure should look like:
175
182
  ````
@@ -178,7 +185,7 @@ D:\wireready
178
185
  -WP.bat
179
186
  -WP.py
180
187
  ````
181
- You would tell WR to run the `WP.bat` file, which would run the `WP.py` file.
188
+ You would schedule WR to run the `WP.bat` file, which would run the `WP.py` file.
182
189
 
183
190
  ----
184
191
 
@@ -340,34 +347,6 @@ optional
340
347
  - be careful with this!
341
348
  - default is 21
342
349
 
343
- ### Notes about formatting:
344
-
345
- if you're new to Python, here're some reminders
346
-
347
- ### string
348
- - must be enclosed in quotes (single or double; Python doesn't care)
349
-
350
- ### boolean
351
- - either True or False
352
- - do not enclose in quotes
353
- - must be capitalized
354
- - correct: True
355
- - incorrect: true
356
-
357
- ### number
358
- - in our case, these can be either type int OR float, meaning either whole numbers OR decimal numbers are allowed
359
- - OK: 5
360
- - also OK: 5.4
361
- - do not enclose in quotes
362
-
363
- ## Methods
364
-
365
- `run()`
366
-
367
- required
368
- - executes the script with the attributes you set
369
- - should be the last line in your script
370
-
371
350
  ## Examples<a id="examples"></a>
372
351
  ### RSS Example
373
352
 
@@ -4,7 +4,7 @@
4
4
  [![GitHub issues](https://img.shields.io/github/issues/Nashville-Public-Library/talklib.png)](https://github.com/Nashville-Public-Library/talklib/issues)
5
5
  [![last-commit](https://img.shields.io/github/last-commit/Nashville-Public-Library/talklib)](https://github.com/Nashville-Public-Library/talklib/commits/master)
6
6
 
7
- ## A package to automate processing of shows/segments airing on the TL
7
+ ## A package to automate processing TL shows/segments and podcasts
8
8
 
9
9
  [Skip to Examples](#examples)
10
10
 
@@ -24,7 +24,9 @@ Use this module to process the following types of shows/segments:
24
24
  ## Requirements
25
25
 
26
26
  ### -[Python](https://www.python.org/downloads/)
27
- Use Python 3.10 or higher
27
+ Use Python 3.10 or higher.
28
+
29
+ Make sure to select "add to PATH" during installation.
28
30
 
29
31
  ### -[FFmpeg](https://www.ffmpeg.org/download.html#build-windows)
30
32
  You need Windows binaries for both FFmpeg & FFprobe installed on the PC and added to the PATH:
@@ -43,11 +45,13 @@ See [below](#disable-twilio) for how to disable Twilio.
43
45
  ### -Environment Variables
44
46
  This package uses Environment Variables to help with portability and keep sensitive info separated. The entire list of these is in the `ev.py` file. Make sure to set **all** of these on your PC(s). They are case-sensitive!
45
47
 
46
- **ONCE YOU SET/CHANGE/UPDATE ENVIRONMENT VARIABLES ON YOUR PC, YOU NEED TO RESTART WIREREADY**
48
+ > **ONCE YOU SET/CHANGE/UPDATE ENVIRONMENT VARIABLES ON YOUR PC, YOU NEED TO RESTART WIREREADY**
47
49
 
48
50
  ---
49
51
  ## Installation
50
52
 
53
+ AFTER you have all of the above [requirements](#requirements), inst
54
+
51
55
  - Open a terminal/command prompt
52
56
  - ````bash
53
57
  pip install talklib
@@ -69,7 +73,10 @@ Before we begin, a general note:
69
73
  - Instead, we tell WR to run a Batch script (`.bat` file) which in turn will run the Python script (`.py` file).
70
74
  - Ensure the Batch & Python scripts are in the same directory.
71
75
  - A sample `.bat` file (`Example.bat`) is included in the [misc](https://github.com/Nashville-Public-Library/misc/tree/main/talklib_examples) repo.
72
- - PLEASE NOTE: the `.bat` file will run all Python files in the folder. This is one reason it is best to separate your Python files into different folders, each with its own `.bat` file.
76
+ - Download this file and place it in the same folder as your Python file.
77
+ - Right-Click the file and click `Unblock` so that it can be executed.
78
+ - It is a best practice to give the `.bat` and `.py` files the same name, though it is not necessary.
79
+ - PLEASE NOTE: the `.bat` file will run **all** Python files in the folder. This is one reason it is best to separate your Python files into different folders, each with its own `.bat` file.
73
80
 
74
81
  Here is what an example directory structure should look like:
75
82
  ````
@@ -78,7 +85,7 @@ D:\wireready
78
85
  -WP.bat
79
86
  -WP.py
80
87
  ````
81
- You would tell WR to run the `WP.bat` file, which would run the `WP.py` file.
88
+ You would schedule WR to run the `WP.bat` file, which would run the `WP.py` file.
82
89
 
83
90
  ----
84
91
 
@@ -240,34 +247,6 @@ optional
240
247
  - be careful with this!
241
248
  - default is 21
242
249
 
243
- ### Notes about formatting:
244
-
245
- if you're new to Python, here're some reminders
246
-
247
- ### string
248
- - must be enclosed in quotes (single or double; Python doesn't care)
249
-
250
- ### boolean
251
- - either True or False
252
- - do not enclose in quotes
253
- - must be capitalized
254
- - correct: True
255
- - incorrect: true
256
-
257
- ### number
258
- - in our case, these can be either type int OR float, meaning either whole numbers OR decimal numbers are allowed
259
- - OK: 5
260
- - also OK: 5.4
261
- - do not enclose in quotes
262
-
263
- ## Methods
264
-
265
- `run()`
266
-
267
- required
268
- - executes the script with the attributes you set
269
- - should be the last line in your script
270
-
271
250
  ## Examples<a id="examples"></a>
272
251
  ### RSS Example
273
252
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "talklib"
3
- version = "2.0.1"
3
+ version = "2.0.3"
4
4
  description = "A package to automate processing of shows/segments airing on the TL"
5
5
  readme = "README.md"
6
6
  license = {file = "LICENSE.txt"}
@@ -54,9 +54,9 @@ class SSH(BaseModel):
54
54
  self.check_folder_exists(folder=folder)
55
55
 
56
56
  try:
57
- self.notifications.prep_syslog(message=f"Attempting to upload '{file}' to {folder}/")
58
- self.connection.put(local=file, remote=f"talkinglibrary/shows/{folder}", preserve_mode=False)
59
- self.notifications.prep_syslog(message=f"Successfully uploaded '{file}' to {folder}/")
57
+ self.notifications.prep_syslog(message=f"Attempting to upload '{file}' to {folder}/ on server")
58
+ self.connection.put(local=file, remote=f"shows/{folder}", preserve_mode=False)
59
+ self.notifications.prep_syslog(message=f"Successfully uploaded '{file}' to {folder}/ on server")
60
60
  return
61
61
  except (FileNotFoundError, Exception) as e:
62
62
  to_send = f"unable to upload '{file}': {e}"
@@ -65,8 +65,8 @@ class SSH(BaseModel):
65
65
 
66
66
  def download_file(self, file: str, folder: str) -> None:
67
67
  try:
68
- self.notifications.prep_syslog(message=f"Attempting to download '{file}' from {folder}/")
69
- self.connection.get(remote=f"talkinglibrary/shows/{folder}/{file}")
68
+ self.notifications.prep_syslog(message=f"Attempting to download '{file}' from {folder}/ on server")
69
+ self.connection.get(remote=f"shows/{folder}/{file}")
70
70
  self.notifications.prep_syslog(message=f"Successfully downloaded '{file}' to {os.getcwd()}")
71
71
  return file
72
72
  except Exception as e:
@@ -76,9 +76,9 @@ class SSH(BaseModel):
76
76
 
77
77
  def delete_file(self, file: str, folder: str) -> None:
78
78
  try:
79
- self.notifications.prep_syslog(message=f"Attempting to delete '{file}' from {folder}/")
80
- self.connection.sftp().remove(f"talkinglibrary/shows/{folder}/{file}")
81
- self.notifications.prep_syslog(message=f"Successfully deleted '{file}' from {folder}/")
79
+ self.notifications.prep_syslog(message=f"Attempting to delete '{file}' from {folder}/ on server")
80
+ self.connection.sftp().remove(f"shows/{folder}/{file}")
81
+ self.notifications.prep_syslog(message=f"Successfully deleted '{file}' from {folder}/ on server")
82
82
  return
83
83
  except (Exception, FileNotFoundError) as e:
84
84
  self.notifications.send_notifications(
@@ -87,7 +87,7 @@ class SSH(BaseModel):
87
87
 
88
88
  def get_folders(self) -> list:
89
89
  ret_val: list = []
90
- result: Result = self.connection.run("cd talkinglibrary/shows && ls", hide=True)
90
+ result: Result = self.connection.run("cd shows && ls", hide=True)
91
91
  result_stdout:str = result.stdout
92
92
  folders: list[str] = result_stdout.rsplit("\n")
93
93
  for folder in folders:
@@ -97,7 +97,7 @@ class SSH(BaseModel):
97
97
 
98
98
  def get_files_from_folder(self, folder: str) -> list:
99
99
  ret_val: list = []
100
- result: Result = self.connection.run(f"cd talkinglibrary/shows/{folder} && ls", hide=True)
100
+ result: Result = self.connection.run(f"cd shows/{folder} && ls", hide=True)
101
101
  result_stdout:str = result.stdout
102
102
  files: list[str] = result_stdout.rsplit("\n")
103
103
  for file in files:
@@ -107,7 +107,7 @@ class SSH(BaseModel):
107
107
 
108
108
  def get_all_files(self) -> list:
109
109
  ret_val: list = []
110
- result: Result = self.connection.run("cd talkinglibrary/shows && ls -R", hide=True)
110
+ result: Result = self.connection.run("cd shows && ls -R", hide=True)
111
111
  result_stdout:str = result.stdout
112
112
  files: list[str] = result_stdout.rsplit("\n")
113
113
  for file in files:
@@ -119,7 +119,7 @@ class SSH(BaseModel):
119
119
  self.notifications.prep_syslog(message=f"checking if {folder}/ exists on server...")
120
120
  folders = self.get_folders()
121
121
  if folder.lower() in folders:
122
- self.notifications.prep_syslog(message=f"{folder}/ exists!")
122
+ self.notifications.prep_syslog(message=f"{folder}/ exists on server!")
123
123
  return True
124
124
 
125
125
  to_send = f"cannot find folder titled: {folder}/ on server"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: talklib
3
- Version: 2.0.1
3
+ Version: 2.0.3
4
4
  Summary: A package to automate processing of shows/segments airing on the TL
5
5
  Author-email: Ben Weddle <ben.weddle@gmail.com>
6
6
  Maintainer-email: Ben Weddle <ben.weddle@gmail.com>
@@ -104,7 +104,7 @@ Requires-Dist: zipp==3.17.0
104
104
  [![GitHub issues](https://img.shields.io/github/issues/Nashville-Public-Library/talklib.png)](https://github.com/Nashville-Public-Library/talklib/issues)
105
105
  [![last-commit](https://img.shields.io/github/last-commit/Nashville-Public-Library/talklib)](https://github.com/Nashville-Public-Library/talklib/commits/master)
106
106
 
107
- ## A package to automate processing of shows/segments airing on the TL
107
+ ## A package to automate processing TL shows/segments and podcasts
108
108
 
109
109
  [Skip to Examples](#examples)
110
110
 
@@ -124,7 +124,9 @@ Use this module to process the following types of shows/segments:
124
124
  ## Requirements
125
125
 
126
126
  ### -[Python](https://www.python.org/downloads/)
127
- Use Python 3.10 or higher
127
+ Use Python 3.10 or higher.
128
+
129
+ Make sure to select "add to PATH" during installation.
128
130
 
129
131
  ### -[FFmpeg](https://www.ffmpeg.org/download.html#build-windows)
130
132
  You need Windows binaries for both FFmpeg & FFprobe installed on the PC and added to the PATH:
@@ -143,11 +145,13 @@ See [below](#disable-twilio) for how to disable Twilio.
143
145
  ### -Environment Variables
144
146
  This package uses Environment Variables to help with portability and keep sensitive info separated. The entire list of these is in the `ev.py` file. Make sure to set **all** of these on your PC(s). They are case-sensitive!
145
147
 
146
- **ONCE YOU SET/CHANGE/UPDATE ENVIRONMENT VARIABLES ON YOUR PC, YOU NEED TO RESTART WIREREADY**
148
+ > **ONCE YOU SET/CHANGE/UPDATE ENVIRONMENT VARIABLES ON YOUR PC, YOU NEED TO RESTART WIREREADY**
147
149
 
148
150
  ---
149
151
  ## Installation
150
152
 
153
+ AFTER you have all of the above [requirements](#requirements), inst
154
+
151
155
  - Open a terminal/command prompt
152
156
  - ````bash
153
157
  pip install talklib
@@ -169,7 +173,10 @@ Before we begin, a general note:
169
173
  - Instead, we tell WR to run a Batch script (`.bat` file) which in turn will run the Python script (`.py` file).
170
174
  - Ensure the Batch & Python scripts are in the same directory.
171
175
  - A sample `.bat` file (`Example.bat`) is included in the [misc](https://github.com/Nashville-Public-Library/misc/tree/main/talklib_examples) repo.
172
- - PLEASE NOTE: the `.bat` file will run all Python files in the folder. This is one reason it is best to separate your Python files into different folders, each with its own `.bat` file.
176
+ - Download this file and place it in the same folder as your Python file.
177
+ - Right-Click the file and click `Unblock` so that it can be executed.
178
+ - It is a best practice to give the `.bat` and `.py` files the same name, though it is not necessary.
179
+ - PLEASE NOTE: the `.bat` file will run **all** Python files in the folder. This is one reason it is best to separate your Python files into different folders, each with its own `.bat` file.
173
180
 
174
181
  Here is what an example directory structure should look like:
175
182
  ````
@@ -178,7 +185,7 @@ D:\wireready
178
185
  -WP.bat
179
186
  -WP.py
180
187
  ````
181
- You would tell WR to run the `WP.bat` file, which would run the `WP.py` file.
188
+ You would schedule WR to run the `WP.bat` file, which would run the `WP.py` file.
182
189
 
183
190
  ----
184
191
 
@@ -340,34 +347,6 @@ optional
340
347
  - be careful with this!
341
348
  - default is 21
342
349
 
343
- ### Notes about formatting:
344
-
345
- if you're new to Python, here're some reminders
346
-
347
- ### string
348
- - must be enclosed in quotes (single or double; Python doesn't care)
349
-
350
- ### boolean
351
- - either True or False
352
- - do not enclose in quotes
353
- - must be capitalized
354
- - correct: True
355
- - incorrect: true
356
-
357
- ### number
358
- - in our case, these can be either type int OR float, meaning either whole numbers OR decimal numbers are allowed
359
- - OK: 5
360
- - also OK: 5.4
361
- - do not enclose in quotes
362
-
363
- ## Methods
364
-
365
- `run()`
366
-
367
- required
368
- - executes the script with the attributes you set
369
- - should be the last line in your script
370
-
371
350
  ## Examples<a id="examples"></a>
372
351
  ### RSS Example
373
352
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes