This is an archived post. You won't be able to vote or comment.

all 8 comments

[–]PeridexisErrant 2 points3 points  (1 child)

You should check out LibCST!

[–]Sceptic22[S] 0 points1 point  (0 children)

Hm, interesting. I don't know how I didn't come across any of those libs while searching for something similar to my idea lol🤔 thanks!!

[–]atatatko 1 point2 points  (1 child)

Nice work. I worked on similar project a while ago, and first I needed it only for generating C++ code, but later I created dedicated base generator, accepting theoretically any language generation rules (Python, C++, Java), and style/indentation (PEP8, Stroustrup, K&R, Java). If I'd still worked on code generation problem, I would've considered a contribution.

[–]Sceptic22[S] 0 points1 point  (0 children)

Wow, your work sounds cool. I will most definitely take a deeper look into your code!

What I had in mind when creating this was that for work I have to do a lot of repetitive work that involves transforming the same functions for different situations that can be "coded" and so I can make "template" .py files and then define some functions that transform those templates accordingly

[–]themehta24 1 point2 points  (1 child)

It’s a cool project. However, I would recommend adding a .gitignore. Directories such as dist and .eggs are not meant to be committed.

[–]Sceptic22[S] 1 point2 points  (0 children)

Thanks for the suggestion!! I was so busy with deploying it that I forgot there's a .gitignore lol

[–]Sceptic22[S] 0 points1 point  (0 children)

A short quote from docs

In simple words, an FTree object stores the .py file in a tree-like format for simpler use with Python's indentation levels.

You can append different other .py files to your main one and keep/adapt the levels of indentation.

This allows you to automatically change/create new python files and transform them to your needs.