-
-
Notifications
You must be signed in to change notification settings - Fork 588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New import/export interface for 1.0 #46
Comments
Why the change? I thought the current version was very elegant. |
This is a much needed change for two reasons: It's rather cumbersome to code an interface that lets you choose from a variety of different formats, because each module must currently be invoked as an object attribute. Also, this is needed to add support for import options, such as turning headers on and off. |
@teilo 👍 |
I like this interface to support several formats, but you just can't use |
I tried a first draft of this issue in branch I don't like the It is backward compatible and should work with all registered formats.
This way, it is easy to configure importers and exporters.
|
Make XLSX `freeze_panes` configuration optional to test the implementation.
Any thoughts here? I really think this is the way to go with tablib API. It easily integrates third-party formats and allow configurable inputs/outputs without creating new formats. I'm already running my code in my reports and it fixed a lot of "can't use tablib here because of custom formats". CSV delimiters, large Excel files, import/export to custom formats (e.g. import data from SQLAlchemy and export to Google Charts). |
I'm thinking about this issue, maybe we can use the
After that, we can also support file descriptors with |
Is there still work done on this at the moment ? I'd be glad to help, I realized I use tablib really often and that the project might need some help (seems like the main developer is quite busy atm). I'm not really an experienced coder, but I have good understanding of Python, and I work with CSV/import/export libraries since a few months now so I may be able to do something. |
I don't know why I didn't saw it before, but tablib has The >>> tablib.import_set(text) # auto detect format
>>> dset = tablib.import_set('{"my": "json"}', format='json')
>>> csv_text = dset.export(format='csv') |
Make XLSX `freeze_panes` configuration optional to test the implementation.
…export` methods and overloaded `import_set` and `import_book` functions. Add import/export interface to Databook. Ref #46 Make XLSX `freeze_panes` configuration optional to test the implementation. Extend `import_set` and `import_book` to support `format` and `**kwargs` to be passed to the formatter.
The #191 PR was merged and I think this is done. Also, Maybe it deserve better docs.
|
data.export('json')
instead ofdata.json
.data.import('json', value)
instead ofdata.json = value
.The text was updated successfully, but these errors were encountered: