Skip to main content

Create links for Godot class names to Godot api help files

Project description

Make links to the Godot API references

This is a small tool to create links to the Godot Help API's and store them as a JSON file in the following format:

{
    "animationplayer": "https://docs.godotengine.org/en/stable/classes/class_animationplayer.html", 
    "directionallight": "https://docs.godotengine.org/en/stable/classes/class_directionallight.html", 
    "joint2d": "https://docs.godotengine.org/en/stable/classes/class_joint2d.html",
    "collisionobject2d": "https://docs.godotengine.org/en/stable/classes/class_collisionobject2d.html",
    "physicsbody": "https://docs.godotengine.org/en/stable/classes/class_physicsbody.html",
    "visibilitynotifier2d": "https://docs.godotengine.org/en/stable/classes/class_visibilitynotifier2d.html",
       .
       .
       .
}

The Json file can then be used as a list, dictionary etc. to link the Godot class name with its associated help page on the godot website.

Prerequisites

The program relies upon the GhApi library and instructions for its installation and use; it will fail to install if the GhApi library is not already installed. Instruction for the installation of GhApi can be found at https://ghapi.fast.ai

Installing

You can install the Godot api reference maker package with pip:

# On Linux
python3 -m pip install godot-api-refs

# On Windows, if you installed Python 3.7+, you can use:
python -m pip install godot-api-refs

I do not have access to a MacOS box so cannot test if it installs and runs OK in that environment. However, the program is quite simple so it should prove no problem for a standard python environment.

Running the program

The program can be run using

python -m godot_api_refs

This will generate the Godot class links from the stable branch and store them in the file godot_api_calls.json in the current working directory

The progam can be invoked with -h which will give the following output:

usage: python -m godot_api_ref [options]

Given a godot-docs branch it scans the class folder and creates a JSON file linking the Godot class name with the API reference

optional arguments:
  -h, --help        show this help message and exit
  --token TOKEN     optional github access token (default "" may only gives 60 reads/hour)
  --branch BRANCH   optional branch for the class files (default: stable)
  -v, --verbose     Set the verbosity level. For example -vv sets verbosity to level 2. Default: 0.
  --check-branches  print out a list of the Godot document branches then exit without making the links

The Godot API list can be read from branches other than the stable branch if you require it by using the --branch option (for example --branch master will load links to the latest API documentation. )

The option --check-branches is an aid to show what branches are available on github; it will print out a simple list then exit.

The option --token allows the user to supply an github user token. This is available in case the user has exhausted their calls to the github api using unauthenticated requests.

The output file will be godot_api_calls.json and will be placed in current working directory.

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

godot-api-refs-0.1.3.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

godot_api_refs-0.1.3-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file godot-api-refs-0.1.3.tar.gz.

File metadata

  • Download URL: godot-api-refs-0.1.3.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for godot-api-refs-0.1.3.tar.gz
Algorithm Hash digest
SHA256 dd009be1ce89fbf7374823f020da7dabca6b5f29ec58848d2dad26645cc508cb
MD5 d7c76856e24d1d78ba1b8d0cbdb4e661
BLAKE2b-256 208ddcd4e0f5e8337d415d69a9d5307d739faaa8a8397fe1f064f603d9c1cca6

See more details on using hashes here.

File details

Details for the file godot_api_refs-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: godot_api_refs-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for godot_api_refs-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 76aa668c279a5c47fee5b901837e996b9c46e9e1f7407bfb9c0f0490c029cbf7
MD5 0c75c4623d85a8516c9fb351ace7e149
BLAKE2b-256 4199f1d57989ec7ea99d995922a25ef799427be72ddf326a9343d68138ea1e70

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