Skip to main content

A package to convert Django Queryset to list, dictionary, json and dataset for charts

Project description

DB_queryset_tools

Db_queryset_tools_pkg is a Python package that provides funtionalities for converting Django QuerySets into different formats.

Instalation

pip install db_queryset_tools_pkg

Usage

from db_queryset_tools_pkg import DB_queryset_tools


tool = DB_queryset_tools()

# Convert a QuerySet to a list
list_data = tool.queryset_to_list(queryset)

# Convert a QuerySet to a dictionary
dict_data = tool.queryset_to_dict(queryset)

# Convert a QuerySet to JSON
json_data = tool.queryset_to_json(queryset)

# Get a dataset for charts from a QuerySet - two required parameters identifier_x & identifier_y according to your chart requirment
chart_data = tool.get_dataset_for_charts(queryset,'month','count')

Contribution

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

db_queryset_tools_pkg-1.0.0.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

db_queryset_tools_pkg-1.0.0-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page