Pytterns banner

Pytterns

7 devlogs
15h 21m 57s

RUN THIS BEFORE A VOTE! THIS IS A PROGRAMMER's DREAM

Ever wondered methods to make your terminal based apps look good, without much effort?
This is Pytterns. An extremely easy and beginner friendly framework to spice up your UI.

With…

RUN THIS BEFORE A VOTE! THIS IS A PROGRAMMER’s DREAM

Ever wondered methods to make your terminal based apps look good, without much effort?
This is Pytterns. An extremely easy and beginner friendly framework to spice up your UI.

With Pytterns, you can easily make Good Looking UI with 1 LINE OF CODE! Extremely Beginner Friendly!!

AND IT IS 100% CUSTOMIZABLE AND YOU CAN MAKE YOUR OWN THEMES!

This is the next level of UI Generation!
A LOT more updates coming soon!

This project uses AI

Gemini used for Code Analysis and security check.
Chatgpt used for research
Github Autocomplete in VS for speed & help in tricky patterns

The code in which AI was used is clearly marked with comments.

Demo Repository

Loading README...

brahmtejsawhney

BIG STUFF! (SEE ATTACHED VIDEO)

Changelog (WORK IN PROGRESS)

  • Started work on adding 3d Shapes in terminal
  • Working on a revolving or static Cube in terminal
  • Working on Security Bypass function (To allow running blacklisted keywords)

Challenges

Making a cube in a terminal, in a framework like pytterns is extremely hard. It needs super complex maths, including weird trigonometry and high level functions. They were EXTREMELY tricky to get right.

Another challenge was to make a formula which worked on ALL the sizes, and also it worked on all the angles.

Most importantly, each line drawn should have its unique identity, so coloring could be done right.

The output had to be bypassed from the pytterns file, and centering had to be processed locally because of the complexity.

Learning & Overcoming Challenges

I learnt how to work with complex arrays
I learnt how to actually draw edges from one point to another in terminal
I learnt how to fetch terminal sizes

Future Updates

Il be adding more shapes and stuff to this to make it actually production ready and usable.

AI Disclosure

Some significant google searching and use of AI was done for this devlog as some really complex math was used to render the cube in terminal. All the codeblocks which had AI Involvement are marked through comments in the code with full disclosure.


Video Attached: Videos of cubes of different sizes and char being rendered through pytterns from 1 Line of code for the user!

Thanks for reading this 💖
Stay Tuned!

0
brahmtejsawhney

Changelog

  • Added patterns cache
  • Performance Enhancement

Challenges

Everytime I ran a pattern in a loop, with screen clearing each time, it created a short blank screen, which looked odd. (You can see this in the video in the devlog below)

This was because the framework read the pattern file from disk every single time it ran, causing a slight delay. Even though due to multiple reads, the file goes into the disk cache, it still gave a little visible black screen.

To fix this, I have added caching, which stores the function in ram. We can make it so it preloads functions on boot, else it would keep the function in cache whenever its first run, so till the time the software is running, it always fetches from ram.

Learning & Overcoming Challenges

I learnt how to store stuff in cache/ram
I learnt how to access files repeatedly, really fast
I learnt how disk, disk cache, ram and cpu cache work

Future Updates

More patterns and features, making it more usable in actual real world programs.

AI Disclosure

No significant AI was used for this devlog. All the codeblocks which had AI Involvement are marked through comments in the code with full disclosure.


Video Attached: Its the same video of the devlog below, showing the slight blank screens which are visible on updates.

Thanks for reading this 💖
Stay Tuned!

2

Comments

brahmtejsawhney

Sorry! Wrong Video attached

brahmtejsawhney

See the devlog below for the right video

brahmtejsawhney

New Feature! 🎉

BTW, This devlog contains a VIDEO!! Check it out

Changelog

  • Progress Bars
  • Custom Progress Bar Colors and Char
  • Completely fixed panel Title Coloring
  • Banner Mode added to panel

Challenges

I have added progress bar, This was quite a simple process till the time I decided to add colors and stuff. The code got quite messy as the getattr is blocked for security reasons, I had to take some help from AI to successfully add colors through a bit more complex method. It was quite fun and straightforward process, not much difficulties.

Learning & Overcoming Challenges

I learnt how to make progress bars in python
I learnt how to color stuff properly in ASCII
I learnt how to display live cpu use and other stats in terminal (progress bar graph)

Future Updates

Just progress bars isnt enough, I would be adding a lot more shapes and patterns to this project. Im thinking of adding shapes like a kitty or something just for fun.

Il also work on some multithreading and performance enhancement to reduce the time it takes to display the progress bar, so there is no black blank screens in between.

AI Disclosure

Perplexity was used for code cleanup and fixing bugs I had with coloring. . All the codeblocks which had AI Involvement are marked through comments in the code with full disclosure.


Video Attached: Shows the live graph of cpu usage through Pytterns progress bar

Thanks for reading this 💖
Stay Tuned!

0
brahmtejsawhney

This is the first devlog after my previous ship.
I read all your comments, and they are just soo nice. Thankyou for all your support guys. 💝

Changelog (WIP)

  • Lisence typo renamed to License (Thanks for informing in vote review)
  • Working on fixing path system to make project work in compiled/packed environments too (Eg. exe)
  • Working on Tables, Banners, and more shapes
  • Bug in text centering in panel title

Challenges

The program just used normal OS to get the path of the module and detect the patterns/ folder. This worked good in normal day to day running, but if any project which was using pytterns had to be built into an exe or binary, it would stop working due to those path errors, and cause the entire build to be useless. This is fixed now by integrating sys.

Learning & Overcoming Challenges

I have received a TON of positive comments about originality and storytelling, and I cant help but thank you all for all your words. Lots of people seem to plan on using this once this project is complete and is packed with lots of features. Thanks for your motivation and time.


Attached Image: Shows reviews put by users.

Thanks for reading this 💖

Attachment
0
brahmtejsawhney

Shipped this project!

Hours: 3.64
Cookies: 🍪 84
Multiplier: 22.99 cookies/hr

Pytterns V 0.1 is all READY!

Pytterns is all set for your next terminal project’s UI.
The framework works flawless, and thanks to my friends, everything is now tested multiple times to ensure it can fit any kind of project with ease.

Do use it once before putting your votes. Download files from github.

Thankyou everyone for supporting me this much in this project through your sweet reviews.

Thanks Hack Club for making this happen!

Good Luck! 💖

brahmtejsawhney

Version 1.0

Changelog

  • Fixed all the bugs (Which were found)
  • Added new shapes
  • Documentation IMPROVED

Challenges

The program had some bugs, which made it a bit incompatible with general projects. But thanks to my friend’s help, we overcame all the issues and this is now PERFECT!

Learning & Overcoming Challenges

I have received a LOT of positive comments from ALL OF YOU GUYS! and this is genuinely very big for a little programmer like me. Some of you also helped point out bugs and suggested features, which I implemented.


This was a wonderful project, which would not have been possible without Hack Club, and all the lovely voters 💖

Now, I release Pyttern’s First Stable release.

Version 1.0


Thanks for reading this 💖

Attachment
0
brahmtejsawhney

Shipped this project!

Hours: 2.24
Cookies: 🍪 28
Multiplier: 12.43 cookies/hr

The project is ready for shipping.

I have added pt.panel() which is now completely stable and functional. It also supports Individual Line Coloring of content.

Please make sure to run this and have an experience before voting on it. PyPi has the latest Stable release, whereas Github has the all feature version.

Download from Github. That would give access to all the features!

Good Luck Designing!

brahmtejsawhney

From now, Il improve my Story Telling, and make this project more fun and more beginner friendly.

I believed that Just Patterns in a terminal isnt enough. What if we had options for making a proper Panel or Checklist style UI.

Version 0.1.1.2

Changelog

  • Added pt.panel()
  • Changed how centering works & stuff to make it more usable

And that’s how I added the pt.panel(), it makes a flawless and easiest to create panel which adapts to content and has TONS of customization, easy to use for beginners. It can be used in Loops to make superb looking Dynamic UI to display information. (Example code in git readme)

Challenges

The BIG challenges here were the changes I had to do in Pytterns.py main file because the color codes were counted as characters by len() , even though they are invisible. This completely messed up the ENTIRE centering system. Also, that white cursor blinking bar thing, was too irritating as it appeared on random areas of the screen while UI was Dynamically Updating.

Learning & Overcoming Challenges

I learnt a LOT while making this, because I haven’t ever messed this much with the terminal ever.

  • I learnt how to hide that white cursor thingy
  • I learnt how to make terminal graphics less lagy (Limitation of previous version solved)
  • I learnt to handle the complex coordinate geometry of ANSI buffers so the user doesn’t have to.

Future Work Includes

  • Better Panel Creation and Editing
  • Creation of Tables
  • Multiple Designs in Panel
  • And More..

AI Disclosure

I used Gemini to help with trickier parts of this update.
Specifically, I used it to nail the math and advanced parts of the panel.py file.
(ANSI codes dont work well with len()..) and to fix some bugs related to border colors breaking due to Content’s Colors.

Thanks for reading this 💖

Attachment
Attachment
0
brahmtejsawhney

Shipped this project!

Hours: 5.47
Cookies: 🍪 25
Multiplier: 4.56 cookies/hr

I built Pytterns, an open source library for adding shapes and patterns to your python code with Ease!

With this, Python Devs can add shapes and designs to their terminal software with 1 line of code. This is especially helpful for those who are making software in CLI based OS, where good UI Editing is suggested for clean and mess free code operation.

I learnt a lot of things with this, I learnt github, PyPi, Functions, Colorama, Shutil, and a LOT more.

This was big achievement for me, as it was my first ever publicly launched python library
It is a system in which contributors can add more patterns in the default pack and it would get added in the next update.

I am planning to do a lot of updates in this, and the next big thing which I would be adding would be features to write text in boxes and set them on different areas of screen with ease and add borders and gradient color options.

The challenging part was the security, because anyone could put any malicious file as a template and it would trigger it all. I had to research on AI Tools like chatgpt for a fix for this, and a temp fix which I found which works quite good is a keyword ban method. If a template contains some potentially malicious keywords, it doesnt trigger it.

Although this has lead to a challenge of making the terminal smooth. If we spam the functions to make graphic animations, it works, but it is also a bit lagy. Il be working on that in next update too.

Overall, this feels like a solid project to me, and I hope people use this to make their Terminal UI better once its ready and built completely.
Hope you share your Pyttern Design Templates with me in github. Il be happy to merge them in!

brahmtejsawhney

Hello World!
The Basic structure of the platform is working! Security features are also operational and it is working with Linux and Windows Environments.

Custom Patterns can be added through /patterns folder in the project root directory, which is being picked up correctly after version 0.1.1 on PyPi

There are 2 Types of Pattern Templates. The default one and the custom project ones.
Default ones are stored in the library’s root. The Project’s Templates are stored in the /patterns folder in the project’s root, containing .py file for the template.

In the template, from now we MUST define size and center in the function’s define statement. If any other parameter is required, we can just add it in the template file, and it would be picked up by the library by itself and you can use that arg in the function trigger statement seamlessly!

Reply to: “Show your project’s output, not your code editor. Screenshots of code (e.g. VS Code) won’t be accepted — your repo is already linked! Upload a screenshot or video of what your project actually does.”

Images attached below show the running version with custom template. I am not showing the code in the images, thats only for reference if someone wants to replicate, Output is visible in the images

Attachment
Attachment
0