nbdevAuto 0.0.119__tar.gz → 0.3.23__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.119
3
+ Version: 0.3.23
4
4
  Summary: automating nbdev
5
5
  Home-page: https://github.com/bthek1/nbdevAuto
6
6
  Author: Benedict Thekkel
@@ -18,27 +18,12 @@ Classifier: License :: OSI Approved :: Apache Software License
18
18
  Requires-Python: >=3.7
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
+ Requires-Dist: graphviz
21
22
  Provides-Extra: dev
22
23
 
23
24
  # Nbdev Automation Library
24
25
 
25
- <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
26
-
27
- This file will become your README and also the index of your
28
- documentation.
29
-
30
- ## Install
31
-
32
- ``` sh
33
- pip install nbdevAuto
34
- ```
35
26
 
36
- ## How to use
37
-
38
- Fill me in please! Don’t forget code examples:
39
-
40
- ``` python
41
- 1+1
42
- ```
27
+ <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
43
28
 
44
- 2
29
+ Automation Library to help with using nbdev
@@ -0,0 +1,6 @@
1
+ # Nbdev Automation Library
2
+
3
+
4
+ <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
5
+
6
+ Automation Library to help with using nbdev
@@ -0,0 +1 @@
1
+ __version__ = "0.3.23"
@@ -5,15 +5,17 @@ d = { 'settings': { 'branch': 'main',
5
5
  'doc_host': 'https://bthek1.github.io',
6
6
  'git_url': 'https://github.com/bthek1/nbdevAuto',
7
7
  'lib_path': 'nbdevAuto'},
8
- 'syms': { 'nbdevAuto.automate': { 'nbdevAuto.automate.create_cfast': ('automate.html#create_cfast', 'nbdevAuto/automate.py'),
8
+ 'syms': { 'nbdevAuto.automate': { 'nbdevAuto.automate.create_env': ('automate.html#create_env', 'nbdevAuto/automate.py'),
9
9
  'nbdevAuto.automate.everything': ('automate.html#everything', 'nbdevAuto/automate.py'),
10
10
  'nbdevAuto.automate.gacp': ('automate.html#gacp', 'nbdevAuto/automate.py'),
11
+ 'nbdevAuto.automate.hello': ('automate.html#hello', 'nbdevAuto/automate.py'),
11
12
  'nbdevAuto.automate.help_output': ('automate.html#help_output', 'nbdevAuto/automate.py'),
12
13
  'nbdevAuto.automate.prep': ('automate.html#prep', 'nbdevAuto/automate.py'),
13
14
  'nbdevAuto.automate.reinstall': ('automate.html#reinstall', 'nbdevAuto/automate.py'),
14
15
  'nbdevAuto.automate.release': ('automate.html#release', 'nbdevAuto/automate.py'),
15
16
  'nbdevAuto.automate.release_git': ('automate.html#release_git', 'nbdevAuto/automate.py'),
16
17
  'nbdevAuto.automate.release_pypi': ('automate.html#release_pypi', 'nbdevAuto/automate.py'),
18
+ 'nbdevAuto.automate.status': ('automate.html#status', 'nbdevAuto/automate.py'),
17
19
  'nbdevAuto.automate.update': ('automate.html#update', 'nbdevAuto/automate.py'),
18
20
  'nbdevAuto.automate.upload': ('automate.html#upload', 'nbdevAuto/automate.py')},
19
21
  'nbdevAuto.core': {'nbdevAuto.core.foo': ('core.html#foo', 'nbdevAuto/core.py')},
@@ -1,15 +1,20 @@
1
1
  # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/01_Automate.ipynb.
2
2
 
3
3
  # %% auto 0
4
- __all__ = ['prep', 'gacp', 'upload', 'reinstall', 'update', 'release_git', 'release_pypi', 'release', 'help_output', 'everything',
5
- 'create_cfast']
4
+ __all__ = ['prep', 'gacp', 'status', 'upload', 'reinstall', 'update', 'release_git', 'release_pypi', 'release', 'help_output',
5
+ 'everything', 'create_env', 'hello']
6
6
 
7
7
  # %% ../nbs/01_Automate.ipynb 6
8
- def prep(part:int = 2):
8
+ from fastcore.script import *
9
+
10
+ @call_parse
11
+ def prep(
12
+ p:int = 2, # Increment Part
13
+ ):
9
14
  "Export, test, and clean notebooks, and render README if needed"
10
- import nbdev.release
11
- nbdev.release.nbdev_bump_version(part)
12
- import nbdev.test, nbdev.clean, nbdev.quarto
15
+
16
+ import nbdev.test, nbdev.clean, nbdev.quarto, nbdev.release
17
+ nbdev.release.nbdev_bump_version(p)
13
18
 
14
19
  nbdev.quarto.nbdev_export.__wrapped__()
15
20
  print(f'### nbdev_export finished ###')
@@ -26,86 +31,107 @@ def prep(part:int = 2):
26
31
  print(f'### nbdev_readme finished ###')
27
32
 
28
33
  # %% ../nbs/01_Automate.ipynb 7
34
+ @call_parse
29
35
  def gacp(
30
- comment:str="update"
36
+ m:str = '', # Commit message
31
37
  ):
32
38
  "git add, commit and push to github"
39
+
33
40
  import subprocess
34
41
  subprocess.run(["git", "add", "."])
35
42
  print(f'### git added ###')
36
- status = subprocess.check_output(["git", "status", "-s"])
43
+ status = subprocess.check_output(["git", "status", "-s"]).decode('utf-8')
37
44
  print(f'### git status: "{status}" ###')
38
- subprocess.run(["git", "commit", "-m", f'"{status}"'])
39
- print(f'### git commited ###')
45
+
46
+ if m != '':
47
+ subprocess.run(["git", "commit", "-m", f'{m}'])
48
+ print(f'### git commited "{m}"###')
49
+ else:
50
+ subprocess.run(["git", "commit", "-m", f'{status}'])
51
+ print(f'### git commited status ###')
40
52
  subprocess.run(["git", "push"])
41
53
  print(f'### git pushed ###')
42
54
 
43
55
  # %% ../nbs/01_Automate.ipynb 8
44
- def upload():
45
- "prep, then gacp"
46
- prep()
47
- gacp()
56
+ def status():
57
+ "git status"
58
+ import subprocess
59
+ subprocess.run(["git", "status"])
48
60
 
49
61
  # %% ../nbs/01_Automate.ipynb 9
62
+ @call_parse
63
+ def upload(
64
+ m:str = '', # Commit message
65
+ p:int = 2, #Increment part
66
+ ):
67
+ "prep, then gacp"
68
+ prep(p)
69
+ gacp(m)
70
+
71
+ # %% ../nbs/01_Automate.ipynb 10
50
72
  def reinstall():
51
73
  "runs pip install -e ."
52
74
  import subprocess
53
75
  subprocess.run(["pip", "install", "-e", "."])
54
76
 
55
- # %% ../nbs/01_Automate.ipynb 10
77
+ # %% ../nbs/01_Automate.ipynb 11
56
78
  def update():
57
79
  "prep, then reinstall"
58
80
  prep()
59
81
  reinstall()
60
82
 
61
- # %% ../nbs/01_Automate.ipynb 12
83
+ # %% ../nbs/01_Automate.ipynb 13
62
84
  def release_git():
63
85
  "release to git"
64
86
  import nbdev.release
87
+ nbdev.release.nbdev_bump_version(1)
65
88
  nbdev.release.release_git()
66
89
 
67
- # %% ../nbs/01_Automate.ipynb 13
90
+ # %% ../nbs/01_Automate.ipynb 14
68
91
  def release_pypi():
69
92
  "release to pypi"
70
93
  import nbdev.release
71
94
  nbdev.release.release_pypi()
72
95
 
73
- # %% ../nbs/01_Automate.ipynb 14
96
+ # %% ../nbs/01_Automate.ipynb 15
74
97
  def release():
75
98
  "release to github and pip"
76
99
  release_git()
77
100
  release_pypi()
78
101
 
79
- # %% ../nbs/01_Automate.ipynb 16
102
+ # %% ../nbs/01_Automate.ipynb 18
80
103
  def help_output():
81
104
  "Show help for all console scripts"
82
105
  from fastcore.xtras import console_help
83
106
  console_help('nbdevAuto')
84
107
 
85
- # %% ../nbs/01_Automate.ipynb 18
108
+ # %% ../nbs/01_Automate.ipynb 20
86
109
  def everything():
87
110
  "prep, gacp, release, reinstall"
88
111
  upload()
89
112
  update()
90
113
  release()
91
114
 
92
- # %% ../nbs/01_Automate.ipynb 20
93
- def create_cfast():
94
- "create mamba env cfast"
115
+ # %% ../nbs/01_Automate.ipynb 22
116
+ @call_parse
117
+ def create_env(
118
+ n:str = 'fast', #Name of the environment
119
+ ):
120
+ "create conda env for AI"
95
121
  from pathlib import Path
96
- import subprocess
97
-
98
- file_path = Path("cfast.yml")
122
+ import subprocess
99
123
 
100
- if file_path.exists():
101
- print(f"The file {file_path} exists.")
102
-
103
-
104
- subprocess.run(["mamba", "env", "create", "-n", "cfast", "-f", "cfast.yml"])
105
-
106
- print(f'### cfast created ###')
107
- else:
108
- subprocess.run(["wget", "https://github.com/bthek1/FastAISetup/blob/main/cfast.yml"])
109
- subprocess.run(["mamba", "env", "create", "-n", "cfast", "-f", "cfast.yml"])
110
- print(f"The file {file_path} does not exist. Download it from github")
124
+ subprocess.run(["conda", "create", "-n", f"{n}", "python"])
125
+ subprocess.run(["conda", "init"])
126
+ subprocess.run(["conda", "activate", f"{n}"], shell=True)
127
+ # subprocess.run(["pip", "install", "fastai", "fastcore"])
128
+
129
+
130
+ # %% ../nbs/01_Automate.ipynb 23
131
+ def hello():
132
+ import argparse
133
+ parser = argparse.ArgumentParser(description='My CLI function.')
134
+ parser.add_argument('-n', '--name', type=str, help='Name of the environment', default='fast')
135
+ args = parser.parse_args()
111
136
 
137
+ print(f'Hello, {args.name}!')
@@ -6,7 +6,6 @@ __all__ = ['read_from_file', 'download_pic', 'create_searches_folder', 'download
6
6
  'kaggle_dataset_download', 'graph']
7
7
 
8
8
  # %% ../nbs/00_Functions.ipynb 5
9
- #|code-fold: true
10
9
  def read_from_file(file_path):
11
10
  from fastbook import search_images_ddg
12
11
  from fastdownload import download_url
@@ -24,7 +23,6 @@ def read_from_file(file_path):
24
23
  return countries
25
24
 
26
25
  # %% ../nbs/00_Functions.ipynb 7
27
- #|code-fold: true
28
26
  def download_pic(
29
27
  image:str, #image description
30
28
  n_images:int=1,
@@ -80,7 +78,6 @@ def download_pic(
80
78
  return Image.open(image_path).to_thumb(256,256)
81
79
 
82
80
  # %% ../nbs/00_Functions.ipynb 10
83
- #|code-fold: true
84
81
  def create_searches_folder(folder_path, searches, show_progress:bool=False):
85
82
  from tqdm.notebook import tqdm
86
83
  print("Create folder")
@@ -90,7 +87,6 @@ def create_searches_folder(folder_path, searches, show_progress:bool=False):
90
87
  if show_progress == True: print(f'created {i} folder')
91
88
 
92
89
  # %% ../nbs/00_Functions.ipynb 11
93
- #|code-fold: true
94
90
  def download_search_image(folder_path,
95
91
  item,
96
92
  before,
@@ -121,7 +117,6 @@ def download_search_image(folder_path,
121
117
 
122
118
 
123
119
  # %% ../nbs/00_Functions.ipynb 12
124
- #|code-fold: true
125
120
  def download_search_images(folder_path,
126
121
  searches,
127
122
  before,
@@ -137,7 +132,6 @@ def download_search_images(folder_path,
137
132
 
138
133
 
139
134
  # %% ../nbs/00_Functions.ipynb 13
140
- #|code-fold: true
141
135
  def verify_pics(folder_path,
142
136
  ):
143
137
  from fastai.vision.all import verify_images, get_image_files
@@ -149,7 +143,6 @@ def verify_pics(folder_path,
149
143
  print(f"Number of images failed: {len(failed)}")
150
144
 
151
145
  # %% ../nbs/00_Functions.ipynb 14
152
- #|code-fold: true
153
146
  def resize_pics(folder_path,
154
147
  searches,
155
148
  max_size=400,
@@ -168,7 +161,6 @@ def resize_pics(folder_path,
168
161
  if show == True: print(f"resizing images for: {k}")
169
162
 
170
163
  # %% ../nbs/00_Functions.ipynb 15
171
- #|code-fold: true
172
164
  def create_data_folder(
173
165
  folder_path:str,
174
166
  searches:tuple,
@@ -209,7 +201,6 @@ def create_data_folder(
209
201
 
210
202
 
211
203
  # %% ../nbs/00_Functions.ipynb 18
212
- #|code-fold: true
213
204
  def classify_images(learn, img):
214
205
  'image classifer'
215
206
  from fastai.vision.all import PILImage
@@ -220,7 +211,6 @@ def classify_images(learn, img):
220
211
  return dict(zip(categories, rounded_probs))
221
212
 
222
213
  # %% ../nbs/00_Functions.ipynb 20
223
- #|code-fold: true
224
214
  def kaggle_competition_download(name:str, folderpath:str = './Data'):
225
215
  'download competition files from kaggle'
226
216
  import os
@@ -239,7 +229,6 @@ def kaggle_competition_download(name:str, folderpath:str = './Data'):
239
229
  zipfile.ZipFile(f'{path}/{name}.zip').extractall(path)
240
230
 
241
231
  # %% ../nbs/00_Functions.ipynb 21
242
- #|code-fold: true
243
232
  def kaggle_dataset_download(user:str,
244
233
  name:str,
245
234
  folderpath:str = './Data'):
@@ -259,11 +248,9 @@ def kaggle_dataset_download(user:str,
259
248
  zipfile.ZipFile(f'{path}/{name}.zip').extractall(path)
260
249
 
261
250
  # %% ../nbs/00_Functions.ipynb 23
262
- #|code-fold: true
263
251
  from graphviz import Digraph
264
252
 
265
253
  # %% ../nbs/00_Functions.ipynb 24
266
- #|code-fold: true
267
254
  class graph(Digraph):
268
255
  def __init__(self, *args, **kwargs):
269
256
  # Call the superclass's __init__ method using super() and pass all arguments
@@ -4,7 +4,6 @@
4
4
  __all__ = ['PDFreader']
5
5
 
6
6
  # %% ../nbs/02_PDF_reader.ipynb 5
7
- #|code-fold: true
8
7
  class PDFreader:
9
8
  ''' Function for reading and displaying pdf files
10
9
  ex. path = './Data/<file>.pdf'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nbdevAuto
3
- Version: 0.0.119
3
+ Version: 0.3.23
4
4
  Summary: automating nbdev
5
5
  Home-page: https://github.com/bthek1/nbdevAuto
6
6
  Author: Benedict Thekkel
@@ -18,27 +18,12 @@ Classifier: License :: OSI Approved :: Apache Software License
18
18
  Requires-Python: >=3.7
19
19
  Description-Content-Type: text/markdown
20
20
  License-File: LICENSE
21
+ Requires-Dist: graphviz
21
22
  Provides-Extra: dev
22
23
 
23
24
  # Nbdev Automation Library
24
25
 
25
- <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
26
-
27
- This file will become your README and also the index of your
28
- documentation.
29
-
30
- ## Install
31
-
32
- ``` sh
33
- pip install nbdevAuto
34
- ```
35
26
 
36
- ## How to use
37
-
38
- Fill me in please! Don’t forget code examples:
39
-
40
- ``` python
41
- 1+1
42
- ```
27
+ <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
43
28
 
44
- 2
29
+ Automation Library to help with using nbdev
@@ -1,13 +1,15 @@
1
1
  [console_scripts]
2
- create_cfast = nbdevAuto.automate:create_cfast
2
+ create_env = nbdevAuto.automate:create_env
3
3
  everything = nbdevAuto.automate:everything
4
4
  gacp = nbdevAuto.automate:gacp
5
5
  gitrelease = nbdevAuto.automate:release_git
6
6
  h = nbdevAuto.automate:help_output
7
+ hello = nbdevAuto.automate:hello
7
8
  piprelease = nbdevAuto.automate:release_pypi
8
9
  prep = nbdevAuto.automate:prep
9
10
  reinstall = nbdevAuto.automate:reinstall
10
11
  release = nbdevAuto.automate:release
12
+ status = nbdevAuto.automate:status
11
13
  update = nbdevAuto.automate:update
12
14
  upload = nbdevAuto.automate:upload
13
15
 
@@ -0,0 +1,3 @@
1
+ graphviz
2
+
3
+ [dev]
@@ -1,7 +1,7 @@
1
1
  [DEFAULT]
2
2
  repo = nbdevAuto
3
3
  lib_name = nbdevAuto
4
- version = 0.0.119
4
+ version = 0.3.23
5
5
  min_python = 3.7
6
6
  license = apache2
7
7
  black_formatting = False
@@ -32,12 +32,14 @@ allowed_cell_metadata_keys =
32
32
  jupyter_hooks = True
33
33
  clean_ids = True
34
34
  clear_all = False
35
- requirements =
35
+ requirements = graphviz
36
36
  conda_requirements =
37
37
  dev_requirements =
38
38
  console_scripts =
39
39
  prep=nbdevAuto.automate:prep
40
40
  gacp=nbdevAuto.automate:gacp
41
+ status=nbdevAuto.automate:status
42
+
41
43
  upload=nbdevAuto.automate:upload
42
44
 
43
45
  reinstall=nbdevAuto.automate:reinstall
@@ -51,5 +53,6 @@ console_scripts =
51
53
 
52
54
  everything=nbdevAuto.automate:everything
53
55
 
54
- create_cfast=nbdevAuto.automate:create_cfast
56
+ create_env=nbdevAuto.automate:create_env
57
+ hello=nbdevAuto.automate:hello
55
58
 
@@ -1,22 +0,0 @@
1
- # Nbdev Automation Library
2
-
3
- <!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->
4
-
5
- This file will become your README and also the index of your
6
- documentation.
7
-
8
- ## Install
9
-
10
- ``` sh
11
- pip install nbdevAuto
12
- ```
13
-
14
- ## How to use
15
-
16
- Fill me in please! Don’t forget code examples:
17
-
18
- ``` python
19
- 1+1
20
- ```
21
-
22
- 2
@@ -1 +0,0 @@
1
- __version__ = "0.0.119"
@@ -1,2 +0,0 @@
1
-
2
- [dev]
File without changes
File without changes
File without changes
File without changes