├── docs
├── .gitignore
├── Gemfile
├── sidebar.json
├── _data
│ ├── topnav.yml
│ └── sidebars
│ │ └── home_sidebar.yml
├── sitemap.xml
├── feed.xml
├── _config.yml
├── index.html
└── core.html
├── simple_doexport
├── __init__.py
├── _nbdev.py
└── core.py
├── MANIFEST.in
├── README.md
├── .devcontainer.json
├── Makefile
├── docker-compose.yml
├── .github
└── workflows
│ └── main.yml
├── index.ipynb
├── .gitignore
├── CONTRIBUTING.md
├── settings.ini
├── setup.py
├── 00_core.ipynb
└── LICENSE
/docs/.gitignore:
--------------------------------------------------------------------------------
1 | _site/
2 |
--------------------------------------------------------------------------------
/simple_doexport/__init__.py:
--------------------------------------------------------------------------------
1 | __version__ = "0.0.1"
2 |
--------------------------------------------------------------------------------
/docs/Gemfile:
--------------------------------------------------------------------------------
1 | source "https://rubygems.org"
2 |
3 | gem "jekyll", ">= 3.7"
4 | gem "jekyll-remote-theme"
5 |
--------------------------------------------------------------------------------
/docs/sidebar.json:
--------------------------------------------------------------------------------
1 | {
2 | "simple_doexport": {
3 | "Overview": "/",
4 | "Export stata_kernel notebook": "core.html"
5 | }
6 | }
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include settings.ini
2 | include LICENSE
3 | include CONTRIBUTING.md
4 | include README.md
5 | recursive-exclude * __pycache__
6 |
--------------------------------------------------------------------------------
/docs/_data/topnav.yml:
--------------------------------------------------------------------------------
1 | topnav:
2 | - title: Topnav
3 | items:
4 | - title: github
5 | external_url: https://github.com/{user}/{lib_name}/tree/{branch}/
6 |
7 | #Topnav dropdowns
8 | topnav_dropdowns:
9 | - title: Topnav dropdowns
10 | folders:
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Simple Jupyter .do export
2 | > Export a stata_kernel Jupyter notebook to a Stata .do file
3 |
4 |
5 | [Under construction]
6 |
7 | ## Install
8 |
9 | `pip install simple_doexport`
10 |
11 | ## How to use
12 |
13 | [Under construction]
14 |
15 | ```python
16 | 1+1
17 | ```
18 |
19 |
20 |
21 |
22 | 2
23 |
24 |
25 |
--------------------------------------------------------------------------------
/simple_doexport/_nbdev.py:
--------------------------------------------------------------------------------
1 | # AUTOGENERATED BY NBDEV! DO NOT EDIT!
2 |
3 | __all__ = ["index", "modules", "custom_doc_links", "git_url"]
4 |
5 | index = {"read_nb": "00_core.ipynb",
6 | "notebook2do": "00_core.ipynb",
7 | "simple_doexport": "00_core.ipynb"}
8 |
9 | modules = ["core.py"]
10 |
11 | doc_url = "https://hugetim.github.io/simple_doexport/"
12 |
13 | git_url = "https://github.com/hugetim/simple_doexport/tree/master/"
14 |
15 | def custom_doc_links(name): return None
16 |
--------------------------------------------------------------------------------
/docs/_data/sidebars/home_sidebar.yml:
--------------------------------------------------------------------------------
1 |
2 | #################################################
3 | ### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
4 | #################################################
5 | # Instead edit ../../sidebar.json
6 | entries:
7 | - folders:
8 | - folderitems:
9 | - output: web,pdf
10 | title: Overview
11 | url: /
12 | - output: web,pdf
13 | title: Export stata_kernel notebook
14 | url: core.html
15 | output: web
16 | title: simple_doexport
17 | output: web
18 | title: Sidebar
19 |
--------------------------------------------------------------------------------
/.devcontainer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nbdev_template-codespaces",
3 | "dockerComposeFile": "docker-compose.yml",
4 | "service": "watcher",
5 | "settings": {"terminal.integrated.shell.linux": "/bin/bash"},
6 | "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
7 | "forwardPorts": [4000, 8080],
8 | "appPort": [4000, 8080],
9 | "extensions": ["ms-python.python",
10 | "ms-azuretools.vscode-docker"],
11 | "runServices": ["notebook", "jekyll", "watcher"],
12 | "postStartCommand": "pip install -e ."
13 | }
14 |
--------------------------------------------------------------------------------
/docs/sitemap.xml:
--------------------------------------------------------------------------------
1 | ---
2 | layout: none
3 | search: exclude
4 | ---
5 |
6 |
7 |
tags around the doc strings, preserving newlines/indentation. 67 | #monospace_docstrings = False 68 | #Test flags: introduce here the test flags you want to use separated by | 69 | #tst_flags = 70 | #Custom sidebar: customize sidebar.json yourself for advanced sidebars (False/True) 71 | #custom_sidebar = 72 | #Cell spacing: if you want cell blocks in code separated by more than one new line 73 | #cell_spacing = 74 | #Custom jekyll styles: if you want more jekyll styles than tip/important/warning, set them here 75 | #jekyll_styles = note,warning,tip,important 76 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | title: Simple Jupyter .do export 4 | 5 | 6 | keywords: fastai 7 | sidebar: home_sidebar 8 | 9 | summary: "Export a stata_kernel Jupyter notebook to a Stata .do file" 10 | description: "Export a stata_kernel Jupyter notebook to a Stata .do file" 11 | nb_path: "index.ipynb" 12 | --- 13 | 22 | 23 |24 | 25 | {% raw %} 26 | 27 |99 | 100 | 101 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | from pkg_resources import parse_version 2 | from configparser import ConfigParser 3 | import setuptools,re,sys 4 | assert parse_version(setuptools.__version__)>=parse_version('36.2') 5 | 6 | # note: all settings are in settings.ini; edit there, not here 7 | config = ConfigParser(delimiters=['=']) 8 | config.read('settings.ini') 9 | cfg = config['DEFAULT'] 10 | 11 | cfg_keys = 'version description keywords author author_email'.split() 12 | expected = cfg_keys + "lib_name user branch license status min_python audience language".split() 13 | for o in expected: assert o in cfg, "missing expected setting: {}".format(o) 14 | setup_cfg = {o:cfg[o] for o in cfg_keys} 15 | 16 | if len(sys.argv)>1 and sys.argv[1]=='version': 17 | print(setup_cfg['version']) 18 | exit() 19 | 20 | licenses = { 21 | 'apache2': ('Apache Software License 2.0','OSI Approved :: Apache Software License'), 22 | 'mit': ('MIT License', 'OSI Approved :: MIT License'), 23 | 'gpl2': ('GNU General Public License v2', 'OSI Approved :: GNU General Public License v2 (GPLv2)'), 24 | 'gpl3': ('GNU General Public License v3', 'OSI Approved :: GNU General Public License v3 (GPLv3)'), 25 | 'bsd3': ('BSD License', 'OSI Approved :: BSD License'), 26 | } 27 | statuses = [ '1 - Planning', '2 - Pre-Alpha', '3 - Alpha', 28 | '4 - Beta', '5 - Production/Stable', '6 - Mature', '7 - Inactive' ] 29 | py_versions = '2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8'.split() 30 | 31 | lic = licenses.get(cfg['license'].lower(), (cfg['license'], None)) 32 | min_python = cfg['min_python'] 33 | 34 | requirements = ['pip', 'packaging'] 35 | if cfg.get('requirements'): requirements += cfg.get('requirements','').split() 36 | if cfg.get('pip_requirements'): requirements += cfg.get('pip_requirements','').split() 37 | dev_requirements = (cfg.get('dev_requirements') or '').split() 38 | 39 | long_description = open('README.md').read() 40 | #  41 | for ext in ['png', 'svg']: 42 | long_description = re.sub(r'!\['+ext+'\]\((.*)\)', '+'/'+cfg['branch']+'/\\1)', long_description) 43 | long_description = re.sub(r'src=\"(.*)\.'+ext+'\"', 'src=\"https://raw.githubusercontent.com/{}/{}'.format(cfg['user'],cfg['lib_name'])+'/'+cfg['branch']+'/\\1.'+ext+'\"', long_description) 44 | 45 | setuptools.setup( 46 | name = cfg['lib_name'], 47 | license = lic[0], 48 | classifiers = [ 49 | 'Development Status :: ' + statuses[int(cfg['status'])], 50 | 'Intended Audience :: ' + cfg['audience'].title(), 51 | 'Natural Language :: ' + cfg['language'].title(), 52 | ] + ['Programming Language :: Python :: '+o for o in py_versions[py_versions.index(min_python):]] + (['License :: ' + lic[1] ] if lic[1] else []), 53 | url = cfg['git_url'], 54 | packages = setuptools.find_packages(), 55 | include_package_data = True, 56 | install_requires = requirements, 57 | extras_require={ 'dev': dev_requirements }, 58 | python_requires = '>=' + cfg['min_python'], 59 | long_description = long_description, 60 | long_description_content_type = 'text/markdown', 61 | zip_safe = False, 62 | entry_points = { 'console_scripts': cfg.get('console_scripts','').split() }, 63 | **setup_cfg) 64 | 65 | -------------------------------------------------------------------------------- /00_core.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "# default_exp core" 10 | ] 11 | }, 12 | { 13 | "cell_type": "markdown", 14 | "metadata": {}, 15 | "source": [ 16 | "# Export stata_kernel notebook\n", 17 | "\n", 18 | "> Export a stata_kernel Jupyter notebook to a Stata .do file" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": null, 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "#hide\n", 28 | "from nbdev.showdoc import *" 29 | ] 30 | }, 31 | { 32 | "cell_type": "markdown", 33 | "metadata": {}, 34 | "source": [ 35 | "## Basics copied from nbdev\n", 36 | "https://github.com/fastai/nbdev/blob/master/nbs/00_export.ipynb" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": null, 42 | "metadata": {}, 43 | "outputs": [], 44 | "source": [ 45 | "#export\n", 46 | "from nbdev.imports import *\n", 47 | "from fastcore.script import *\n", 48 | "from fastcore.foundation import *\n", 49 | "#from keyword import iskeyword\n", 50 | "import nbformat" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": null, 56 | "metadata": {}, 57 | "outputs": [], 58 | "source": [ 59 | "#export\n", 60 | "def read_nb(fname):\n", 61 | " \"Read the notebook in `fname`.\"\n", 62 | " with open(Path(fname),'r', encoding='utf8') as f: return nbformat.reads(f.read(), as_version=4)" 63 | ] 64 | }, 65 | { 66 | "cell_type": "markdown", 67 | "metadata": {}, 68 | "source": [ 69 | "## Simpler versions adapted from nbdev" 70 | ] 71 | }, 72 | { 73 | "cell_type": "code", 74 | "execution_count": null, 75 | "metadata": {}, 76 | "outputs": [], 77 | "source": [ 78 | "#export\n", 79 | "def notebook2do(fname):\n", 80 | " \"Create a module file for `fname`.\"\n", 81 | " fname = Path(fname)\n", 82 | " nb = read_nb(fname)\n", 83 | " fname_out = f'{fname.stem}.do'\n", 84 | " with open(fname_out, 'w') as f:\n", 85 | " f.write('\\n')\n", 86 | " cells = [c for c in nb['cells'] if c['cell_type'] == 'code']\n", 87 | " for i,c in enumerate(cells):\n", 88 | " code = c['source']\n", 89 | " if i+1 != c['execution_count']:\n", 90 | " print(f\"Warning: execution count, {c['execution_count']}, differs from cell number, {i+1}.\")\n", 91 | " with open(fname_out, 'a', encoding='utf8') as f:\n", 92 | " f.write(f'**# [{i+1}]:\\n')\n", 93 | " f.write(code)\n", 94 | " f.write('\\n\\n')" 95 | ] 96 | }, 97 | { 98 | "cell_type": "code", 99 | "execution_count": null, 100 | "metadata": {}, 101 | "outputs": [], 102 | "source": [ 103 | "#export\n", 104 | "@call_parse\n", 105 | "def simple_doexport(fname:Param(\"A stata_kernel notebook name\", str)):\n", 106 | " \"Export notebooks matching `fname` to Stata .do files\"\n", 107 | " notebook2do(fname=fname)" 108 | ] 109 | }, 110 | { 111 | "cell_type": "code", 112 | "execution_count": null, 113 | "metadata": {}, 114 | "outputs": [], 115 | "source": [ 116 | "from nbdev.export import notebook2script; notebook2script()" 117 | ] 118 | } 119 | ], 120 | "metadata": { 121 | "kernelspec": { 122 | "display_name": "Python 3", 123 | "language": "python", 124 | "name": "python3" 125 | } 126 | }, 127 | "nbformat": 4, 128 | "nbformat_minor": 2 129 | } 130 | -------------------------------------------------------------------------------- /docs/core.html: -------------------------------------------------------------------------------- 1 | --- 2 | 3 | title: Export stata_kernel notebook 4 | 5 | 6 | keywords: fastai 7 | sidebar: home_sidebar 8 | 9 | summary: "Export a stata_kernel Jupyter notebook to a Stata .do file" 10 | description: "Export a stata_kernel Jupyter notebook to a Stata .do file" 11 | nb_path: "00_core.ipynb" 12 | --- 13 | 22 | 23 |28 | 29 |30 | {% endraw %} 31 | 32 |39 | 45 |33 |38 |34 |37 |[Under construction]
35 | 36 |52 | 58 |46 |51 |47 |50 |48 | 49 |
pip install simple_doexport65 | {% raw %} 66 | 67 |59 |64 |60 |63 |[Under construction]
61 | 62 |68 |96 | {% endraw %} 97 | 98 |69 | 70 |78 | 79 |71 |77 |72 |76 |74 | 75 |1+1 73 |80 |94 | 95 |81 | 82 |93 |83 | 84 | 85 | 86 | 89 | 90 |91 | 92 |24 | 25 | {% raw %} 26 | 27 |166 | 167 | 168 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------28 | 29 |30 | {% endraw %} 31 | 32 |39 | {% raw %} 40 | 41 |33 |38 |34 |37 |Basics copied from nbdev
https://github.com/fastai/nbdev/blob/master/nbs/00_export.ipynb
35 | 36 |42 | 43 |44 | {% endraw %} 45 | 46 | {% raw %} 47 | 48 |49 | 50 |69 | {% endraw %} 70 | 71 | {% raw %} 72 | 73 |51 |67 | 68 |52 | 53 |66 |54 | 55 | 56 | 62 | 63 |64 | 65 |74 | 75 |76 | {% endraw %} 77 | 78 | 84 | {% raw %} 85 | 86 |87 | 88 |107 | {% endraw %} 108 | 109 | {% raw %} 110 | 111 |89 |105 | 106 |90 | 91 |104 |92 | 93 | 94 | 100 | 101 |102 | 103 |112 | 113 |114 | {% endraw %} 115 | 116 | {% raw %} 117 | 118 |119 | 120 |139 | {% endraw %} 140 | 141 | {% raw %} 142 | 143 |121 |137 | 138 |122 | 123 |136 |124 | 125 | 126 | 132 | 133 |134 | 135 |144 | 145 |146 | {% endraw %} 147 | 148 | {% raw %} 149 | 150 |151 |163 | {% endraw %} 164 | 165 |152 | 153 |161 | 162 |154 |160 |155 |159 |157 | 158 |from nbdev.export import notebook2script; notebook2script() 156 |