Skip to main content

Pandas API reference

Project description

qu ⠶ pd

CI Status Coverage Checked with mypy Code style: black

Pandas API reference

Motivation

To collect a database of the pandas API to enable gamified study, or simple reference usage.

Outline

  • Either download docs as ZIP of HTML, or mine the package repo (parse RST with docutils to give doctrees). The latter would be preferable (but perhaps not useful since autosummary is used).
  • Make sqlite3 database with fields: name (e.g. "DataFrame"), qualname prefix (e.g. "pandas"), type (e.g. "class"), and so on. This would amount to a 'walk' of the library's entity tree.
  • Expose these entities in a structured way (as an entity tree).

Possible applications

  • 🐼 PQ Test: pandas API recall score, like an IQ test
  • 🐼 PPM: typing test, for completing tasks in pandas

Requires

  • Python 3.10+

Installation

pip install qpdb

qp is available from PyPI, and the code is on GitHub

Usage

The package can be used on the command line by calling qp

usage: qp [-h] [-v VERSION] [--domain DOMAIN] [-r ROLE] [-n NAMES]
          [--debug | --no-debug] [-c | --crawl | --no-crawl]
          [-q | --quiet | --no-quiet]
          [package]

positional arguments:
  package               (default: pandas)

options:
  -h, --help            show this help message and exit
  -v VERSION, --version VERSION
                        (default: )
  --domain DOMAIN       (default: py)
  -r ROLE, --role ROLE  (default: )
  -n NAMES, --names NAMES
                        (default: )
  --debug, --no-debug   (default: False)
  -c, --crawl, --no-crawl
                        (default: False)
  -q, --quiet, --no-quiet
                        (default: False)

To print the inventory of names and their corresponding URLs, run qp.

To breakpoint and take a look at what info is available, run either qp --debug or qp --debug --no-crawl

To crawl each page of the docs, use --crawl (experimental)

To silence the STDERR header lines, add -q or --quiet

To get a list of all the entities in PyTorch (stable version) and their URLs, run:

qp torch -v stable -q | wc -l 

3366

To pull out just the torch.Tensor class methods, run:

qp torch -v stable --role method --names torch.Tensor -q | wc -l

514

This has many uses, for example to create a list of markdown format links, pipe it as:

echo "$(qp torch -v stable -r method -n torch.Tensor -q)" | \
  sed -e 's/ /]: /g' -e 's/^torch\.Tensor\./[/g'

[abs]: https://pytorch.org/docs/stable/generated/torch.Tensor.abs.html#torch.Tensor.abs
[abs_]: https://pytorch.org/docs/stable/generated/torch.Tensor.abs_.html#torch.Tensor.abs_
[absolute]: https://pytorch.org/docs/stable/generated/torch.Tensor.absolute.html#torch.Tensor.absolute
[absolute_]: https://pytorch.org/docs/stable/generated/torch.Tensor.absolute_.html#torch.Tensor.absolute_
[acos]: https://pytorch.org/docs/stable/generated/torch.Tensor.acos.html#torch.Tensor.acos
[acos_]: https://pytorch.org/docs/stable/generated/torch.Tensor.acos_.html#torch.Tensor.acos_
...

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

qpdb-0.2.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

qpdb-0.2.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file qpdb-0.2.0.tar.gz.

File metadata

  • Download URL: qpdb-0.2.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for qpdb-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4dec141c07af8b76db9dff66ee1c6946b00d9c405c7f449e1a1c44e9b98ed870
MD5 bc39291da362d8fcbe05189d2c731d13
BLAKE2b-256 1a554d3598fdc4077304bc1441df283638105d7b2fce176cc4fe39ea029ba438

See more details on using hashes here.

File details

Details for the file qpdb-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: qpdb-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for qpdb-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0803f1ad56a904ceb5d6958ffcfaa51473d229d3f1038bb06a6342617234f02
MD5 8c6c8e0cd858a4f499e046d00247d053
BLAKE2b-256 1ac3e2ef4a1c16707633fc94d16f183ccf93a883f90c889c3cef1e5df6c92ae1

See more details on using hashes here.

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