diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3967631 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +**/*.ipynb filter=clean-nbs +**/*.ipynb diff=ipynb diff --git a/.gitconfig b/.gitconfig new file mode 100644 index 0000000..4f7288d --- /dev/null +++ b/.gitconfig @@ -0,0 +1,16 @@ +# Generated by nbdev_install_git_hooks +# +# If you need to disable this instrumentation do: +# git config --local --unset include.path +# +# To restore the filter +# git config --local include.path .gitconfig +# +# If you see notebooks not stripped, checked the filters are applied in .gitattributes +# +[filter "clean-nbs"] + clean = nbdev_clean_nbs --read_input_stream True + smudge = cat + required = true +[diff "ipynb"] + textconv = nbdev_clean_nbs --disp True --fname diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..c2b264d --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,33 @@ +name: CI +on: [push, pull_request] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + with: + python-version: '3.6' + architecture: 'x64' + - name: Install the library + run: | + pip install nbdev jupyter + pip install -e . + - name: Read all notebooks + run: | + nbdev_read_nbs + - name: Check if all notebooks are cleaned + run: | + echo "Check we are starting with clean git checkout" + if [ -n "$(git status -uno -s)" ]; then echo "git status is not clean"; false; fi + echo "Trying to strip out notebooks" + nbdev_clean_nbs + echo "Check that strip out was unnecessary" + git status -s # display the status to see which nbs need cleaning up + if [ -n "$(git status -uno -s)" ]; then echo -e "!!! Detected unstripped out notebooks\n!!!Remember to run nbdev_install_git_hooks"; false; fi + - name: Check if there is no diff library/notebooks + run: | + if [ -n "$(nbdev_diff_nbs)" ]; then echo -e "!!! Detected difference between the notebooks and the library"; false; fi + - name: Run tests + run: | + nbdev_test_nbs diff --git a/.ipynb_checkpoints/00_core-checkpoint.ipynb b/.ipynb_checkpoints/00_core-checkpoint.ipynb new file mode 100644 index 0000000..6c17de9 --- /dev/null +++ b/.ipynb_checkpoints/00_core-checkpoint.ipynb @@ -0,0 +1,48 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# default_exp core" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# module name here\n", + "\n", + "> API details." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#hide\n", + "from nbdev.showdoc import *" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/.ipynb_checkpoints/index-checkpoint.ipynb b/.ipynb_checkpoints/index-checkpoint.ipynb new file mode 100644 index 0000000..74d4e32 --- /dev/null +++ b/.ipynb_checkpoints/index-checkpoint.ipynb @@ -0,0 +1,93 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#hide" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Project name here\n", + "\n", + "> Summary description here." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This file will become your README and also the index of your documentation." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Install" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "`pip install your_project_name`" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## How to use" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Fill me in please! Don't forget code examples:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "2" + ] + }, + "execution_count": null, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "1+1" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/.last_checked b/.last_checked new file mode 100644 index 0000000..e69de29 diff --git a/00_core.ipynb b/00_core.ipynb new file mode 100644 index 0000000..6c17de9 --- /dev/null +++ b/00_core.ipynb @@ -0,0 +1,48 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# default_exp core" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# module name here\n", + "\n", + "> API details." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#hide\n", + "from nbdev.showdoc import *" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..d9e2611 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,4 @@ +include settings.ini +include LICENSE +include README.md +recursive-exclude * __pycache__ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bc0ad9a --- /dev/null +++ b/Makefile @@ -0,0 +1,37 @@ +.ONESHELL: +SHELL := /bin/bash +SRC = $(wildcard ./*.ipynb) + +all: ThinkPython2 docs + +ThinkPython2: $(SRC) + nbdev_build_lib + touch ThinkPython2 + +sync: + nbdev_update_lib + +docs_serve: docs + cd docs && bundle exec jekyll serve + +docs: $(SRC) + nbdev_build_docs + touch docs + +test: + nbdev_test_nbs + +release: pypi conda_release + nbdev_bump_version + +conda_release: + fastrelease_conda_package + +pypi: dist + twine upload --repository pypi dist/* + +dist: clean + python setup.py sdist bdist_wheel + +clean: + rm -rf dist \ No newline at end of file diff --git a/README.md b/README.md index 08016d9..96e2995 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,24 @@ -ThinkPython -=========== +# Project name here +> Summary description here. -LaTeX source, code examples, and exercise solutions for Think Python, 2nd edition, by Allen Downey. -You can download this book in PDF from [Green Tea Press](http://greenteapress.com/wp/think-python-2e/) or buy it in paper and other formats from [O'Reilly Media](http://shop.oreilly.com/product/0636920045267.do). +This file will become your README and also the index of your documentation. -To build the book from source you will need a LaTeX installion. I recommend the TeX Live distribution with the following packages: +## Install + +`pip install your_project_name` + +## How to use + +Fill me in please! Don't forget code examples: + +```python +1+1 +``` + + + + + 2 -* texlive-latex-base -* texlive-latex-extra -* texlive-fonts-recommended diff --git a/ThinkPython2/__init__.py b/ThinkPython2/__init__.py new file mode 100644 index 0000000..f102a9c --- /dev/null +++ b/ThinkPython2/__init__.py @@ -0,0 +1 @@ +__version__ = "0.0.1" diff --git a/ThinkPython2/_nbdev.py b/ThinkPython2/_nbdev.py new file mode 100644 index 0000000..5eee99c --- /dev/null +++ b/ThinkPython2/_nbdev.py @@ -0,0 +1,13 @@ +# AUTOGENERATED BY NBDEV! DO NOT EDIT! + +__all__ = ["index", "modules", "custom_doc_links", "git_url"] + +index = {} + +modules = [] + +doc_url = "https://hamelsmu.github.io/ThinkPython2/" + +git_url = "https://github.com/hamelsmu/ThinkPython2/tree/master/" + +def custom_doc_links(name): return None diff --git a/ThinkPython2/core.py b/ThinkPython2/core.py new file mode 100644 index 0000000..e6352cc --- /dev/null +++ b/ThinkPython2/core.py @@ -0,0 +1,3 @@ +# AUTOGENERATED! DO NOT EDIT! File to edit: 00_core.ipynb (unless otherwise specified). + +__all__ = [] \ No newline at end of file diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..57510a2 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +_site/ diff --git a/docs/Gemfile b/docs/Gemfile new file mode 100644 index 0000000..6a9d66d --- /dev/null +++ b/docs/Gemfile @@ -0,0 +1,8 @@ +source "https://rubygems.org" + +gem 'github-pages', group: :jekyll_plugins + +# Added at 2019-11-25 10:11:40 -0800 by jhoward: +gem "nokogiri", "< 1.10.9" +gem "jekyll", ">= 3.7" +gem "kramdown", ">= 2.3.0" diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock new file mode 100644 index 0000000..0cfdcd0 --- /dev/null +++ b/docs/Gemfile.lock @@ -0,0 +1,261 @@ +GEM + remote: https://rubygems.org/ + specs: + activesupport (6.0.3.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) + minitest (~> 5.1) + tzinfo (~> 1.1) + zeitwerk (~> 2.2, >= 2.2.2) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.11.1) + colorator (1.1.0) + commonmarker (0.17.13) + ruby-enum (~> 0.5) + concurrent-ruby (1.1.7) + dnsruby (1.61.4) + simpleidn (~> 0.1) + em-websocket (0.5.1) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0.6.0) + ethon (0.12.0) + ffi (>= 1.3.0) + eventmachine (1.2.7) + execjs (2.7.0) + faraday (1.0.1) + multipart-post (>= 1.2, < 3) + ffi (1.13.1) + forwardable-extended (2.6.0) + gemoji (3.0.1) + github-pages (207) + github-pages-health-check (= 1.16.1) + jekyll (= 3.9.0) + jekyll-avatar (= 0.7.0) + jekyll-coffeescript (= 1.1.1) + jekyll-commonmark-ghpages (= 0.1.6) + jekyll-default-layout (= 0.1.4) + jekyll-feed (= 0.13.0) + jekyll-gist (= 1.5.0) + jekyll-github-metadata (= 2.13.0) + jekyll-mentions (= 1.5.1) + jekyll-optional-front-matter (= 0.3.2) + jekyll-paginate (= 1.1.0) + jekyll-readme-index (= 0.3.0) + jekyll-redirect-from (= 0.15.0) + jekyll-relative-links (= 0.6.1) + jekyll-remote-theme (= 0.4.1) + jekyll-sass-converter (= 1.5.2) + jekyll-seo-tag (= 2.6.1) + jekyll-sitemap (= 1.4.0) + jekyll-swiss (= 1.0.0) + jekyll-theme-architect (= 0.1.1) + jekyll-theme-cayman (= 0.1.1) + jekyll-theme-dinky (= 0.1.1) + jekyll-theme-hacker (= 0.1.1) + jekyll-theme-leap-day (= 0.1.1) + jekyll-theme-merlot (= 0.1.1) + jekyll-theme-midnight (= 0.1.1) + jekyll-theme-minimal (= 0.1.1) + jekyll-theme-modernist (= 0.1.1) + jekyll-theme-primer (= 0.5.4) + jekyll-theme-slate (= 0.1.1) + jekyll-theme-tactile (= 0.1.1) + jekyll-theme-time-machine (= 0.1.1) + jekyll-titles-from-headings (= 0.5.3) + jemoji (= 0.11.1) + kramdown (= 2.3.0) + kramdown-parser-gfm (= 1.1.0) + liquid (= 4.0.3) + mercenary (~> 0.3) + minima (= 2.5.1) + nokogiri (>= 1.10.4, < 2.0) + rouge (= 3.19.0) + terminal-table (~> 1.4) + github-pages-health-check (1.16.1) + addressable (~> 2.3) + dnsruby (~> 1.60) + octokit (~> 4.0) + public_suffix (~> 3.0) + typhoeus (~> 1.3) + html-pipeline (2.14.0) + activesupport (>= 2) + nokogiri (>= 1.4) + http_parser.rb (0.6.0) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + jekyll (3.9.0) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 0.7) + jekyll-sass-converter (~> 1.0) + jekyll-watch (~> 2.0) + kramdown (>= 1.17, < 3) + liquid (~> 4.0) + mercenary (~> 0.3.3) + pathutil (~> 0.9) + rouge (>= 1.7, < 4) + safe_yaml (~> 1.0) + jekyll-avatar (0.7.0) + jekyll (>= 3.0, < 5.0) + jekyll-coffeescript (1.1.1) + coffee-script (~> 2.2) + coffee-script-source (~> 1.11.1) + jekyll-commonmark (1.3.1) + commonmarker (~> 0.14) + jekyll (>= 3.7, < 5.0) + jekyll-commonmark-ghpages (0.1.6) + commonmarker (~> 0.17.6) + jekyll-commonmark (~> 1.2) + rouge (>= 2.0, < 4.0) + jekyll-default-layout (0.1.4) + jekyll (~> 3.0) + jekyll-feed (0.13.0) + jekyll (>= 3.7, < 5.0) + jekyll-gist (1.5.0) + octokit (~> 4.2) + jekyll-github-metadata (2.13.0) + jekyll (>= 3.4, < 5.0) + octokit (~> 4.0, != 4.4.0) + jekyll-mentions (1.5.1) + html-pipeline (~> 2.3) + jekyll (>= 3.7, < 5.0) + jekyll-optional-front-matter (0.3.2) + jekyll (>= 3.0, < 5.0) + jekyll-paginate (1.1.0) + jekyll-readme-index (0.3.0) + jekyll (>= 3.0, < 5.0) + jekyll-redirect-from (0.15.0) + jekyll (>= 3.3, < 5.0) + jekyll-relative-links (0.6.1) + jekyll (>= 3.3, < 5.0) + jekyll-remote-theme (0.4.1) + addressable (~> 2.0) + jekyll (>= 3.5, < 5.0) + rubyzip (>= 1.3.0) + jekyll-sass-converter (1.5.2) + sass (~> 3.4) + jekyll-seo-tag (2.6.1) + jekyll (>= 3.3, < 5.0) + jekyll-sitemap (1.4.0) + jekyll (>= 3.7, < 5.0) + jekyll-swiss (1.0.0) + jekyll-theme-architect (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-cayman (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-dinky (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-hacker (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-leap-day (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-merlot (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-midnight (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-minimal (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-modernist (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-primer (0.5.4) + jekyll (> 3.5, < 5.0) + jekyll-github-metadata (~> 2.9) + jekyll-seo-tag (~> 2.0) + jekyll-theme-slate (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-tactile (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-theme-time-machine (0.1.1) + jekyll (~> 3.5) + jekyll-seo-tag (~> 2.0) + jekyll-titles-from-headings (0.5.3) + jekyll (>= 3.3, < 5.0) + jekyll-watch (2.2.1) + listen (~> 3.0) + jemoji (0.11.1) + gemoji (~> 3.0) + html-pipeline (~> 2.2) + jekyll (>= 3.0, < 5.0) + kramdown (2.3.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.3) + listen (3.2.1) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + mercenary (0.3.6) + mini_portile2 (2.4.0) + minima (2.5.1) + jekyll (>= 3.5, < 5.0) + jekyll-feed (~> 0.9) + jekyll-seo-tag (~> 2.1) + minitest (5.14.1) + multipart-post (2.1.1) + nokogiri (1.10.8) + mini_portile2 (~> 2.4.0) + octokit (4.18.0) + faraday (>= 0.9) + sawyer (~> 0.8.0, >= 0.5.3) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + public_suffix (3.1.1) + rb-fsevent (0.10.4) + rb-inotify (0.10.1) + ffi (~> 1.0) + rexml (3.2.4) + rouge (3.19.0) + ruby-enum (0.8.0) + i18n + rubyzip (2.3.0) + safe_yaml (1.0.5) + sass (3.7.4) + sass-listen (~> 4.0.0) + sass-listen (4.0.0) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + sawyer (0.8.2) + addressable (>= 2.3.5) + faraday (> 0.8, < 2.0) + simpleidn (0.1.1) + unf (~> 0.1.4) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + thread_safe (0.3.6) + typhoeus (1.4.0) + ethon (>= 0.9.0) + tzinfo (1.2.7) + thread_safe (~> 0.1) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.7) + unicode-display_width (1.7.0) + zeitwerk (2.4.0) + +PLATFORMS + ruby + +DEPENDENCIES + github-pages + jekyll (>= 3.7) + kramdown (>= 2.3.0) + nokogiri (< 1.10.9) + +BUNDLED WITH + 2.0.2 diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 0000000..3db4580 --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1,63 @@ +repository: hamelsmu/ThinkPython2 +output: web +topnav_title: ThinkPython2 +site_title: ThinkPython2 +company_name: hamelsmu +description: A python library +# Set to false to disable KaTeX math +use_math: true +# Add Google analytics id if you have one and want to use it here +google_analytics: +# See http://nbdev.fast.ai/search for help with adding Search +google_search: + +host: 127.0.0.1 +# the preview server used. Leave as is. +port: 4000 +# the port where the preview is rendered. + +exclude: + - .idea/ + - .gitignore + - vendor + +exclude: [vendor] + +highlighter: rouge +markdown: kramdown +kramdown: + input: GFM + auto_ids: true + hard_wrap: false + syntax_highlighter: rouge + +collections: + tooltips: + output: false + +defaults: + - + scope: + path: "" + type: "pages" + values: + layout: "page" + comments: true + search: true + sidebar: home_sidebar + topnav: topnav + - + scope: + path: "" + type: "tooltips" + values: + layout: "page" + comments: true + search: true + tooltip: true + +sidebars: +- home_sidebar + +theme: jekyll-theme-cayman +baseurl: /ThinkPython2/ \ No newline at end of file diff --git a/docs/_data/alerts.yml b/docs/_data/alerts.yml new file mode 100644 index 0000000..157e162 --- /dev/null +++ b/docs/_data/alerts.yml @@ -0,0 +1,15 @@ +tip: '