https://en.wikipedia.org/wiki/Dependent_type
I would prefer though Coq code.
Is this the only (quality) option:
https://github.com/HoTT/HoTT/tree/master/theories/Categories ?
But I don't understand HoTT, so would it be too difficult to use that HoTT library, or could I learn a little bit of HoTT and be okay?
One reason why that would be a bad idea is I would have to translate the Coq code into Python 3.x which has a dependent types feature, which I'm going to use for something.
Here you can find a complete definition of category in a dependent type theory.
In summary it is an element of a $\Sigma$-type, or a record if you prefer, made of:
This can be easily implemented in any programming language/proof assistant with dependent types with an equality type (not necessarily HoTT).
Hope this helps.