Just starred pyp by hauntsaninja. It’s an exciting project with a lot to offer. Easily run Python at the shell! Magical, but never mysterious.
Publishing rhythm
I like econchick’s project interrogate. Explain yourself! Interrogate a codebase for docstring coverage.
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 # I’d say 50% of what I need is just a full-width horizontal bar to give some visual flair or separation. Bars # Square Corners # Round Corners # Harpoons # Double Boxes # Dashed Boxes # Connectors # Others # Arrows # Rounded Box # Resources # As I was putting this together I stumbled accross a good site to find ascii characters and copy them. Unicode Full-Width Characters
Check out rec and their project safer. 🧷 A safer writer 🧷
creating the kedro-preflight hook
Kedro Hooks Intro - kedro hooks are an exciting upcoming feature of kedro. They allow you to hook into,, and (nouns). With a, or (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. They allow you to hook into,, and (nouns). With a, or (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 If you are completely unsure what kedro is be sure to check out my what is kedro post Docs # a work in progress As this is a part of an upcoming release you will need to look in the docs, not and you will find a 15_hoooks pa…
📝 Kedro Preflight Notes
This is a very rough idea for a kedro package to prevent time lost to get partway through a pipeline run only to realize that you dont have access to data or resources. Must Haves # check that inputs exist or are of a type to skip (sql) Good to haves check that all input and output databases are accessible with good credentials check for s3 bucket access check for spark install Implementation # run params #
The work on autoflake by fake-name. Removes unused imports and unused variables as reported by pyflakes
Check out trys and their project sergey. A tiny lil’ static site generator
📢 Announcing 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 being a combination of all pipelines. This format is compatible with the kedro format. # is a ✨ fantastic project that allows for super-fast prototyping of data pipelines, while yielding production-ready pipelines. 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 senior engineers, losing precious feature development time to debugging a library. # is deplo…
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. # 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. # 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 a little bit more concise and g…
Twitter deepdives
Inspired by Chris Achard My ideas # Python # List comps Classes Inheritance Background Click Lambdas Kedro # Cataloging Custom datasets Reusable pipelines find-kedro Learn kedro in 5 days # Email course inspired by learn d3 in 5 days Mail # Share your knowledge Practice Practice in public Make practice easy Share your notes Digital Gardening Own your content Build your audience Be nice Have empathy Learn your way Continuous learning
I’m impressed by alive-progress from rsalmei. A new kind of Progress Bar, with real-time throughput, ETA, and very cool animations!
I’m really excited about vim-quickui, an amazing project by skywind3000. It’s worth exploring! The missing UI extensions for Vim 9 (and NeoVim)!! 😎
If you’re into interesting projects, don’t miss out on bashtop, created by aristocratos. Linux/OSX/FreeBSD resource monitor
TIL: Bind arguments to dynamically generated lambdas in python
This past week I had a really weird bug in my kedro 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. # 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 files stored and a 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 framework a bit less. I have dynamically created lists of pipeline nodes many times in the past, but typically I take data from kedro input and use it in the lambda. I prefer the simplicity of using lambdas over. It typically looks something like this. What was different this time is that I needed to pass in the…
python-deepwatch
Is it possible to deep watch a single python function for changes? Shallow Watch # keeping track of a python functions hash is quite simple. There is a method attached to every python function. Calling it will return a hash of the function. If the function changes the hash will change. Using hashlib provides a consistent hash. Now we have a consistent way to hash function code. Deep hashing # Find dependencies # setup a function in a module with a dependency Create Generic module importer by filepath # get code of dependency # the inspect module can tell us the filename of our current module. now we can hash the dependency
Looking for inspiration? autoreload by stevekrenzel. A small python script to watch a directory for changes and reload a process when a change is detected.
Check out madzak and their project python-json-logger. Json Formatter for the standard python 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. 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 # 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 bugs. I am a heavy user of and as well, but for ci flake8 is typically considered the gold standard. and will help you automate many fixes suggested by flake8…