sqlalchemy-file icon indicating copy to clipboard operation
sqlalchemy-file copied to clipboard

Add libcloud import to library itself

Open Niccolum opened this issue 2 years ago • 4 comments

As for me, it will be nice, if I import only sqlalchemy_file library to import providers. Of course, it's only my wish :)

For example, fastapi do it with starlette https://github.com/tiangolo/fastapi/blob/master/fastapi/requests.py

Niccolum avatar Nov 23 '22 18:11 Niccolum

Hello @Niccolum, Thank you for your suggestion, I think it's a good idea It will be great to import both libcloud.storage.types.Provider and libcloud.storage.providers.get_driver from sqlalchemy_file

jowilf avatar Nov 25 '22 07:11 jowilf

So what @Niccolum proposes is this right?

- from libcloud.storage.drivers.local import LocalStorageDriver
+ from sqlalchemy_file.drivers import LocalStorageDriver

or...

- from libcloud.storage.drivers.local import LocalStorageDriver
+ from sqlalchemy_file import LocalStorageDriver

If that's the case, I highly recommend using this pattern...

- from libcloud.storage.drivers.local import LocalStorageDriver
+ from sqlalchemy_file.storage.drivers.local import LocalStorageDriver

In case, if the user decides to import providers from the libcloud package, only one keyword/name change will be enough.

hasansezertasan avatar Jan 08 '24 03:01 hasansezertasan

@hasansezertasan as for me, first or latest example are cool. But first is better, because we don't need to repeat the structure of another package, which can change in future

Niccolum avatar Jan 08 '24 07:01 Niccolum

@hasansezertasan as for me, first or latest example are cool. But first is better, because we don't need to repeat the structure of another package, which can change in future

It's not just "another package", sqlalchemy_file is almost built on top libcloud. Learning libcloud is probably a great gain for the users. I believe we should respect their structure.

So I vote for the latest example... It's the author's choice after all 🙏.

hasansezertasan avatar Jan 08 '24 09:01 hasansezertasan