A nice workflow for creating Python projects with AI

A nice workflow for creating Python projects with AI

First, create a new project using poetry

poetry new asciinema-editor

This gives you a nice, clean new project structure.

.
├── README.md
├── asciinema_editor
│   ├── __init__.py
├── poetry.lock
├── pyproject.toml
└── tests
    └── __init__.py

Now, let the model know that you have this project structure and ask it to write you code. Claude does a nice job of providing the relevant bits to make your project work nicely.

  • e.g. __main__.py (see TIL on this)
  • Exposes the relevant main function in __init__.py making it easier to import and use the package in other scripts if needed.

links