nbdevAuto 0.0.110__tar.gz → 0.0.119__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: nbdevAuto
3
- Version: 0.0.110
3
+ Version: 0.0.119
4
4
  Summary: automating nbdev
5
5
  Home-page: https://github.com/bthek1/nbdevAuto
6
6
  Author: Benedict Thekkel
@@ -17,8 +17,8 @@ Classifier: Programming Language :: Python :: 3.10
17
17
  Classifier: License :: OSI Approved :: Apache Software License
18
18
  Requires-Python: >=3.7
19
19
  Description-Content-Type: text/markdown
20
- Provides-Extra: dev
21
20
  License-File: LICENSE
21
+ Provides-Extra: dev
22
22
 
23
23
  # Nbdev Automation Library
24
24
 
@@ -0,0 +1 @@
1
+ __version__ = "0.0.119"
@@ -27,6 +27,8 @@ d = { 'settings': { 'branch': 'main',
27
27
  'nbdevAuto/functions.py'),
28
28
  'nbdevAuto.functions.download_search_images': ( 'functions.html#download_search_images',
29
29
  'nbdevAuto/functions.py'),
30
+ 'nbdevAuto.functions.graph': ('functions.html#graph', 'nbdevAuto/functions.py'),
31
+ 'nbdevAuto.functions.graph.__init__': ('functions.html#graph.__init__', 'nbdevAuto/functions.py'),
30
32
  'nbdevAuto.functions.kaggle_competition_download': ( 'functions.html#kaggle_competition_download',
31
33
  'nbdevAuto/functions.py'),
32
34
  'nbdevAuto.functions.kaggle_dataset_download': ( 'functions.html#kaggle_dataset_download',
@@ -3,7 +3,7 @@
3
3
  # %% auto 0
4
4
  __all__ = ['read_from_file', 'download_pic', 'create_searches_folder', 'download_search_image', 'download_search_images',
5
5
  'verify_pics', 'resize_pics', 'create_data_folder', 'classify_images', 'kaggle_competition_download',
6
- 'kaggle_dataset_download']
6
+ 'kaggle_dataset_download', 'graph']
7
7
 
8
8
  # %% ../nbs/00_Functions.ipynb 5
9
9
  #|code-fold: true
@@ -257,3 +257,45 @@ def kaggle_dataset_download(user:str,
257
257
  import zipfile,kaggle
258
258
  kaggle.api.dataset_download_files(dataset = f'{user}/{name}', path = path)
259
259
  zipfile.ZipFile(f'{path}/{name}.zip').extractall(path)
260
+
261
+ # %% ../nbs/00_Functions.ipynb 23
262
+ #|code-fold: true
263
+ from graphviz import Digraph
264
+
265
+ # %% ../nbs/00_Functions.ipynb 24
266
+ #|code-fold: true
267
+ class graph(Digraph):
268
+ def __init__(self, *args, **kwargs):
269
+ # Call the superclass's __init__ method using super() and pass all arguments
270
+ super().__init__(*args, **kwargs)
271
+ self.primary = '#fdfcdc'
272
+ self.secondary = '#fcbf49'
273
+ self.third = '#f77f00'
274
+ self.fourth = '#d62828'
275
+ self.fifth = '#003049'
276
+
277
+
278
+ self.graph_attr.update(style='rounded,filled',
279
+ rankdir='LR',
280
+ compound='true',
281
+ fillcolor=self.fourth,
282
+ fontcolor=self.fifth,
283
+ penwidth = '0',
284
+ fontname = "Helvetica,Arial,sans-serif")
285
+
286
+ self.node_attr.update(style='rounded,filled',
287
+ size='8,5', shape='box',
288
+ width='1.5',
289
+ fillcolor=self.secondary,
290
+ fontcolor=self.fifth,
291
+ penwidth = '0',
292
+ fontname = "Helvetica,Arial,sans-serif")
293
+
294
+ self.edge_attr.update(arrowhead='vee',
295
+ arrowsize='1',
296
+ color=self.fifth,
297
+ len='1.00',
298
+ fontname = "Helvetica,Arial,sans-serif",
299
+ penwidth='1')
300
+ self.graph_attr.update()
301
+
@@ -6,6 +6,11 @@ __all__ = ['PDFreader']
6
6
  # %% ../nbs/02_PDF_reader.ipynb 5
7
7
  #|code-fold: true
8
8
  class PDFreader:
9
+ ''' Function for reading and displaying pdf files
10
+ ex. path = './Data/<file>.pdf'
11
+ pdf = PDFreader(path, size = (10, 8))
12
+ pdf[0:5]
13
+ '''
9
14
  def __init__(self, path, size = (6, 4)):
10
15
  self.filepath = path
11
16
  self.images = self.display_pdf_slides()
@@ -14,7 +19,7 @@ class PDFreader:
14
19
 
15
20
 
16
21
  def __str__(self):
17
- return f'str: path:{self.filepath}, index:{self.index}, size:{self.size}, len:{len(self.images)}'
22
+ return f'--string--: path:"{self.filepath}" index:{self.index} size:{self.size} len:{len(self.images)}'
18
23
 
19
24
  def __repr__(self):
20
25
  return f'--Representation-- \r\npath:"{self.filepath}" \r\nindex:{self.index} \r\nsize:{self.size} \r\nlen:{len(self.images)}'
@@ -25,10 +30,12 @@ class PDFreader:
25
30
 
26
31
  @property
27
32
  def filepath(self):
33
+ 'return file path'
28
34
  return self._path
29
35
 
30
36
  @filepath.setter
31
37
  def filepath(self, value):
38
+ 'set the file path variable'
32
39
  import os
33
40
 
34
41
  if os.path.exists(value) == False:
@@ -37,15 +44,18 @@ class PDFreader:
37
44
 
38
45
  @property
39
46
  def length(self):
47
+ 'return file length'
40
48
  return len(self.images)
41
49
 
42
50
  def display_pdf_slides(self):
51
+ 'return pdf slides as images'
43
52
  from pdf2image import convert_from_path
44
53
  # Convert PDF to a list of images
45
54
  return convert_from_path(self.filepath)
46
55
 
47
56
 
48
57
  def __call__(self, size = ''):
58
+ 'make function class a callable function'
49
59
  if size != '':
50
60
  self.size = size
51
61
  self.slides(slice(self.index,self.index + 1))
@@ -53,6 +63,7 @@ class PDFreader:
53
63
 
54
64
 
55
65
  def __getitem__(self, slide):
66
+ 'get slides like indexing a array'
56
67
  if isinstance(slide, int):
57
68
  self.slides(slice(slide, slide + 1))
58
69
  elif isinstance(slide, slice):
@@ -60,6 +71,7 @@ class PDFreader:
60
71
 
61
72
 
62
73
  def slides(self, slide):
74
+ 'display the slide as plt.imshow(image)'
63
75
  import matplotlib.pyplot as plt
64
76
 
65
77
  for i, image in enumerate(self.images[slide]):
@@ -73,4 +85,5 @@ class PDFreader:
73
85
  plt.show()
74
86
 
75
87
  def size(self, size):
88
+ 'return slide size'
76
89
  self.size = size
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nbdevAuto
3
- Version: 0.0.110
3
+ Version: 0.0.119
4
4
  Summary: automating nbdev
5
5
  Home-page: https://github.com/bthek1/nbdevAuto
6
6
  Author: Benedict Thekkel
@@ -17,8 +17,8 @@ Classifier: Programming Language :: Python :: 3.10
17
17
  Classifier: License :: OSI Approved :: Apache Software License
18
18
  Requires-Python: >=3.7
19
19
  Description-Content-Type: text/markdown
20
- Provides-Extra: dev
21
20
  License-File: LICENSE
21
+ Provides-Extra: dev
22
22
 
23
23
  # Nbdev Automation Library
24
24
 
@@ -1,7 +1,7 @@
1
1
  [DEFAULT]
2
2
  repo = nbdevAuto
3
3
  lib_name = nbdevAuto
4
- version = 0.0.110
4
+ version = 0.0.119
5
5
  min_python = 3.7
6
6
  license = apache2
7
7
  black_formatting = False
@@ -1 +0,0 @@
1
- __version__ = "0.0.110"
File without changes
File without changes
File without changes
File without changes
File without changes