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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file db_queryset_tools_pkg-1.0.0.tar.gz.

File metadata

  • Download URL: db_queryset_tools_pkg-1.0.0.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.7

File hashes

Hashes for db_queryset_tools_pkg-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7b6bd602fbd7f3a8bb206e2073acacd9d88fe80c4d2cb8c2299fe7595369ff51
MD5 05f686089cfa19465e4fd8941d036765
BLAKE2b-256 5b24017c00b0054f36c7150897e5885d5e0f521d50b5e6e8aec7cf5f7d510045

See more details on using hashes here.

File details

Details for the file db_queryset_tools_pkg-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for db_queryset_tools_pkg-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8567be086312085a9dbaddf82e49422c452d167fb83f0deb5d03f2d806ab368b
MD5 b593023a22d1424897ca559a87d962bd
BLAKE2b-256 edc1068811a156a1af003b476410eb28d8549467c4b79fa7b3a5398959a5cfc3

See more details on using hashes here.

Supported by

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