Here is a [SageMath code](https://sagecell.sagemath.org/?z=eJxtkcFqwzAMhu-BvIOPNk0D3SCHwc6mt0Eg1-A5imNqK8Vxs_btZ7WErWl0stHH519yBz0zgK1WEcLZOqfCxFF85BlLVbNPNkHk4nHtx8A8s8iCQgP8vcDdYUGXfkP9I0YwEBrQcSTf3hd-__YfpZLJboI6D1P5peIg6ci9eIbIeSo0WQEvHkIKypu1aiHbv3R6i6Ga07OyVF3XzhAiXLnY5h4MdMl12h2KWbyml6VWOKLVyrVOfYNbu0x1p-5TVu0Ug0WzZmxPWMpdbwTWI0aLF3ju1BSNm2plullwHZN5lme0DEnSl8-tlr3IchrGHy5-ATEUfHc=&lang=sage&interacts=eJyLjgUAARUAuQ==) generating caterpillar graphs on $n$ nodes based on enriching a path graph with leaves. As an example it shows all such graphs on 6 nodes.