Jaymon / dsnparse

Easily parse DSN urls (connection strings) in Python
MIT License
21 stars 8 forks source link

Flesh out the parse_class? #9

Open Jaymon opened 1 year ago

Jaymon commented 1 year ago

Both morp and prom have similar Connection classes. Would it be worth fleshing out the base class with the base functionality here and then letting prom and morp extend it?

Jaymon commented 1 year ago

I do some variation of this in morp, prom, and caches:

        d = {
            "caches.interface.Redis": set(["redis"]),
        }

        kv = v.lower()
        for interface_name, vals in d.items():
            if kv in vals:
                ret = interface_name
                break

It would be great to make this natively supported