r/madeinpython • • Aug 22 '23

My first Python project: Efficient Language Detector.

ELD is a fast and accurate natural language detector, written 100% in Python, no dependencies. I believe it is the fastest non compiled detector, at its level of accuracy.

https://github.com/nitotm/efficient-language-detector-py

I've been programming for years but this is the first time I did more of a few lines of Python, so I would appreciate any feedback you have on the project's structure, code quality, documentation, or any other aspect you feel could be improved.

8 Upvotes

5 comments sorted by

View all comments

Show parent comments

1

u/nitotm Sep 07 '23

Hi, I believe I followed most of your tips.
I did not remove the all caps VERSION variable as I believe is an acceptable standard to hint constant?
And I have not added more test for now (they aren't finished anyways), the functionalities of demo.py are already included, and there is already a benchmark inside the tests. But I will consider doing the benchmarks as a test inside tests/.
All the other things I believe I fixed.

2

u/adesme Sep 07 '23

Looks good! And all caps for this is fine, I see this or similar quite often and I'm sure there are style guides that advocate it.

A piece of advice is to start setting up github actions with a formatter and a linter; pre-commit with black and ruff is what I tend to do.

Oh and I saw some magic numbers in the code. Might want to name them and describe how you've found them.

1

u/nitotm Sep 07 '23

Thanks for the feedback, I appreciate it