All Projects → mkdocstrings → pytkdocs

mkdocstrings / pytkdocs

Licence: ISC License
Load Python objects documentation.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to pytkdocs

powerapps-docstring
PowerApps-docstring is a console based, pipeline ready application that automatically generates user and technical documentation for Power Apps.
Stars: ✭ 30 (-31.82%)
Mutual labels:  docstrings
httpsig
Golang implementation of the HTTP Signatures RFC draft, with SSH support!
Stars: ✭ 58 (+31.82%)
Mutual labels:  signatures
sig
Validate Method Arguments & Results in Ruby
Stars: ✭ 54 (+22.73%)
Mutual labels:  signatures
Kryptor
A simple, modern, and secure encryption and signing tool that aims to be a better version of age and Minisign.
Stars: ✭ 267 (+506.82%)
Mutual labels:  signatures
nativescript-drawingpad
📝 NativeScript plugin to provide a way to capture any drawing (signatures are a common use case) from the device
Stars: ✭ 89 (+102.27%)
Mutual labels:  signatures
detection
Detection in the form of Yara, Snort and ClamAV signatures.
Stars: ✭ 70 (+59.09%)
Mutual labels:  signatures
numpydoc.el
Insert NumPy style docstrings in Python functions.
Stars: ✭ 33 (-25%)
Mutual labels:  docstrings
Deep-Signature-Transforms
Code for "Deep Signature Transforms" (NeurIPS 2019)
Stars: ✭ 65 (+47.73%)
Mutual labels:  signatures
declarative-parser
Modern, declarative argument parser for Python 3.6+
Stars: ✭ 31 (-29.55%)
Mutual labels:  docstrings
Sig
The most powerful and customizable binary pattern scanner
Stars: ✭ 131 (+197.73%)
Mutual labels:  signatures
minter-go-sdk
Minter Blockchain Golang SDK, 💳 wallet, 🧾 transactions, gRPC and HTTP clients 🌐 https://t.me/MinterGoSDK
Stars: ✭ 12 (-72.73%)
Mutual labels:  signatures
AutomatedOutlookSignature
PowerShell script to automate the creation of Outlook signatures using Active Directory attributes.
Stars: ✭ 36 (-18.18%)
Mutual labels:  signatures
sphinx-rest-cheatsheet
A compact cheat sheet for writing documentation string for Sphinx, with focus on Python.
Stars: ✭ 17 (-61.36%)
Mutual labels:  docstrings
yara-parser
Tools for parsing rulesets using the exact grammar as YARA. Written in Go.
Stars: ✭ 69 (+56.82%)
Mutual labels:  signatures
rsign2
A command-line tool to sign files and verify signatures in pure Rust.
Stars: ✭ 102 (+131.82%)
Mutual labels:  signatures
HTTPSignatures
A Burp Suite extension implementing the Signing HTTP Messages draft-ietf-httpbis-message-signatures-01 draft.
Stars: ✭ 38 (-13.64%)
Mutual labels:  signatures
signdocs
Full-stack clone of DocuSign
Stars: ✭ 58 (+31.82%)
Mutual labels:  signatures
flake8-docstrings
Integration of pydocstyle and flake8 for combined linting and reporting
Stars: ✭ 73 (+65.91%)
Mutual labels:  docstrings
wasmsign2
PoC implementation of the WebAssembly Modules Signatures proposal.
Stars: ✭ 18 (-59.09%)
Mutual labels:  signatures
04 Python Functions
The function is a block of code defined with a name. We use functions whenever we need to perform the same task multiple times without writing the same code again. It can take arguments and returns the value.
Stars: ✭ 204 (+363.64%)
Mutual labels:  docstrings

pytkdocs

ci documentation pypi version conda version gitpod gitter

Load Python objects documentation.

Installation

With pip:

pip install pytkdocs

With pipx:

python3.7 -m pip install --user pipx
pipx install pytkdocs

With conda:

conda install -c conda-forge pytkdocs

Usage

pytkdocs accepts JSON on standard input and writes JSON on standard output.

Input format:

{
  "objects": [
    {
      "path": "pytkdocs",
      "new_path_syntax": false,
      "members": true,
      "inherited_members": false,
      "filters": [
        "!^_[^_]"
      ],
      "docstring_style": "google",
      "docstring_options": {
        "replace_admonitions": true
      }
    }
  ]
}

Output format:

{
  "loading_errors": [
    "string (message)"
  ],
  "parsing_errors": {
    "string (object)": [
      "string (message)"
    ]
  },
  "objects": [
    {
      "name": "pytkdocs",
      "path": "pytkdocs",
      "category": "module",
      "file_path": "/media/data/dev/pawamoy/pytkdocs/src/pytkdocs/__init__.py",
      "relative_file_path": "pytkdocs/__init__.py",
      "properties": [
        "special"
      ],
      "parent_path": "pytkdocs",
      "has_contents": true,
      "docstring": "pytkdocs package.\n\nLoad Python objects documentation.",
      "docstring_sections": [
        {
          "type": "markdown",
          "value": "pytkdocs package.\n\nLoad Python objects documentation."
        }
      ],
      "source": {
        "code": "\"\"\"\npytkdocs package.\n\nLoad Python objects documentation.\n\"\"\"\n\nfrom typing import List\n\n__all__: List[str] = []\n",
        "line_start": 1
      },
      "children": {
        "pytkdocs.__all__": {
          "name": "__all__",
          "path": "pytkdocs.__all__",
          "category": "attribute",
          "file_path": "/media/data/dev/pawamoy/pytkdocs/src/pytkdocs/__init__.py",
          "relative_file_path": "pytkdocs/__init__.py",
          "properties": [
            "special"
          ],
          "parent_path": "pytkdocs",
          "has_contents": false,
          "docstring": null,
          "docstring_sections": [],
          "source": {},
          "children": {},
          "attributes": [],
          "methods": [],
          "functions": [],
          "modules": [],
          "classes": []
        }
      },
      "attributes": [
        "pytkdocs.__all__"
      ],
      "methods": [],
      "functions": [],
      "modules": [
        "pytkdocs.__main__",
        "pytkdocs.cli",
        "pytkdocs.loader",
        "pytkdocs.objects",
        "pytkdocs.parsers",
        "pytkdocs.properties",
        "pytkdocs.serializer"
      ],
      "classes": []
    }
  ]
}

Command-line

Running pytkdocs without argument will read the whole standard input, and output the result once.

Running pytkdocs --line-by-line will enter an infinite loop, where at each iteration one line is read on the standard input, and the result is written back on one line. This allows other programs to use pytkdocs in a subprocess, feeding it single lines of JSON, and reading back single lines of JSON as well. This mode was actually implemented specifically for mkdocstrings.

Configuration

The configuration options available are:

  • new_path_syntax: when set to true, this option forces the use of the new object path syntax, which uses a colon (:) to delimit modules from other objects.

  • filters: filters are regular expressions that allow to select or un-select objects based on their name. They are applied recursively (on every child of every object). If the expression starts with an exclamation mark, it will filter out objects matching it (the exclamation mark is removed before evaluation). If not, objects matching it are selected. Every regular expression is performed against every name. It allows fine-grained filtering. Example:

    • !^_: filter out every object whose name starts with _ (private/protected)
    • ^__: but still select those who start with two _ (class-private)
    • !^__.*__$: except those who also end with two _ (specials)
  • members: this option allows to explicitly select the members of the top-object. If True, select every members that passes filters. If False, select nothing. If it's a list of names, select only those members, and apply filters on their children only.

  • inherited_members: true or false (default). When enabled, inherited members will be selected as well.

  • docstring_style: the docstring style to use when parsing the docstring. google, restructured-text1 and numpy2.

  • docstring_options: options to pass to the docstring parser.

    • replace_admonitions boolean option (default: true). When enabled, this option will replace titles of an indented block by their Markdown admonition equivalent: AdmonitionType: Title will become !!! admonitiontype "Title".
    • trim_doctest_flags boolean option (default: true). When enabled, all doctest flags (of the form # doctest: +FLAG and <BLANKLINE>) located within python example blocks will be removed from the parsed output.

    The google docstring style accepts both options. The numpy style only accepts trim_doctest_flags. The restructured-text style does not accept any options.

1: reStructured Text parsing is in active development and is not feature complete yet.
2: The following sections are currently not supported : Notes, See Also, Warns and References.

Details on new_path_syntax

Example:

New syntax package.module:Class.attribute
Old syntax package.module.Class.attribute
  • If there is a colon is an object's path, pytkdocs splits the path accordingly, regardless of the value of new_path_syntax.
  • If there isn't a colon, and new_path_syntax is false, pytkdocs uses the old importing behavior.
  • If there isn't a colon, and new_path_syntax is true, pytkdocs uses the new importing behavior and therefore considers that the path points to a module.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].