Just starred pyp [1] by hauntsaninja [2]. It’s an exciting project with a lot to offer.
Easily run Python at the shell! Magical, but never mysterious.
References:
[1]: https://github.com/hauntsaninja/pyp
[2]: https://github.com/hauntsaninja
Publishing rhythm
I like econchick’s [1] project interrogate [2].
Explain yourself! Interrogate a codebase for docstring coverage.
References:
[1]: https://github.com/econchick
[2]: https://github.com/econchick/interrogate
drawing ascii boxes
When creating cli’s I often want some nice full-width character. I find it tough to find them, and when I do half the time it is an image or something that cannot be copied 👿.
I rarely get very complex with my semi-manual ASCII art. I can do 98% of what I need with bars and corners. Using some simple full-width characters can really give your cli a nice clean look.
Example # [1]
I’d say 50% of what I need is just a full-width horizontal bar to give some visual flair or separation.
[2]
Bars # [3]
― ⍽ ⎸ ⎹ ␣ ─ ━ │ ┃
Square Corners # [4]
┌ ┍ ┎ ┏ ┐ ┑ ┒ ┓ └ ┕ ┖ ┗ ┘ ┙ ┚ ┛
Round Corners # [5]
╭ ╮ ╯ ╰ ╱ ╲ ╳
Harpoons # [6]
⃑ ⃬ ⃭ ↼ ↽ ↾ ↿ ⇀ ⇁ ⇂ ⇃ ⇋ ⇌ ⥊ ⥋ ⥌ ⥍ ⥎ ⥏ ⥐ ⥑ ⥒ ⥓ ⥔ ⥕ ⥖ ⥗ ⥘ ⥙ ⥚ ⥛ ⥜ ⥝ ⥞ ⥟ ⥠ ⥡ ⥢ ⥣ ⥤ ⥥ ⥦ ⥧ ⥨ ⥩ ⥪ ⥫ ⥬ ⥭ ⥮ ⥯
Double Boxes # [7]
═ ║ ╒ ╓ ╔ ╕ ╖ ╗ ╘ ╙ ╚ ╛ ╜ ╝ ╞ ╟ ╠ ╡ ╢ ╣ ╤ ╥ ╦ ╧ ╨ ╩ ╪ ╫ ╬
Dashed Boxes # [8]
┄ ┅ ┆ ┇ ┈ ┉ ┊ ┋╌ ╍ ╎ ╏
Connectors # [9]
├ ┝ ┞ ┟ ┠ ┡ ┢ ┣ ┤ ┥ ┦ ┧ ┨ ┩ ┪ ┫ ┬ ┭ ┮ ┯ ┰ ┱ ┲ ┳ ┴ ┵ ┶ ┷ ┸ ┹ ┺ ┻ ┼ ┽ ┾ ┿ ╀ ╁ ╂ ╃ ╄ ╅ ╆ ╇ ╈ ╉ ╊ ╋
Others # [10]
☐ ☑ ☒ ⫍ ⫎ ⮹ ⮽...
Check out rec [1] and their project safer [2].
🧷 A safer writer 🧷
References:
[1]: https://github.com/rec
[2]: https://github.com/rec/safer
creating the kedro-preflight hook
Kedro Hooks Intro - kedro hooks are an exciting upcoming feature of kedro
0.16.0. They allow you to hook into catalog_created,pipeline_run, and
node_run(nouns). With a before, or after (adjective). This really
reminds me of reacts lifecycle hooks, that let you hook into various state of
react web components. This is going to make kedro so extendable by the
community. I am super pumped to see what the community is able to do with this
ability.
kedro hooks are an exciting upcoming feature of kedro 0.16.0. They allow you to hook into catalog_created,pipeline_run, and node_run(nouns). With a before, or after (adjective). This really reminds me of reacts lifecycle hooks, that let you hook into various state of react web components. This is going to make kedro so extendable by the community. I am super pumped to see what the community is able to do with this ability.
What is Kedro [1]
If you are completely unsure what kedro is be sure to check out my what is kedro post
Docs # [2]
a w...
The work on autoflake [1] by fake-name [2].
Removes unused imports and unused variables as reported by pyflakes
References:
[1]: https://github.com/fake-name/autoflake
[2]: https://github.com/fake-name
Check out trys [1] and their project sergey [2].
A tiny lil’ static site generator
References:
[1]: https://github.com/trys
[2]: https://github.com/trys/sergey
📢 Announcing find-kedro
find-kedro is a small library to enhance your kedro experience. It looks through your modules to find kedro pipelines, nodes, and iterables (lists, sets, tuples) of nodes. It then assembles them into a dictionary of pipelines, each module will create a separate pipeline, and __default__ being a combination of all pipelines. This format is compatible with the kedro _create_pipelines format.
[1]
[2]
[3]
[4] # [5]
kedro is a ✨ fantastic project that allows for super-fast prototyping of data pipelines, while yielding production-ready pipelines. find-kedro enhances this experience by adding a pytest like node/pipeline discovery eliminating the need to bubble up pipelines through modules.
When working on larger pipeline projects, it is advisable to break your project down into different sub-modules which requires knowledge of building python libraries, and knowing how to import each module correctly. While this is not too difficult, in some cases, it can trip up even the most se...
Explicit vs Implicit Returns in Javascript
Often when reading through javascript examples you will find some arrow
functions use parentheses () while others use braces {}. This key
difference is that parentheses will implicitly return the last statement while
braces require an explicit return statement. It is important to understand the
difference between them because it is likely that you will find code examples
of both and trying to edit code written differently than you’re used to may
have unintended consequences.
[1] # [2]
Arrow functions are one-liner functions in javascript that have two main syntactical ways to create the code block. with parentheses and braces. Let’s take a look at both ways of creating arrow functions so that when we come accross them in the wild it will all make sense.
[3] # [4]
Here is an example of an arrow function that will implicitly return the last
statement without the return keyword. I believe that these are a bit more restricted
in that you cannot set variables inside them. They are ...
I’m impressed by alive-progress [1] from rsalmei [2].
A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations!
References:
[1]: https://github.com/rsalmei/alive-progress
[2]: https://github.com/rsalmei
I’m really excited about vim-quickui [1], an amazing project by skywind3000 [2]. It’s worth exploring!
The missing UI extensions for Vim 9 (and NeoVim) !! 😎
References:
[1]: https://github.com/skywind3000/vim-quickui
[2]: https://github.com/skywind3000
If you’re into interesting projects, don’t miss out on bashtop [1], created by aristocratos [2].
Linux/OSX/FreeBSD resource monitor
References:
[1]: https://github.com/aristocratos/bashtop
[2]: https://github.com/aristocratos
TIL: Bind arguments to dynamically generated lambdas in python
This past week I had a really weird bug in my
kedro [1] pipeline. For some reason data running
through my pipeline was coming out completely made no sense, but if I manually
request raw data outside of the pipeline it matched expectations.
NOTE While this story is about a kedro pipeline, it can be applied anywhere closures are put into an iterable.
[2] # [3]
After a few days of looking at it off and on, I pinpointed that it was all the way down in the raw layer. Right as data is coming off of the database. For this I already had existing sql files stored and a read_sql function to get the data so I opted to just set up the pipeline to utilize the existing code as much as possible, leaning on the kedro [1] framework a bit less.
I have dynamically created lists of pipeline nodes many times in the past, but typically I take data from kedro [1] input and use it in the lambda. I prefer the simplicity of using lambdas over functools.partial. It typically looks something like this.
#...
Looking for inspiration? autoreload [1] by stevekrenzel [2].
A small python script to watch a directory for changes and reload a process when a change is detected.
References:
[1]: https://github.com/stevekrenzel/autoreload
[2]: https://github.com/stevekrenzel
Check out madzak [1] and their project python-json-logger [2].
Json Formatter for the standard python logger
References:
[1]: https://github.com/madzak
[2]: https://github.com/madzak/python-json-logger
Four Github Actions for Python
If you are developing python packages and using GitHub here are four actions
that you can use today to automate your release workflow. Since python tools
generally have such a simple cli I have opted to use the cli for most of these,
that way I know exactly what is happening and have more control over it if I
need.
h2 img { width: 100%; box-shadow: .5rem .5rem 3rem #141F2D, -.5rem -.5rem 3rem rgba(255,255,255,.1);}
img{ max-width: 100% !important;}
If you are developing python packages and using GitHub here are four actions that you can use today to automate your release workflow. Since python tools generally have such a simple cli I have opted to use the cli for most of these, that way I know exactly what is happening and have more control over it if I need.
- Lint
- Test
- Package
- Upload to PyPi
Lint With flake8 # [1]
flake8 is pythons quintessential linting tool to ensure that your code is up to the standards that you have set for the project, and to help prevent hidden...
Check out justmarkham [1] and their project scikit-learn-tips [2].
🤖⚡ 50 scikit-learn tips
References:
[1]: https://github.com/justmarkham
[2]: https://github.com/justmarkham/scikit-learn-tips
Check out Textualize [1] and their project rich [2].
Rich is a Python library for rich text and beautiful formatting in the terminal.
References:
[1]: https://github.com/Textualize
[2]: https://github.com/Textualize/rich
Variables names don't need their type
So often I see a variables type() inside of its name and it hurts me a little
inside. Tell me I’m right or prove me wrong below.
Examples # [1]
Pandas DataFrames are probably the worst offender that I see
# bad
sales_df = get_sales()
# good
sales = get_sales()
Sometimes vanilla structures too!
# bad
items_list = ['sneakers', 'pencils', 'paper', ]
# good
items = ['sneakers', 'pencils', 'paper', ]
Edge Cases? # [2]
It’s so common when you need to get inside a data structure in a special way that itsn’t provided by the library…. I am not exactly sure of a good way around it.
# bad ??
sales = get_sales()
sales_dict = sales.to_dict()
# good
🤷♀️
Containers are plural # [3]
Always name your containers plural, so that naming while iterating is simple.
prices = {}
items = ['sneakers', 'pencils', 'paper', ]
for item in items:
prices[item] = get_price(item)
Before I start fights 🥊 in code review, am I inline here or just being pedantic?
References:
[1]: #examples
[2]: #edge-cases...
I’m really excited about cpython [1], an amazing project by python [2]. It’s worth exploring!
The Python programming language
References:
[1]: https://github.com/python/cpython
[2]: https://github.com/python
I recently discovered scully [1] by scullyio [2], and it’s truly impressive.
The Static Site Generator for Angular apps
References:
[1]: https://github.com/scullyio/scully
[2]: https://github.com/scullyio
I came across pydevto [1] from lpellis [2], and it’s packed with great features and ideas.
Unofficial dev.to api
References:
[1]: https://github.com/lpellis/pydevto
[2]: https://github.com/lpellis
I’m really excited about kedro-pandas-profiling [1], an amazing project by brickfrog [2]. It’s worth exploring!
A simple wrapper to use Pandas Profiling easily in Kedro
References:
[1]: https://github.com/brickfrog/kedro-pandas-profiling
[2]: https://github.com/brickfrog
The work on gregives.co.uk [1] by gregives [2].
Personal site and portfolio of software engineer Greg Ives
References:
[1]: https://github.com/gregives/gregives.co.uk
[2]: https://github.com/gregives
I’m impressed by act [1] from nektos [2].
Run your GitHub Actions locally 🚀
References:
[1]: https://github.com/nektos/act
[2]: https://github.com/nektos
Send Emails with GitHub Actions
Here is one useful thing that you can do with GitHub actions no matter what language you use, send email. You might want to know right away when your ci passes. You might want to give your team a nice pat on the back when a new release is deployed. There might be subscribers wanting to see the latest release notes in their inbox as soon as the latest version is deployed. Whatever it is, its pretty easy to do with an action right out of the actions marketplace.
Mail on Star # [1]
Here is a silly example that sends an email to yourself anytime someone stars your repo.
name: Mail on Star
on:
watch:
types: [ started ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "email"
email:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: ✨ Send email, you star
uses: dawidd6/acti...
I’m really excited about awesome-python-bytes [1], an amazing project by JackMcKew [2]. It’s worth exploring!
😎 🐍 Awesome lists about Python Bytes https://pythonbytes.fm/
References:
[1]: https://github.com/JackMcKew/awesome-python-bytes
[2]: https://github.com/JackMcKew
Check out get-diff-action [1] by technote-space [2]. It’s a well-crafted project with great potential.
GitHub Actions to get git [3] diff
References:
[1]: https://github.com/technote-space/get-diff-action
[2]: https://github.com/technote-space
[3]: /glossary/git/
If you’re into interesting projects, don’t miss out on react-toastify [1], created by fkhadra [2].
React notification made easy 🚀 !
References:
[1]: https://github.com/fkhadra/react-toastify
[2]: https://github.com/fkhadra
What Are GitHub Actions
GitHub actions are an amazing tool that allows us to run code based on triggers
inside of our repo. Their is a large and growing community of actions inside
the marketplace to use with very little effort. Best of all they are free for
public repositories, and private repos have a very generous free tier.
h2 img { width: 100%; box-shadow: .5rem .5rem 3rem #141F2D, -.5rem -.5rem 3rem rgba(255,255,255,.1);}
img{ max-width: 100% !important;}
I have been diving deep into Github actions for about a month now and they are wicked good! They allow you to run any sort of arbitrary code based on events in your repo, webhooks, or schedules. They are very reasonably priced. The interface that GitHub hs developed for them is top-notch! It’s so good I have done 90% of my editing of them right from github.com.
TLDR # [1]
some interaction to your repository triggers code to run.
[2] # [3]
The online editor for actions is pretty amazing. When creating a new workflow it automatically sets up a ...
Getting Started with GitHub Actions
Github actions are written in configuration files using the YAML syntax. YAML
is a superset of JSON. Most YAML can be expressed inline with JSON syntax.
Similar to python YAML is whitespace driven by whitespace rather than brackets
tags. The argument for using YAML for configuration files such as actions is
that it is more human-readable and editable. It’s much easier to see the
whitespace layout than it is to get closing brackets correct. For actions, I
believe this is mostly true. I don’t see any use case to get past 3-5 indents,
which is completely manageable.
Can I just say that I learned more than I realized about YAML by writing this
article
Arrays and Objects # [1]
In YAML or JSON, the most basic containers for data are arrays, a 1D list
of things, and objects, for key-value pairs.
Arrays # [2]
The start of an array container is signified with a leading -. This is
probably one of the big things I didn’t understand about YAML before writing
this post, but hats off to the ...
Check out poke95 [1] by wobsoriano [2]. It’s a well-crafted project with great potential.
🚀 A Windows 95 style Pokédex built with React.
References:
[1]: https://github.com/wobsoriano/poke95
[2]: https://github.com/wobsoriano
Looking for inspiration? img-resizer [1] by sharadcodes [2].
An action for resizing images
References:
[1]: https://github.com/sharadcodes/img-resizer
[2]: https://github.com/sharadcodes
Check out generate-changelog-action [1] by ScottBrenner [2]. It’s a well-crafted project with great potential.
GitHub Actions Hackathon 2020 winner - lob/generate-changelog Action
References:
[1]: https://github.com/ScottBrenner/generate-changelog-action
[2]: https://github.com/ScottBrenner
Today I learned `git diff feature..main`
Today I learned how to diff between two branches.
git diff feature..main
Sometimes we get a little git add . && git commit -m "WIP" happy and mistakenly commit something that we just can’t figure out. This is a good way to figure out what the heck has changed on the current branch compared to any other branch.
Example # [1]
Let’s create a new directory, initialize git [2] and toss some content into a readme.
mkdir git-diff
git init
echo "hello there" > readme.md
git add . && git commit -m "hello there"
cat readme.md
After all of that, we have a git repository on our local machine with a single file readme.md that contains the following.
hello there
Create a branch and ✍ edit # [3]
Let’s checkout a new branch called Waylon and change the word there to Waylon in our readme.md file, then diff it.
git checkout -b Waylon
echo "hello Waylon" > readme.md
git add . && git commit -m "hello Waylon"
git diff
- hello there
+ hello waylon
At this point we have one commit. Things are real...
Create New Kedro Project
This is a quickstart to getting a new kedro [1]
pipeline up and running. After this article you should be able to understand
how to get started with kedro [1]. You can learn
more about this Hello World
Example [2]
in the
docs [2]
🧹 Install Kedro [1]
🛢 Create the Example Pipeline
💨 Run the example
📉 Show the pipeline visualization
Create a Virtual Environment [3] # [4]
I use conda to control my virtual environments and will create a new environment called kedro_iris with the following command. note the latest compatible version of python is 3.7.
EDIT: as of kedro 0.16.0 kedro supports up to 3.8
conda create -n kedro_iris python=3.8 -y
image [5]
Options
Activate your conda environment # [6]
I try to keep my base environment as clean as possible. I have ran into too many issues installing things in the base environment. Almost always its some dependency that starts causing issues making it even harder to realize where its coming from as I never even installed it in base.
s...
DesktopECHO [1] has done a fantastic job with xWSL [2]. Highly recommend taking a look.
Installer script for Ubuntu 22.04 / 24.04 with XFCE 4.18 on WSL. Does not require hypervisor, container, or X11 server.
References:
[1]: https://github.com/DesktopECHO
[2]: https://github.com/DesktopECHO/xWSL
What is YOUR Advice for New Data Scientists
- Learn the business
- Learn Git [1]
- Your code does not need to be amazing
- Keep Learning
Learn Git # [2]
You dont have to start out as a git wizard with the cleanest possible commit history. At first dont let yourself get too wrapped up in it, the most important part is that you make commits. You will find needs for more advanced stuff later.
git add .
git commit -m "FEAT added new function to calculate revenue by product family"
git push
Get comfortable with this, then learn how to branch, rebase, stash, etc…
Your code does not need to be amazing # [3]
Get the job done. Keep it in small bite size pieces. Make readable function definitions and variable names. You will thank yourself for naming things well later. Readability counts more than performance in most cases of data science. If it gets the job done try not to over worry about things like performance. A few extra seconds to clean a dataset or build a model is not worth hours of your time. As you go you will have c...
The work on fastpages [1] by fastai [2].
An easy to use blogging platform, with enhanced support for Jupyter Notebooks.
References:
[1]: https://github.com/fastai/fastpages
[2]: https://github.com/fastai
Do You Hoist
I am working through Wes Bos’s
beginnerjavascript.com/ [1] I just hit module 18
on hoisting. It’s something that I always knew was there, Its not something I
typically see used or use myself.
Do you Hoist? # [2]
Do you have any use cases that you use hoising? Why? It seems like a really cool feature in any language that uses it, but I dont really notice it in use.
What is Hoising # [3]
There are many articles that cover this in far more depth, but its the idea that variable declarations and functions are defined before they are executed. This means that it doesnt matter if you call a function before or after it is defined.
Hoisting # [4]
console.log(`Hello ${getUser()}`)
function getUser() {
return 'Waylon'
}
Running this code will log out “Waylon”
What about variable hoisting # [5]
I am most familiar with python which does not variable hoist so this one kinda confused me at first. It only hoists the variable declaration not the value of the variable. It defines whether th...
What is Kedro
What is Kedro [1]
This is my original what-is-kedro article. There is a brand new one
---
Kedro is an open source data pipeline framework. It provides guardrails to set
your project up right from the start without needing to know deeply how to
setup your own python library for data pipelining. It includes really great
ways to manipulate catalogs and pipelines. This article will cover the 10K
view of kedro, future articles will dive deper into each one.
kedro [2] is an open-source data pipeline framework. It provides guardrails to set your project up right from the start without needing to know deeply how to set up your own python library for data pipelining. It includes great ways to manipulate catalogs and pipelines. This article will cover the 10K view of kedro [2], future articles will dive deeper into each one.
Libraries # [3]
Currently, kedro [2] is broken down into 3 different libraries.
💎 kedro [2]
📉 kedro-viz [4]
🏗 kedro-docker [5]
kedro [2] # [6]
[7]
kedro [2] ...
Looking for inspiration? termynal [1] by ines [2].
⬛️ Lightweight and modern terminal animations using async/await
References:
[1]: https://github.com/ines/termynal
[2]: https://github.com/ines
Looking for inspiration? forem [1] by forem [2].
For empowering community 🌱
References:
[1]: https://github.com/forem/forem
[2]: https://github.com/forem
Just starred typer [1] by fastapi [2]. It’s an exciting project with a lot to offer.
Typer, build great CLIs. Easy to code. Based on Python type hints.
References:
[1]: https://github.com/fastapi/typer
[2]: https://github.com/fastapi
Custom Scrollbar Design
Getting a custom scrollbar on your site makes it stand out a bit compared to
the very plain stock one that are on most sites. This is how I set mine up on
my gatsby site.
Inspired by Wes Bos’s new uses.tech [1] I wanted a custom
scrollbar on my personal site. I had tried to do it in the past, but gave up
after it was not working.
Looking at the Source # [2]
Since uses.tech [1] is open source I jumped on github, searched for scroll and found this layout.js [3].
Copy it to my own component # [4]
My first step was to take his css and copy it into a styled component for my entire layout, but it failed. I do not fully understand why. None of the custom style came through at all. If you know please leave me a comment.
[5]
I suspect for some reason it has to do with attatching to the html [6] element inside of a styled-component. I think wes was able to get around this by using createGlobalStyle. But I was still using much of the default gatsby template, so I did not have a createG...
localstack [1] by localstack [2] is a game-changer in its space. Excited to see how it evolves.
💻 A fully functional local AWS cloud stack. Develop and test your cloud & Serverless apps offline
References:
[1]: https://github.com/localstack/localstack
[2]: https://github.com/localstack
Don’t waste your time learning everything
“Don’t waste your time learning everything.”
[1]
LinkedIn Post from Tarry
Inspired by this linkedIn post [2]
I felt that this comment was very powerful. Here are my 2 cents.
Be Productive # [3]
Stick to what you know, and learn a little bit of something new every day. If what you know is how to use Excel like a boss, don’t fee ashamed that you are missing something. Be proud and use what you know.
Don’t Stagnate # [4]
Take small steps enhance what you know now with something new that you get you closer to where you want to be. If you need something that sci-py offers learn how to load in data and use that part. If your sick of waiting for IT to pull data out of the database so you can use it, learn that.
Dont Overwhelm Yourself # [5]
If you try to drop everything you know now and jump whole hog into these new flashy things its not going to work. Learn what you need to know. New things crop up very often. They will come and go. Some things will get traction, some will never...
Canop [1] has done a fantastic job with broot [2]. Highly recommend taking a look.
A new way to see and navigate directory trees : https://dystroy.org/broot
References:
[1]: https://github.com/Canop
[2]: https://github.com/Canop/broot
I’m impressed by gitdown [1] from calebporzio [2].
A simple package to parse Github Flavored Markdown in PHP
References:
[1]: https://github.com/calebporzio/gitdown
[2]: https://github.com/calebporzio
I like benawad’s [1] project destiny [2].
Prettier for File Structures
References:
[1]: https://github.com/benawad
[2]: https://github.com/benawad/destiny