Rest-pandas

Latest version: v1.1.0

Safety actively analyzes 688178 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

1.1.0

**Django REST Pandas 1.1.0** includes a new filename option (31), confirmed support for Django 2, and a couple of minor fixes.

New Functionality
Added a `get_pandas_filename()` view method, for cases where you have users downloading files through the API (31). For example:

python
class TimeSeriesView(PandasView):
If a filename is returned, rest_pandas will include the following header:
'Content-Disposition: attachment; filename="Data Export.xlsx"'
def get_pandas_filename(self, request, format):
if format in ('xls', 'xlsx'):
Use custom filename and Content-Disposition header
return "Data Export" Extension will be appended automatically
else:
Default filename from URL (no Content-Disposition header)
return None


Bug Fixes
* Don't crash if `renderer_context` is missing (34)
* `PandasBoxplotSerializer`: handle non-numeric columns and duplicate rows (abeb57680f4138f8ac5f92591cc83c5c414bff85)

Documentation Improvements
* Test Django 2 support (35), add wheel and LICENSE for PyPI (33)
* Using `rest_pandas` with an existing view (32, 36)

1.0.0

Django REST Pandas 1.0.0 brings a number of API improvements that make it easier to integrate with existing DRF projects.

New Functionality
* Support mixing with DRP renderers with regular DRF renderers, including in `REST_FRAMEWORK["DEFAULT_RENDERER_CLASSES"]` (28)
* Better detection of default index field name (13, 29)
* Include index field(s) in default JSON output (29). The `orient` parameter now defaults to a DRP-specific `"records-index"`, which is like `"records"` but calls `reset_index()` before rendering.

Bug Fixes
* Don't crash if `"id"` is not a serializer field (13)
* Fix null value handling in `PandasScatterSerializer` (2636cc4)

Documentation Improvements
* Supported URL parameters for JSON output (26)
* `DateTimeField` serialization tips (27)
* `django-pandas` integration (11)
* HTML output and integration with [wq/chartapp.js](https://wq.io/docs/chartapp-js) (#2)

0.5.0

Django REST Pandas 0.5.0 introduces a simple `PandasHTMLRenderer` for use in a browseable visualization API (2). To enable it by default, you just need to add `rest_pandas` to your `INSTALLED_APPS`. You will need a template called `rest_pandas.html`, or you can install [django-mustache](https://github.com/wq/django-mustache) to use the provided mustache template (which is optimized for integration with a [wq-powered](https://wq.io/) application).

This release also includes updates for pandas 0.19 and drops support for Django REST Framework 2.4 (23).

0.4.1

Django REST Pandas 0.4.1 brings a few minor bug fixes:
- Fix issues with image renderer (c0c8b5cd5d1a107191c3793447bc956e4da09f19)
- Fix file error on Windows (19)
- Update tests for Django 1.10
- Code style (25)

0.4.0

Django REST Pandas 0.4.0 brings a few new features as well as confirmed compatibility with Django 1.9.
- 15 - Ability to override JSON format via URL keyword (via kevinmickey)
- 17 - `Unstacked`, `Scatter`, and `Boxplot` serializers for [common charting uses](https://github.com/wq/django-rest-pandas#building-interactive-charts), generalized from [wq.db.contrib.chart](https://wq.io/docs/chart).
- 14 - Better documentation and tests for ["simple" use case](https://github.com/wq/django-rest-pandas#no-model)

0.3.2

This release is just to verify compatiblity with Django 1.8 and pandas 0.16.0. Older versions should still work, though note that Django 1.6 is no longer being tested against.

The only actual code change is https://github.com/wq/django-rest-pandas/commit/5faa4ec4d32466dac89ef117392faa87428a801f, which switches the JSON renderer from a default of `orient="index"` to `orient="records"` <strike>to get around a breaking test</strike> because it's a more reasonable default. You can restore the old behavior by subclassing `PandasJSONRenderer` and overriding `get_pandas_kwargs()`, but:
1. As is noted in the README, the [CSV renderer](https://github.com/wq/django-rest-pandas#implementation-notes) is the one you probably want to be using anyway. You can use [wq/pandas.js](https://wq.io/docs/pandas-js) to convert CSV to JSON after you've loaded it on the client.
2. If you _really_ want JSON output, you're probably already using the vanilla DRF `JSONRenderer` anyway.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.