Write Blog Using Jupyter Notebooks and Pelican¶
Here is a quick reviev on how to write blog using Jupyter Notebook and python module pelican-jupyter. Not so much to write about, pelican-jupyter's docs are great. They may be read here: https://github.com/danielfrg/pelican-jupyter.
Pandas Useful Tricks
Introduction¶
Here I want to write a little about pandas that I play with sometimes and share some useful pandas methods. Notice the input data comes from module pydataset that comes with a bunch of popular dataset.
May JS be understood through Python
How I Learn JS
- codecademy.com
- 100 days of web with Python
Shrotly about problem
I once read a great article about JavaScript on realpython.com While learning JS you often think about how this portion of JS code could be written in Python. So I decided to white chunks …
read moreWrangling the Beatles song writing using Python in FME(Safe Software)
Namedtuple Can Become a Json
How Once I Needed To Converte namedtuple
Shrotly about problem
I once needed to make a json of following form from list of strings ["lorem", "ipsum"]
lorem_fields = [{
"tag": "input",
"name": "lorem",
"type": "text",
"human_label": "Lorem"
}, {
"tag": "input",
"name": "ipsum",
"type": "text",
"human_label": "ipsum"
}]
Code:
from collections import namedtuple …
Debugging it all
Setting Up for Python >= 3.7
python -m pdb
or
breakpoint()
when older python
import pdb; pdb.set_trace()
Basic commands
l (ll) list lines around breakpoint p (pp) pretty print n (ext) statement c (ontinue) program s (tep) into a function i (nteract) enter REPL !command (e.g. !help)
ressources …
read morePrivate Parameters Loading With Dotenv
Setting Environment Variables
Nice people from the Internet wrote here about how to use dotenv to pass around credentials that you want to keep private: https://help.pythonanywhere.com/pages/environment-variables-for-web-apps/. So I feel that it make sense and for different projects from now on I used python dotenv.
Set …
read moreConfigure Custom Domain
Set a custom domain for my GitHub Pages site
I have pelican powered static site and world can acces it at my github pages : thisAKcode.github.io
.
What if I want to be a fancy and get my own custom domain name and assign it to my GitHub Pages website …
Change Pelican Theme
Choose theme
html5-dopetrope is theme I like.
To choose theme for your blog add cloned theme repo to your pelican installation...
\venv\Lib\site-packages\pelican\themes
bash
cd \pelican themes
cp html5-dopetrope C:\blog_depend\venv\Lib\site-packages\pelican\themes
how to apply theme
.... ...
Plugins
You have to check whether your …
read moreEdit blog post using Pelican.
Instructions about editing blog using Pelican
This post continues the theme of the previous post on that topic. https://thisakcode.github.io/how-to-1-blogging-using-pelican.html
cd C:\blog_depend\venv\Scripts
activate
cd c:\thisAKcode.github.io\content
Edit existing file
If I am interested in editing …
read more