jowilf / sqlalchemy-file

SQLAlchemy-file is a SQLAlchemy extension for attaching files to SQLAlchemy model and uploading them to various storage such as Local Storage, Amazon S3, Rackspace CloudFiles, Google Storage and others using Apache Libcloud.
https://jowilf.github.io/sqlalchemy-file/
MIT License
91 stars 12 forks source link

Add libcloud import to library itself #16

Open Niccolum opened 1 year ago

Niccolum commented 1 year ago

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

jowilf commented 1 year ago

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

hasansezertasan commented 8 months ago

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.

Niccolum commented 8 months ago

@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

hasansezertasan commented 8 months ago

@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 🙏.