4 ms·
> I would like to have a tool that generates the project structure for me, but I haven’t found one that fits me yet. I recommend cookiecutter for this. I have
by simonw 1y ago
> I would like to have a tool that generates the project structure for me, but I haven’t found one that fits me yet.
I recommend cookiecutter for this. I have a few templates I've built with that which I use frequently:
python-lib: https://github.com/simonw/python-lib https://github.com/simonw/python-lib
click-app: https://github.com/simonw/click-app https://github.com/simonw/click-app
datasette-plugin: https://github.com/simonw/datasette-plugin https://github.com/simonw/datasette-plugin
llm-plugin: https://github.com/simonw/llm-plugin https://github.com/simonw/llm-plugin
You can run them like this:
uvx cookiecutter gh:simonw/python-lib
- timkpaine 1y agoCopier is the new hotness for this https://copier.readthedocs.io/en/stable/ https://copier.readthedocs.io/en/stable/
- deleted 1y ago[deleted]
- oezi 1y agoMy take on this (using Ruby) is https://github.com/coezbek/baker https://github.com/coezbek/baker It doesn't copy template repos, but rather creates a list of imperative steps to perform. Steps can be both manual (obtain an API key and store it here) and automatic (run 'uv init'). Markdown syntax, ruby string interpolation and bash. It came from a deep hate for yml based configs.
- mmcnl 1y agoAm I the only one who actually likes setting up new projects? I don't want to automate that.
- serial_dev 1y agoIt depends on your work, though… If you work at an agency or as a freelancer and you build various similar apps with similar tooling and base setup, being able to scaffold and have them all setup quickly, not having to do it manually and waste hours id important. Similarly, if you work on various small open source packages, you want the tooling to be the same, READMEs look the same, etc, a script or tool to “spit out” the basic structure can be nice. On the other hand, if you set up the app or larger open source package and you’ll work only on that project for potentially years, setting up a project individually, organically makes a lot of sense.
- bshacklett 1y agoI’m legitimately curious about what you enjoy and why. Rewriting boiler plate code and trying to ensure that I get everything right with a process I don’t often execute is the very definition of toil to me.
- mmcnl 1y agoIt allows me to gain a basic understanding of the fundamentals of my code base.
- consumer451 1y agoThis type of thing seems ripe for building into agentic LLM dev workflows, doesn't it?
- didip 1y agoHonestly, these days, just tell AI to generate one for you.
- mrbonner 1y agoHmm never heard of this. Thanks for the recommendation.
- zahlman 1y agoI made a small wrapper for cookiecutter, to handle some minimal Git integration (making a repo and doing the first commit) and to match my workflow better (write some initial code first, then transform it into a "project folder" in place): https://github.com/zahlman/cookiebaker https://github.com/zahlman/cookiebaker I'm not a huge fan of cookiecutter on aesthetic principles, though. I think it's chosen some needlessly heavyweight dependencies for such a simple task. PyYAML comes with a big chunk of compiled C, while performance is really not going to matter and I'd rather use TOML anyway. I've yet to see a project depending on Rich that uses more than a tiny portion of it; this is no exception. More to the point, Rich brings in the much larger Pygments (for syntax highlighting; most of the bulk is actual syntax definition rules for a variety of programming languages) and you can't disable that. And honestly I'm not a fan of the whole "download other people's templates using an integrated client" model anyway; Requests and its dependencies are pretty bulky, too.
- rahimnathwani 1y agoI looked at the click-app repo. If you were creating that today, would you switch from uv to pip? And to run cookiecutter do you still use pipx, or have you switched to `uv tool install`
- simonw 1y agoI'm getting close to switching to uv for my templates. I use "uvx cookiecutter" myself three days.