diff --git a/.gitignore b/.gitignore index 02433b6..cf68fdc 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,7 @@ dist /*.ipynb *.csv _build + +/.quarto/ +_site +reference/ diff --git a/_quarto.yml b/_quarto.yml new file mode 100644 index 0000000..212984e --- /dev/null +++ b/_quarto.yml @@ -0,0 +1,18 @@ +project: + type: website + output-dir: ../_site + +metadata-files: + - _sidebar.yml + +quartodoc: + package: pyprql + title: Reference + sidebar: _sidebar.yml + + sections: + - title: Some functions + desc: Functions to inspect docstrings. + contents: + - magic.prql + - pandas_accessor.prql diff --git a/_sidebar.yml b/_sidebar.yml new file mode 100644 index 0000000..cc56bf9 --- /dev/null +++ b/_sidebar.yml @@ -0,0 +1,11 @@ +website: + sidebar: + - contents: + - reference/index.qmd + - contents: + - reference/magic.prql.qmd + - reference/pandas_accessor.qmd + - reference/pandas_accessor.prql.qmd + section: Some functions + id: reference + - id: dummy-sidebar diff --git a/docs/PRQL_Demo.ipynb b/docs/PRQL_Demo.ipynb deleted file mode 100644 index df215ac..0000000 --- a/docs/PRQL_Demo.ipynb +++ /dev/null @@ -1,272 +0,0 @@ -{ - "nbformat": 4, - "nbformat_minor": 0, - "metadata": { - "colab": { - "provenance": [], - "include_colab_link": true - }, - "kernelspec": { - "name": "python3", - "display_name": "Python 3" - }, - "language_info": { - "name": "python" - } - }, - "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "view-in-github", - "colab_type": "text" - }, - "source": [ - "\"Open" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "id": "cFCNl1xfQUwS" - }, - "outputs": [], - "source": [ - "# Install `pyprql`\n", - "!pip -q install -U pyprql" - ] - }, - { - "cell_type": "code", - "source": [ - " # Load the extensions\n", - " %load_ext pyprql.magic\n", - " %prql duckdb:///:memory:" - ], - "metadata": { - "id": "CbgCQ9FMQpD3" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# Grab some data \n", - "!wget -q https://raw.githubusercontent.com/graphql-compose/graphql-compose-examples/master/examples/northwind/data/csv/products.csv" - ], - "metadata": { - "id": "vsJKgU37RAyk" - }, - "execution_count": null, - "outputs": [] - }, - { - "cell_type": "code", - "source": [ - "# Here's the extension working:\n", - "%%prql\n", - "from p = `products.csv`\n", - "filter ((supplierID == 1 or supplierID == 2) and unitsOnOrder > 0)" - ], - "metadata": { - "id": "vI1x6uYNRkmN", - "colab": { - "base_uri": "https://localhost:8080/", - "height": 143 - }, - "outputId": "f786b60d-86a0-4331-9fcc-6fd155139e3b" - }, - "execution_count": null, - "outputs": [ - { - "output_type": "execute_result", - "data": { - "text/plain": [ - " productID productName supplierID categoryID \\\n", - "0 2 Chang 1 1 \n", - "1 3 Aniseed Syrup 1 2 \n", - "2 66 Louisiana Hot Spiced Okra 2 2 \n", - "\n", - " quantityPerUnit unitPrice unitsInStock unitsOnOrder reorderLevel \\\n", - "0 24 - 12 oz bottles 19.0 17 40 25 \n", - "1 12 - 550 ml bottles 10.0 13 70 25 \n", - "2 24 - 8 oz jars 17.0 4 100 20 \n", - "\n", - " discontinued \n", - "0 0 \n", - "1 0 \n", - "2 0 " - ], - "text/html": [ - "\n", - "
\n", - "
\n", - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
productIDproductNamesupplierIDcategoryIDquantityPerUnitunitPriceunitsInStockunitsOnOrderreorderLeveldiscontinued
02Chang1124 - 12 oz bottles19.01740250
13Aniseed Syrup1212 - 550 ml bottles10.01370250
266Louisiana Hot Spiced Okra2224 - 8 oz jars17.04100200
\n", - "
\n", - " \n", - " \n", - " \n", - "\n", - " \n", - "
\n", - "
\n", - " " - ] - }, - "metadata": {}, - "execution_count": 7 - } - ] - }, - { - "cell_type": "code", - "source": [], - "metadata": { - "id": "JLYFHGgT_i4s" - }, - "execution_count": null, - "outputs": [] - } - ] -} diff --git a/docs/archive/cli.md b/docs/archive/cli.md deleted file mode 100644 index e31d564..0000000 --- a/docs/archive/cli.md +++ /dev/null @@ -1,25 +0,0 @@ -# Command Line Interface - -In addition to providing the main entrypoint, -documented below, -this module also documents -the [CLI class](./cli_class.md), -the [completer class](./completer.md), -the [lexer class](./lexer.md), -and the [styler class](./styler.md). - -```{eval-rst} -.. automodule:: pyprql.cli - :members: - :private-members: -``` - -```{toctree} -:hidden: -:maxdepth: 3 - -cli_class -completer -lexer -styler -``` diff --git a/docs/archive/contributing.md b/docs/archive/contributing.md deleted file mode 100644 index 78caf34..0000000 --- a/docs/archive/contributing.md +++ /dev/null @@ -1,2 +0,0 @@ -```{include} ../CONTRIBUTING.md -``` diff --git a/docs/archive/pyprql.md b/docs/archive/pyprql.md deleted file mode 100644 index bc7dffe..0000000 --- a/docs/archive/pyprql.md +++ /dev/null @@ -1,13 +0,0 @@ -# Source Code - -Currently, the source code is divided as follows: - -- `magic` module that implements the PRQL IPython/Jupyer magic. - See [IPython and Jupyter Magic](./magic.md). - -```{toctree} -:hidden: -:maxdepth: 3 - -magic -``` diff --git a/docs/archive/styler.md b/docs/archive/styler.md deleted file mode 100644 index 173f996..0000000 --- a/docs/archive/styler.md +++ /dev/null @@ -1,7 +0,0 @@ -# The Pygments Styler - -```{eval-rst} -.. automodule:: pyprql.cli.PRQLStyle - :members: - :private-members: -``` diff --git a/docs/changelog.md b/docs/changelog.md deleted file mode 100644 index 66efc0f..0000000 --- a/docs/changelog.md +++ /dev/null @@ -1,2 +0,0 @@ -```{include} ../CHANGELOG.md -``` diff --git a/docs/conf.py b/docs/conf.py deleted file mode 100644 index 107d1ea..0000000 --- a/docs/conf.py +++ /dev/null @@ -1,36 +0,0 @@ -"""Sphinx configuration.""" -import os -import sys - -import sphinx_rtd_theme # noqa: F401 - -sys.path.insert(0, os.path.abspath("../")) -sys.path.insert(0, os.path.abspath("../pyprql/")) - -project = "pyprql" -author = "PRQL Crew" -copyright = "2022" -version = "0.4.1" -extensions = [ - "sphinx_rtd_theme", - "sphinx.ext.autodoc", - "sphinx.ext.napoleon", - "myst_parser", -] -exclude_patterns = ["archive/**"] - -napoleon_google_docstrings = False -napoleon_numpy_docstrings = True -napoleon_use_param = False - -html_theme = "sphinx_rtd_theme" - -source_suffix = { - ".rst": "restructuredtext", - ".md": "markdown", -} -myst_heading_anchors = 2 -myst_enable_extensions = [ - "html_admonition", - "colon_fence", -] diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index 62df70a..0000000 --- a/docs/index.md +++ /dev/null @@ -1,12 +0,0 @@ -```{include} ../README.md - -``` - -```{toctree} -:hidden: -:maxdepth: 3 - -magic_readme -magic_api -changelog -``` diff --git a/docs/magic_api.md b/docs/magic_api.md deleted file mode 100644 index 197681e..0000000 --- a/docs/magic_api.md +++ /dev/null @@ -1,13 +0,0 @@ -# IPython & Jupyter Magic API - -```{eval-rst} -.. automodule:: pyprql.magic - :members: - :private-members: -``` - -```{eval-rst} -.. automodule:: pyprql.magic.prql - :members: - :private-members: -``` diff --git a/docs/magic_readme.md b/docs/magic_readme.md deleted file mode 100644 index 84d3515..0000000 --- a/docs/magic_readme.md +++ /dev/null @@ -1,2 +0,0 @@ -```{include} ../pyprql/magic/README.md -``` diff --git a/pyprql/magic/prql.py b/pyprql/magic/prql.py index 1cf44e9..e1d651d 100644 --- a/pyprql/magic/prql.py +++ b/pyprql/magic/prql.py @@ -25,12 +25,6 @@ class PrqlMagic(SqlMagic): Additionally, to work around some quirky behaviour, we also provide an ``autoview`` option to indicate whether results should be printed to the window. - - Parameters - ---------- - shell : InteractiveShell - The current IPython shell instance. Since instantiation is handled by IPython, - the user should never need to create this clas manually. """ displaycon = Bool(False, config=True, help="Show connection string after execute")