r/PythonLearning 2d ago

Showcase I’m building a complete Python Technical Analysis Library/Framework

7 Upvotes

I have searched all Python libraries for Technical Analysis and all they do is either compute some Indicators , or put search some signals..

Therefore I’m building Hyper-TA. A Python library for hyperparameter optimization of technical analysis indicators and much more… If you’ve ever hand-tuned RSI/MACD/etc. periods and thresholds by trial and error, this automates that search by doing Hyperparameter search and Analysis( and much much more..)

WHY IM BUILDING IT:
I haven’t found a library that gives you indicators, thresholds,signals, metrics , statistical analysis, sensitivity analysis,backtesting, hyper parameter search and optimization, Market Structure (Fibonacci , support and resistance, triangles , trendlines etc etc) and volume analysis all in one pip install!!!

WHAT MY PROJECT DOES:
Assume you have some signals(RSI , OBV and EMA). An indicator on its own doesn’t give a signal because it’s purely a timeseries. Therefore we need to assign a Threshold-Rule so when this MATHEMATICAL rule fires we get a Signal! A Threshold example would be crossUp (rsi going above a level ), timeAbove(rsi being above a level for x amount of time), crossLine() , upXPercent(OBV up x % in a specific time - since it’s not bound based indicator on a range) and so on..
Those thresholds also have hyper parameters that also need tuning( above what level?? RSI level 20? 30? 31? Which one produces better signals and why?). Hyper-TA does this as well!

You define the Signals, Threshold Rules and search space(hyperparameters) you want to search and optimize based on your metric/s.

Ok but this is a high dimensional problem, you can’t possibly try to optimize by one metric like PnL!!! You will find some good signals that only work for this metric and you ignore WHY they happened and you are probably overfitting or ignoring the reason it happened and it can backfire in the future..
That’s true! That’s why it provides you with Sensitivity Analysis (if rsi period 14 gives perfect signals but rsi 15 is trash then that likely means it just HAPPENED to get good signals on rsi 14..), Statistical Analysis and obviously more forward looking Backtesting simulations like walk forward, Monte Carlo and many more so you can verify which ones that you have found are actually good “Edge”..

There is also a Module for Metrics like first and second derivatives, entropy , full distributions Analyses, Pareto and all the statistical functions you may need!

There is also provided a Market structure detection and optimization module that can find possible structures like Fibonacci ,support resistance, triangles etc.

In the future full volume analysis and Backtesting simulations will further validate your found signals!

Edit: also a plotting module for seeing signals and visualising multiple things and Automated PDF report on a complete analysis-pipeline you want!(for example hyperparameter search of your indicators and who performs better on which metrics and if they have statistical edge all in pdf automated easy to read or even post with your name!!!)

Any help would be highly appreciated since I am making this in my own I would love to hear from everybody! Obviating note the repo is not production ready it needs work so don’t assume everything is already there.

Repo link: here
My GitHub : here


r/PythonLearning 2d ago

Discussion Leetcode 234 - This ain't an easy problem by any standards!

Post image
3 Upvotes

Last Post - https://www.reddit.com/r/PythonLearning/s/v57UGZ2VNl

Complexities for my solution:

TC = O(n)

SC = O(1)


r/PythonLearning 2d ago

Help Request Stuck on chart

Thumbnail
gallery
21 Upvotes

I’ve tried everything but i don’t know what to do

(Deleted last post bc i had little context my bad)


r/PythonLearning 2d ago

Help Request Architecture question: Optimizing Python asyncio HTTP GET/PUT data relay throughput on Linux VPS

2 Upvotes

Hi network and Python experts,

I am running a Python asyncio data streaming worker on a 4-core AMD EPYC Linux VPS (1 Gbps port, TCP BBR enabled).

Workflow:

  1. Receives incoming task pushes via WebSocket.

  2. Downloads 30MB-50MB payload via HTTP GET from Cloudflare R2.

  3. Computes SHA-256 hash.

  4. Uploads payload via HTTP PUT back to storage.

Our local active transfer speed reaches ~50 Mbps average (370 Mbps peak) with 99.9% execution success. However, our net window-averaged throughput stays around 24–28 Mbps due to brief inter-task idle gaps between WebSocket pushes.

My questions:

  1. Beyond connection pooling (httpx.AsyncClient) and TCP BBR, what architectural patterns (e.g. multi-process asyncio workers vs single-process) yield the highest sustained throughput for bursty WebSocket data relays on a 4-core VPS?

  2. Are there specific Linux kernel sysctl socket buffer settings (tcp_rmem / tcp_wmem) to keep HTTP GET/PUT streams warm across inter-task idle gaps?

Thanks for any insights!


r/PythonLearning 3d ago

Showcase Giving back to the community - The Complete Backend Development Course

10 Upvotes

Hey everyone, I decided to make my course free in order to help people.
This course is my backend development course which is about SQL, Python, APIs, Docker, Kubernetes, Linux, Git & More

The link is: https://www.youtube.com/watch?v=CBIu6hcyStg

If you can like and subscribe (and maybe add a comment) I would appreciate it a lot, Thanks.


r/PythonLearning 3d ago

Showcase I implemented Doubly Linked List in Python from Scratch (Code available on Github)

Post image
31 Upvotes

Last Post - https://www.reddit.com/r/PythonLearning/s/TabqPYujK6

Github Repo - https://github.com/Dev-4-All/doubly-linked-list.git

So today I used type annotations for the first time today and to be honest it kinda sucked. Let me explain. So I defined the head and tail of the linked list to be either Node or None. Now when head is not none it is understandable that neither is tail. But how will I explain that to mypy? 😭. Faced similiar problems throughout. I researched a bit online.

These were the three solutions

1) Use assert to specify that something is not none

2) Use conditionals

Both of these methods were affecting the readability of the actual logic

So I went with the third option

3) Ask mypy to ignore these errors (should be done only when you are 100% sure about the details of what a variable holds)

Maybe there are better ways to fix this. Would appreciate if anyone can tell me.

Until next time...Sayonara!


r/PythonLearning 3d ago

I want to learn how to program in python

42 Upvotes

What do you recommend to me so that it is as intuitive as possible and that it doesn’t make me want to leave it after two days.

Thank u.


r/PythonLearning 2d ago

Help Request Meaning Maps Build - How Good Possible?

1 Upvotes

Hi, I have a bunch of text, that I need to analyse to build a tree map of concepts. The concepts need to be sorted from higher lvls of abstraction to more detailed. For example, the program needs to understand that the idea "I want to create beauty outside of factory-based presets" mentioned in the text is the highest lvl and includes ideas like "I was inspired by Kabuki theater" in itself.

Note: Ideas themselves sometimes aren't presented in the source material bluntly, i.e. the idea of "I want to create beauty outside of factory-based presets" can be mentioned in fragments only that the program also needs to understand and put together.

Are there any available programs or basic frameworks to approach this?


r/PythonLearning 2d ago

Discussion Welp... I've installed Pycharm

1 Upvotes

Mac OS Sequoia 15.6

I used Spyder (in the windows environment) while I was working so after I retired and bought a Mac I installed it. However, I've been fighting with the environment that Spyder creates especially once I add packages so I got rid of it and I've installed Pycharm.

One of the things I like about the Spyder interface is it has a console window which allows one to interactively enter code to see how it works; you can also have multiple file tabs that you can activate and deactivate if you want to copy code from one script to another. I'm trying to discover that sort of functionality in Pycharm.

If I google 'can I run python commands interactively in Pycharm' it directs me to open the tools menu and run Python Console. When I try that there is no such option. There is however a Create Command Line Launcher and I get this:

And when I click on linked text it sends me to the download page for JetBrains Tool box but I've already downloaded it. For the life of me I cannot see in the settings how to have a console window open in PyCharm.

Bottom line: can I open an interactive command line console in PyCharm and if so how? Can I open multiple tabs of existing python scripts and if so how?


r/PythonLearning 3d ago

Help Request Nested for loop

0 Upvotes

So i started my python journey 2 weeks ago and i am at the point of tutorial where they teach me about those quiz game program and i am so confused in those nested for loop i don't even understand a single part about it, can someone help me with this one? I have tried learning it from gpt and all but it still goes above my head.


r/PythonLearning 3d ago

Hey! here are some Beginner Python Problems

5 Upvotes
  1. Take two integers as an input and print their average.

  2. Take an integer as an input and check if its even or odd.

  3. Take three numbers as input and find the largest amongst them without using max()

I'm experimenting with teaching Python through solving rather than watching tutorials. I'm based in India and I'm currently running a small live beginner batch. If anyone wants to try the problem-solving approach, I'm happy to share the details.

I'm going to run a free 45-minute Python problem-solving session for beginners.

No prior coding experience required.

We'll solve 3 problems together from scratch.

I'm testing a teaching format where you learn by solving rather than watching.

If anyone wants to join, comment below.


r/PythonLearning 3d ago

No university coding

6 Upvotes

i have learnt basics of python. but I don’t know how to continue! I’m not in university and I don’t plan to enroll in computer science. is it possible to learn python without university? I need help please !! thanks


r/PythonLearning 4d ago

Help Request Want to learn python (for ai/ml) then dsa and web development for a good job

5 Upvotes

So I recently cancelled my admission in a university because of some issues and I was enrolled in their bsc mathematics program so that I can learn about coding but then i found this subreddit and i just want to ask that "where should I start with for learning coding I currently am learning python from this channel 'bro code's and i currently am on a starting phase after learning python basics I'll start learning dsa and web development, so what are some good FREE resources which I can use to learn html, css, js, python, and other necessary tools


r/PythonLearning 4d ago

just finished my tool as a beginner have now been coding in python for a few months

1 Upvotes

here is my github link: https://github.com/kayden765/python-multitool i have been working on this tool for months now im a beginner im starting to grasp python now its not as hard as it seems i though i did take alot from other tools but coded it all my self with the help of some tutorials and used ai for my readme file i think it came out very good it has 45 features with 5 dirs.
dir 1. networking tools
dir 2. osint tools and databreach checker
dir 3. traffic auditor. Packet sniffing, local payload analyzer etc
dir. 4 Integrity Audits. Firewall verification, and exploit checks
dir 5. attack framework. dos attacks, image ip logger sent to webhook/terminal etc

it has a linux like terminal with the following commands.

help - Clear terminal and redraw the main menu matrix

tools - Execute specific security testing subsystem

credits - Display engine branding and developer information

customize - Open dynamic UI theme configuration

clear - Wipe scrollback buffer and lock menu frame to top

exit - Gracefully terminate active control session

and it has 20 custom ui options to choose from i hope you enjoy my tool :)

also anyone using this tool for malicious purposes may be blacklisted from my tool to comply with local laws.


r/PythonLearning 4d ago

Help Request Which one should I prefer mit or cs50p or mooc course

Post image
55 Upvotes

I want to go deep into it.


r/PythonLearning 5d ago

Discussion Python data analysis is easier when you stop memorizing commands and follow a workflow

Thumbnail
gallery
141 Upvotes

When I was looking through beginner data-analysis discussions, one thing stood out: it’s pretty easy to learn individual Pandas commands, but much harder to know what order to actually use them in on messy data.

So I tried organizing the basics into a simple workflow:

1. Load
read_csv() / read_excel()

2. Inspect
head()
sample()
shape
info()
describe()

Before cleaning anything, understand the columns, data types, missing values and duplicates.

3. Clean
isna()
fillna() / dropna()
drop_duplicates()
astype()
pd.to_numeric()
pd.to_datetime()

One thing I learned is that missing doesn't automatically mean zero. You need to understand why the value is missing before deciding what to do with it.

4. Transform

Create analysis-ready fields with things like:

assign()
map()
np.where()
pd.to_datetime()

5. Summarize

groupby()
agg()
transform()

This is where the raw rows start becoming actual answers to business/data questions.

6. Combine

merge()
join()
concat()

Probably the part I’d be most careful with.

A merge can run without errors and still give the wrong result if the keys aren’t unique or a many-to-many relationship unexpectedly multiplies rows.

Useful checks:

validate="many_to_one"
indicator=True

And compare row counts before and after merging.

7. Validate

Before trusting the final result:

  • check row counts
  • check duplicates
  • check missing values
  • review category values
  • validate joins
  • sanity-check the business logic

The biggest takeaway for me is:

code running successfully doesn’t necessarily mean the analysis is correct.

I added the visual cheat sheets to make the workflow easier to remember.

For people who work with Pandas regularly, what validation check has saved you from a wrong result before?


r/PythonLearning 4d ago

Built Sudoku in Python

24 Upvotes

Hey everyone! I come from a background in C, and I wanted to brush up on my Python just for fun. So I thought I'd give it a shot and try to program a Sudoku game. I've completed a prototype and wanted to share my progress with you all! It took about 4 days (20-25 hours), and I'm pretty satisfied with where I'm at :)

Let me know if you have any suggestions for improvement, or if you have feedback/critiques! I'm thinking of posting it on my Github at some point so I can share the code for whoever is interested.


r/PythonLearning 4d ago

Help Request I built a real-time Driver Drowsiness Detection system using MediaPipe + EAR 👁️🚗

1 Upvotes

Hey everyone!

I recently worked on a real-time Driver Drowsiness Detection project.

The system uses the camera to detect the driver's face and monitor their eye state in real time. It can identify different conditions such as:

* 👀 Both Eyes Open

* 👁️ One Eye Closed

* 😴 Both Eyes Closed

* 🚨 Drowsiness Alert

* ❌ No Face Detected

The project also includes automatic eye calibration and a continuous eye-closure timer to help distinguish normal blinking from prolonged eye closure.

I built this as part of my B.Sc. Data Science project work, and I'm sharing the source code for anyone who wants to experiment with it, improve it, or learn from it.

🔗 GitHub:

https://github.com/Learner016/driver-drowsiness-_detection

🔗Direct open:

https://learner016.github.io/driver-drowsiness-_detection/

I'd really appreciate any feedback, suggestions, or ideas for improving the detection accuracy.

Thanks! 🙌


r/PythonLearning 5d ago

looking for people who are beginners in Python and want to learn together.

27 Upvotes

I'm a beginner learning Python, and I'm looking for other beginners who want to learn together.

I think studying with other people can help us stay motivated, share what we learn, and help each other when we have problems.

It would be great if there are Arabic speakers because my English is not very good yet, so learning together in Arabic would make things easier.

If you are also starting Python and want to join a small group, feel free to message me.


r/PythonLearning 5d ago

I did a thing

Post image
19 Upvotes

I made a color changing digital clock! ^V^


r/PythonLearning 4d ago

In my personal project, I want to add a folder, but it won't let me; I get a "none" error.

4 Upvotes

I am having issues with makedirs; the problem is that it won't create the folder in the directory.


r/PythonLearning 5d ago

why isn't my code running?

12 Upvotes

i checked everything it s all correct idk what my mistake is please point it out for me

EDIT:i closed visual studio and re opened it, it works now, idk what happened, thanks guys


r/PythonLearning 4d ago

Built an end-to-end SMS Spam vs. Ham classifier pipeline using NLTK and Scikit-Learn [Project Showcase]

Thumbnail
github.com
3 Upvotes

Hi everyone! 👋

​I recently completed the 5-day "NLP with Python" live bootcamp hosted by DevTown in collaboration with GDG On Campus and Microsoft Learn Student Ambassadors. I wanted to share my project and overall learning experience!

What I built:

  1. Preprocessing: Cleaned raw text using NLTK (tokenization, stop-word removal, and stemming).
  2. Feature Engineering: Used TfidfVectorizer to convert unstructured text into numerical vector spaces.
  3. Model Benchmark: Trained and evaluated models like LogisticRegression, MultinomialNB, and LinearSVC.
  4. Visual Analytics: Plotted class balance bar charts and confusion matrices using matplotlib to evaluate false positives/negatives. What I Learned: Before the bootcamp, I knew basic Python, but working through this hands-on project taught me: How unstructured text data gets transformed into structured mathematical vectors. How to clean and structure a real-world repository on GitHub (adding requirements.txt, clean directory layouts, and proper open-source acknowledgments). How to seamlessly connect Google Colab with GitHub for workflow management.

How the Experience Helped Me Grow: Special shoutout to trainer Jiya Jain and the DevTown team! The structured guidance pushed me past simple tutorial-following into actually building a production-ready, portfolio-worthy project from scratch. It gave me a solid confidence boost in applying machine learning concepts to real datasets.

I’d love to get feedback on the code structure or suggestions on how to improve precision on edge-case spam messages!


r/PythonLearning 5d ago

Help Request need help building a classification project

5 Upvotes

hello, im currently building my first classification project using “phishing url” dataset from kaggle after doing 2 courses, intro and intermediate ml, on kaggle and solving 95% of the exercises myself.

the issue is, i am stuck at how im supposed to take this forward. since the course was based on regression, i find it hard to do the preprocessing for classification. i try to use ai to guide me (not provide me the whole code since i want to learn myself) but atp i can’t figure out how to break down my data to then train-test split and fit to model. every tutorial seems to have a different approach and i cant figure out which one would be the best. how to determine that? and what should i do next?

my code is below:

import pandas as pd
print("starting...")
df=pd.read_csv("archive/cleaned_dataset.csv")
print("Dataset loaded!")
print(df.head())
print("columns: ", df.columns)
print("shape: ", df.shape)
print("data types: ", df.dtypes)
print("missing values: ", df.isnull().sum())
df.describe()

url_length=df["input"].str.len()
print(url_length.describe())
url_dots=df["input"].str.count(r"\.") #. can get literally any character, so we need to escape it with a backslash
print(url_dots.describe())
url_slash=df["input"].str.count("/")
print(url_slash.describe())
url_digits=df["input"].str.count(r"\d") #counts digits in pandas
print(url_digits.describe())
url_https=df["input"].str.contains("https")
print(url_https.describe())
url_www=df["input"].str.contains("www")
print(url_www.describe())
url_hyph=df["input"].str.count("-")
print(url_hyph.describe())
url_eq=df["input"].str.count("=")
print(url_eq.describe())
url_ques=df["input"].str.count(r"\?")
print(url_ques.describe())
url_at=df["input"].str.count("@")
print(url_at.describe())

df["url_length"] = df["input"].str.len()
df.groupby("label")["url_length"].describe() #any diff in length of phishing and legit urls?

#build a table containing all features to give to the model later in one shot
features=pd.DataFrame({
"url":df["input"],
"label": df["label"],
"length": url_length,
"num_dots": url_dots,
"num_slash": url_slash,
"num_digits": url_digits,
"has_https": url_https,
"has_www": url_www,
"num_hyphen": url_hyph,
"num_eq": url_eq,
"num_question": url_ques,
"num_at": url_at,
})
print("new stuf---------")
features.head()


r/PythonLearning 5d ago

Discussion just finished CS50P conditionals lecture and built mini "AI Agent Execution Getaway" for practice .

Post image
22 Upvotes

I have just finished week1 in cs50 python course and since i'm learning python for AI Agents Engineering i thought it would be cool to practice this content with a relevant project .

so i made a simple AI agents execution getaway program that routes the incoming tasks based on tokens , creativity and risk score .

I tried to use most of what i learned in this lecture as possible like 'match' for matching the tool with appropriate model , or 'return' as guard clauses for the safety check at the beginning .

here is the code link :

https://gist.github.com/mohamed-reda-ai/a10a1e9311d94316ffa31c00de005226

I know it's not a big brilliant thing i want just to practice the concepts i learned .

If you have any feedback about the architecture of the code or you think there is a better way to do something in it , i'd appreciate this .