Telegram Group Search
betterconf: minimalistic Python library for your configs.

betterconf (better config) is a Python library for project configuration management.

# What my project does

It allows you define your config like a regular Python class, casting values, getting values from anywhere and anyhow.

# Features and drawbacks

betterconf is really lightweight: all you need is Python >=3.8, no other dependencies. betterconf has simple, easy-to-learn API, which'll give you no struggle. betterconf's API is rich, staying as simple as possible, giving you lots of tools. betterconf is fully covered by tests so it won't fall by unexpected reason.

But as anything it has its own drawbacks.

By default there is a support only for os.environ. Any other providers like .json, .toml and everything else is not included but really easy to write due to betterconf's rich documentation.

betterconf doesn't have any security features or anything, but they could be easy added by a user.

# Audience

betterconf is fully production-ready, available as on PyPi so on GitHub. It can be used at web APIs, CLI tools, bots, everything...

# Comparison

Betterconf is simple and not sophisticated. Other libraries can have deep features that betterconf doesn't, but in exchange it gives you an ability to code it yourself. So, betterconf is ultimately-pluggable.

Code example:

from betterconf import Config, field


/r/Python
https://redd.it/1e3fojy
I am getting this error ModuleNotFound: No module named flask_mysqldb

I already tryed pip install flask-mysqldb and pip3 install flask-mysqldb I am using a mac and I am trying to install it on python virtual environment and I also tryed to install mysqlclient but nothing works

/r/flask
https://redd.it/1e3x2d5
I made GestureFlow to improve my productivity!


# What My Project Does

GestureFlow is an innovative application that enhances the traditional right-click functionality on computers by introducing a customizable radial menu. Here's what it does:

1. Radial Menu Activation: When you hold the right mouse button for a short duration (200ms), a circular menu appears around your cursor.
2. Quick Action Selection: Move your mouse in the direction of the desired action and release the button to execute it. No need for precise clicking on small menu items.
3. Customizable Actions: The menu includes common actions like Copy, Paste, Undo, Redo, and more. These can be easily customized or expanded in the code.
4. Visual Feedback: The menu provides clear visual feedback with hover effects and color changes, making it intuitive to use.
5. Cross-Platform Compatibility: GestureFlow works on both Windows and macOS, automatically adjusting its keyboard shortcuts for each platform.
6. Efficient Workflow: By combining multiple actions (e.g., "Select All + Copy"), it reduces the number of steps needed for common tasks.

# Target Audience

GestureFlow is designed for:

1. Power Users: Individuals who value efficiency and customization in their daily computer use.
2. Professionals: Developers, designers, writers, or anyone who frequently uses context-based actions in various applications.
3. Accessibility Enthusiasts: People interested in alternative input methods that

/r/Python
https://redd.it/1e3jye6
D Simple Questions Thread

Please post your questions here instead of creating a new thread. Encourage others who create new posts for questions to post here instead!

Thread will stay alive until next one so keep posting after the date in the title.

Thanks to everyone for answering questions in the previous thread!

/r/MachineLearning
https://redd.it/1e34cwr
OpenSkill MMR Rating System Now Features Per Player Weights

What My Project Does

OpenSkill is a peer-reviewed multiplayer ranking and rating system you can use to implement matchmaking systems on top of. This rating system behaves "like" TrueSkill, but is full open source, and unencumbered by patents, or trademarks. TrueSkill (Microsoft's proprietary, and patented rating system), has had something similar to this feature called "partial-play" for a while now. Our implementation is fully typed, supports pypy, and cpython and has 100% test coverage.

So what's this new change? Well there are not many open source rating systems (at least that I'm aware of) that let you consider in-game player scores to be factored into the rating updates. Only got 1 kill while the rest of your teammates got 4 or 5 kills? The rating system will update it's beliefs about a player based on these metrics. This means faster convergence to your actual skill.

Target Audience

I hope this new feature is useful to the game development community, especially those making multiplayer games. There is a lack of support for the game development ecosystem in Python. So here's hoping, your next multiplayer game finds use of this project!

Comparison

Some alternatives include EloMMR, Glicko-2 and TrueSkill. All of these are lacking in some areas.

GitHub Source

/r/Python
https://redd.it/1e42ds7
Django devops without Kubernetes

I'm not trying to use Kubernetes and AWS EKS. They're too overkill for my current project. How can I deploy without downtime while not using Kubernetes? I want to avoid deployment downtime at all cost.

/r/django
https://redd.it/1e408bc
Docker for Flask

I have been trying to look for online solutions and practices followed but generally they do it for the flask template app which does not cover the cases for real-world large scale applications. I personally have worked on numerous flask applications but while deploying am never successful in actually implementing the Dockerfile. Kindly guide me on how to tackle this.

/r/flask
https://redd.it/1e42cx3
Unable to type texts to chatbot user input

Hey guys, first time posting here. I am trying to add a chatbot for the backtesting platform built with Flask and there is a button on the right side that toggles the sidebar. If the user clicks the button, it shows the sidebar with a chatbot. But I'm going through an unexpected bug and would be utterly grateful if you guys could help me out.

I'll add this link(https://stackoverflow.com/questions/78752558/unable-to-type-texts-to-chatbot-user-input) that I posted on StackOverflow with the HTML, CSS, JS codes, and app.py code.

# Expected Behavior

The user should be able to type texts into the chatbot user input field.

# Current Behavior

Currently unable to type texts into the chatbot user input field.

https://preview.redd.it/l8l04x804tcd1.png?width=1914&format=png&auto=webp&s=81080e4a4efb536d9a9a4c9c9a29ff4f56082a63

/r/flask
https://redd.it/1e4fj86
Is SQLAlchemy really that good?

I've read a lot about SQLAlchemy and it seems to get a lot of hate for bad documentation or poor performance. I heard Peewee is a good alternative that's much more optimized and easier to use. The question is though, why is SQLAlchemy still so popular and widely used in industry? I heard it's the go-to for startups who choose Flask for their projects.
Personally I work with raw SQL queries The only advantage of SQLAlchemy I can sense is when defining tables and data, it's much easier to make the change, while with raw queries, you must modify each query string statement individually. For projects that use many tables with tons of columns that might be exhausting. But if the performance concerns are true, how does SQLAlchemy get away with it?



/r/flask
https://redd.it/1e4bbjj
Implemented Full-Stack Web App with Next.js and Django Rest Framework: Facing CSRF Verification Issues



Hey everyone,

I've recently developed a full-stack web application using Next.js for the frontend and Django Rest Framework (DRF) for the backend. For authentication, I used Simple JWT.

Everything was going smoothly until I encountered a problem with CSRF verification failures. It seems like my requests from Next.js to the Django backend are being blocked due to CSRF token mismatches. Here’s a brief rundown of my setup:

Frontend:
- Next.js
- Axios for making HTTP requests
- Integrated authentication using JWTs from the backend

Backend:
- Django
- Django Rest Framework
- Simple JWT for token-based authentication

The Issue:
When I make authenticated requests from my Next.js app to the Django API, I keep getting CSRF verification failed errors. I've tried several solutions, including adding CSRF tokens to the requests and configuring CORS settings, but nothing seems to work.

Has anyone faced similar issues or have any suggestions on how to resolve this? Any help or guidance would be greatly appreciated!

Thanks in advance!


Feel free to adjust the details to better fit your specific situation.

/r/django
https://redd.it/1e4hiys
Tuesday Daily Thread: Advanced questions

# Weekly Wednesday Thread: Advanced Questions 🐍

Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.

## How it Works:

1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.

## Guidelines:

* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.

## Recommended Resources:

* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.

## Example Questions:

1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the

/r/Python
https://redd.it/1e4abe5
R Protein language models expose viral mimicry and immune escape

We got accepted at ICML 24/ML4LMS workshop, so I thought i'd share :)
 "Protein Language Models Expose Viral Mimicry and Immune Escape"

TL;DR:

🧬 Research Overview: Viruses mimic host proteins to escape detection by the immune system. We used Protein Language Models (PLMs) to differentiate viral proteins from human ones, with 99.7% accuracy.

📊 Insights: Our research shows that the PLMs and the biological immune system make similar errors. By identifying and analyzing these errors, we gain valuable insights into immunoreactivity and potential avenues for developing more effective vaccines and treatments.

We also show a novel, explainable, multimodal tabular error analysis approach for understanding insights and mistakes made on any problem, letting us understand what characterizes the mistakes made by Deep learning Language models/PLMs .

🔗 Paper : https://openreview.net/forum?id=gGnJBLssbb&noteId=gGnJBLssbb

Code: https://github.com/ddofer/ProteinHumVir

Meet me and the poster (#116) at the ICML/ML4LMS workshop!: https://openreview.net/attachment?id=gGnJBLssbb&name=poster

doi: https://doi.org/10.1101/2024.03.14.585057

/r/MachineLearning
https://redd.it/1e4k3oi
Best IDE for teaching Python (task creation)?

Hey everyone,

As mentioned in the title above, I am lookiing for the best IDE to use which would allow for task creation for my students, it should allow for tests to be run on outputs. I am a high school comp sci teacher who has used Replit for a while, but the education component of Replit is going to be shut down in a few weeks. I was thinking of

- PyCharm used it as a student many years ago in university and I know you can create tasks, good debugging

- VSCode, for this option I would just give them a zip file and they would work within.

If there are any better suggestions I am all ears,

Thanks.

/r/Python
https://redd.it/1e4bc2g
Help needed Im on a time constraint.

Long story short, need to make 60k Rs. in the span of 30 days, break down: 2k Rs.per day, what can I do to achieve this goal, highly skilled in django, gen ai integrations, payments api integrations etc.
Doesnt matter how much time is taken per day.
Don't mention freelance, market saturated already and can't generate enough from Indian clients.
At this point anything will do just tell me what can I do that will help me achieve the target of edit: 2k Rs. per day.
if anyone interested in paid collaboration pls hmu.
Please refrain from negative comments.
Need help genuinely.

/r/django
https://redd.it/1e4su8t
Finance Toolkit - Calculate 200+ Financial Metrics for Any Company

This project originates from the frustration I had with financial websites and platforms not listing how they have calculated their financial metrics and seeing deviations when going to platforms such as Stockopedia, Morningstar, Macrotrends, Finance Charts, Wall Street Journal and many more. The metrics shouldn't deviate but they do (sometimes quite heavily) which encouraged me to start this project.

The whole idea behind the Finance Toolkit is to write every type of metric down in the most simplistic way (e.g. see here) so that the only thing that matters is the data that you put into it. I've worked on this project for around a year or two now and it currently has over 200+ different metrics such as Price-to-Earnings, Return on Equity, DUPONT, WACC, Bollinger Bands, Williams R, GARCH, Value at Risk, CAPM, Jensen's Alpha and all Option-related Greeks (and many many more).

Does this pique your interest? Have a look at the project on GitHub here: **https://github.com/JerBouma/FinanceToolkit**

Using the Finance Toolkit is pretty simple, you can download the package by using:

pip install financetoolkit -U

Then for example to perform an Extended Dupont Analysis you initialise the Finance Toolkit and run the related functionality:

from financetoolkit

/r/Python
https://redd.it/1e4ntif
Chunkit: Convert URLs into LLM-friendly markdown chunks for your RAG projects

Hey all, I am releasing a python package called chunkit which allows you to scrape and convert URLs into markdown chunks. These chunks can then be used for RAG applications.

The reason it works better than naive chunking (for example split every 200 words and use 30 word overlap) is because Chunkit splits on the most common markdown header levels instead, leading to much more semantically cohesive paragraphs.

https://github.com/hypergrok/chunkit

Have a go and let me know what features you would like to see!

/r/Python
https://redd.it/1e4v0sw
Are PyPI Trove Classifiers worthwhile to maintain?

Are PyPI Trove Classifiers worthwhile to maintain? From what I can tell, many of the classifiers are redundant to modern pyproject.toml entries. For example, the Python versions are typically specified by the requires-python = <version> entry. And so the Trove Classifiers specifying the Python version become something that needs to be manually maintained, which, at least in my case, means it'll almost certainly go out of sync.

Trove Classifiers also seem up to the package author when to apply which classifiers, without much in the way of guidelines as to when a classifier should be used. For example, it's unclear which cases the Framework :: Matplotlib should be applied to, since it might be a package that is dependent on matplotlib, extends matplotlib, or is just usually expected to be usually used in conjunction with matplotlib but is not explicitly dependent on it. I'm having a difficult time finding guides explaining what is expected in these cases. Most (though certainly not all) articles I can find about them seem to be from a decade ago.

With that previous point, it seems the classifiers are fairly arbitrary. Do many systems still heavily rely on these classifiers? For example, are search results related to

/r/Python
https://redd.it/1e51adb
Wednesday Daily Thread: Beginner questions

# Weekly Thread: Beginner Questions 🐍

Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.

## How it Works:

1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.

## Guidelines:

This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).

## Recommended Resources:

If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.

## Example Questions:

1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?

Let's help each other learn Python! 🌟

/r/Python
https://redd.it/1e53wm4
Does the Gaussian mixture modeling package from sklearn require normalization?

I’m using the Gaussian mixture model package from sklearn in python and I’m wondering if my data needs to be normalized and in what way (min max scaling, standard scaling, etc)? This is a dataset with both continuous variables like age and test scores as well as categorical variables like gender (as dummy binary variables). I can answer further questions in the comments. Thanks!

/r/Python
https://redd.it/1e4a2e0
2024/07/17 08:14:12
Back to Top
HTML Embed Code: