8

Cog resurgence | Ned Batchelder

 2 years ago
source link: https://nedbatchelder.com/blog/202201/cog_resurgence.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Cog resurgence

My cog tool has been having a resurgence of late: a number of people are discovering it’s useful to run a little bit of Python code inside otherwise static files.

It took cog 17 years to become an overnight success :)
(first posted Feb 2004: https://t.co/Zmtrdy0by9) https://t.co/DON9THZ5wh

— Ned Batchelder (@nedbat) November 22, 2021

Hynek Schlawack used it to de-duplicate his pyproject.toml:

As a test balloon, I’ve switched structlog from https://t.co/PihDrIF58S to flit w/ pyproject.toml in combination with @nedbat’s cog to maintain some deduplication. I think I like it! Sharp tools that do one thing well FTW.https://t.co/w2RM4Ckyke

— Hynek Schlawack (@hynek) November 17, 2021

Automator extraordinaire Simon Willison started using it to keep docs up to date:

I’ve been solving so many documentation problems with @nedbat’s cog tool recently - it’s fantastic for keeping documentation automatically up-to-date, in Markdown or rST)

Here’s a new page of sqlite-utils docs showing --help for every CLI command! https://t.co/Dwef9p2h8P pic.twitter.com/8tyfyfe7AT

— Simon Willison (@simonw) January 11, 2022

Brett Cannon even called it trendy!

A quick, public thanks to @nedbat for creating Cog; I did the “trendy” thing and used Cog to automate the README for the Python Launcher for Unix (instead of using my home-grown solution). Makes editing the README simple again!https://t.co/F5jnqgW7cG

— Brett Cannon (@brettsky) December 31, 2021

Of course, some people were using it before it was cool.

With all this buzz(!), Tobias Macey invited me on podcast.__init__ to talk about it: Episode 347: Generate Your Text Files With Python Using Cog. It was fun to talk about this little tool I wrote nearly 18 years ago that has been plugging away all this time, and is now being re-discovered.

Even I am finding new uses for cog. I started using it to keep coverage.py docs up to date, I built my crazy over-engineered GitHub profile (source) with it, and I even used it on the source file of this blog post to pull in the tweets!

#cog» react

Comments

Add a comment:

Name:
Email:
Web site:
Name is required. Either email or web are required. Email won't be displayed and I won't spam you. Your web site won't be indexed by search engines.
Comment:
Comment text is Markdown.
Email me future comments on this page   

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK