Version: 0.7.1
Last Updated: Unknown
Use this tempalate to generate new lift projects.
| Variable | Data Type | Info |
|---|---|---|
name | string | Name of the blog post |
1---2basedir: content/blog3---4---5date: "<%= name.split('-').filter((_data, index) => index < 3).join("-") %>"6image: https://cdn.dennisokeeffe.com/assets/<%= name %>/main-image.png7title: <%= _.startCase(name.split('-').filter((_data, index) => index >= 3)) %>8description: <%= description %>9tags: "beginner,python,100daysofpython"10icons: "dok,python"11series:12 - "100 Days of Python": 013---1415> This is Day TODO of the #100DaysOfPython challenge.1617This post will use the ... library to ... .1819The final code can be found on my GitHub repo [`okeeffed/<%= name.split('-').filter((_data, index) => index >= 3).join("-") %>`](https://github.com/okeeffed/<%= name.split('-').filter((_data, index) => index >= 3).join("-") %>).2021## Prerequisites22231. Familiarity with [Pipenv](https://pipenv.pypa.io/en/latest/). See [here](https://blog.dennisokeeffe.com/blog/2020-07-04-abcs-of-pipenv) for my post on Pipenv.242. Familiarity with [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/gettingstarted/install.html). See [here](https://blog.dennisokeeffe.com/blog/2021-07-19-hello-jupyter-notebook) for my post on JupyterLab.253. ...2627## Getting started2829Let's create the `hello-world` directory and install Pillow.3031```s32# Make the `hello-world` directory33$ mkdir hello-world34$ cd hello-world35# Create a folder to place your icons36$ mkdir icons3738# Init the virtual environment39$ pipenv --three40$ pipenv install pillow41$ pipenv install --dev jupyterlab42```4344At this stage, ...4546Now we can start up the notebook server.4748```s49# Startup the notebook server50$ pipenv run jupyter-lab51# ... Server is now running on http://localhost:8888/lab52```5354The server will now be up and running.5556## Creating the notebook5758Once on http://localhost:8888/lab, select to create a new Python 3 notebook from the launcher.5960Ensure that this notebook is saved in `hello-world/docs/<your-file-name>`.6162We will create four cells to handle four parts of this mini project:63641. ...6566## ...6768This section simply loads the image in var `base_img` (assuming you are following the directory structure where the notebook is in the `docs` folder).6970```py71from PIL import Image72# Concatenating an image73base_img = Image.open('../base_img.png')74```7576## Summary7778Today's post demonstrated how to use the `Pillow` package to add text and icons layers to an image programmatically.7980This will be the technique I use for helping to build out my blog post main images (including this one!).8182## Resources and further reading83841. [The ABCs of Pipenv](https://blog.dennisokeeffe.com/blog/2020-07-04-abcs-of-pipenv)852. [Hello, JupyterLab](https://blog.dennisokeeffe.com/blog/2021-07-19-hello-jupyter-notebook)863. [Pipenv](https://pipenv.pypa.io/en/latest/)874. [`okeeffed/<%= name.split('-').filter((_data, index) => index >= 3).join("-") %>`](https://github.com/okeeffed/<%= name.split('-').filter((_data, index) => index >= 3).join("-") %>)8889_Photo credit: [`user`](https://unsplash.com/@user)_
1---2date: "<%= name.split('-').filter((_data, index) => index < 2).join("-") %>"3image: https://cdn.dennisokeeffe.com/assets/<%= name %>/main-image.png4title: TODO5description: TODO6tags: "beginner,python,100daysofpython"7icons: "dok,python"8---910> This is Day TODO of the #100DaysOfPython challenge.1112This post will use the ... library to ... .1314## Prerequisites15161. Familiarity with [Pipenv]. See [here](https://blog.dennisokeeffe.com/blog/2020-07-04-abcs-of-pipenv) for my post on Pipenv.172. Familiarity with [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/gettingstarted/install.html). See [here](https://blog.dennisokeeffe.com/blog/2021-07-19-hello-jupyter-notebook) for my post on JupyterLab.183. ...1920## Getting started2122Let's create the `hello-world` directory and install Pillow.2324```s25# Make the `hello-world` directory26$ mkdir hello-world27$ cd hello-world28# Create a folder to place your icons29$ mkdir icons3031# Init the virtual environment32$ pipenv --three33$ pipenv install pillow34$ pipenv install --dev jupyterlab35```3637At this stage, ...3839Now we can start up the notebook server.4041```s42# Startup the notebook server43$ pipenv run jupyter-lab44# ... Server is now running on http://localhost:8888/lab45```4647The server will now be up and running.4849## Creating the notebook5051Once on http://localhost:8888/lab, select to create a new Python 3 notebook from the launcher.5253Ensure that this notebook is saved in `hello-world/docs/<your-file-name>`.5455We will create four cells to handle four parts of this mini project:56571. ...5859## ...6061This section simply loads the image in var `base_img` (assuming you are following the directory structure where the notebook is in the `docs` folder).6263```py64from PIL import Image65# Concatenating an image66base_img = Image.open('../base_img.png')67```6869## Summary7071Today's post demonstrated how to use the `Pillow` package to add text and icons layers to an image programmatically.7273This will be the technique I use for helping to build out my blog post main images (including this one!).7475## Resources and further reading76771. [The ABCs of Pipenv](https://blog.dennisokeeffe.com/blog/2020-07-04-abcs-of-pipenv) for the minimum you will need.782. [Hello, JupyterLab](https://blog.dennisokeeffe.com/blog/2021-07-19-hello-jupyter-notebook).793. [Pillow image library](https://pillow.readthedocs.io/en/stable/)