I didn't exactly understand what you're looking for ...
If you are interested in defining a soil and obtaining a representation of the texture classification using the "soil texture triangle", for R exists a very complete tool "soiltexture". You can find the R-project here:
(documentation: https://cran.r-project.org/web/packages/soiltexture/vignettes/soiltexture_vignette.pdf; an online example application usage: https://rdrr.io/cran/plotrix/man/soil.texture.html).
For Python you can take into account this library.
https://github.com/chlewissoil/TernaryPlotPy
It allows to represent soil texture using the regional options for draws dashed lines between the soil-type categories:
'USA' (boundaries estimated from Brady & Weil, Nature and Properties of Soils, 12th Edition, fig 4.7.)
'Britain' (boundaries estimated from Robert E. White, Principles and Practices of Soil Science, 2006, fig. 2.3.a)
I'm looking for a python code that take in input (% soils, % clay,% silt, %OM, ...) and it provide you the soil texture classification. I don't need any diagram output or similar.
The R code https://cran.r-project.org/web/packages/soiltexture/
is a good solution buy I prefere a code in python.