Skip to content

Code structure

mxrch edited this page Dec 7, 2022 · 3 revisions

ghunt/apis

These are all the classes to interact with the APIs.
An explanation of how to make your own API will be available later.

ghunt/helpers

As the name indicates, these are functions intended to facilitate certain actions, such as sorting data, managing the authentication part, displaying the banner, etc.
Examples:

  • auth.py - Manage the authentication
  • banner.py - Display the CLI banner
  • calendar.py - Retrieve and display information from a Google Calendar
  • drive.py - Retrieve Google Drive document users, comments, and sort them
  • gmail.py - Use a specific Gmail endpoint to check if an email address is registered with Google or not
  • gmaps.py - Everything related to Google Maps is in there (data retrieval, parsing, output), since I haven't found a Google Maps API to dump reviews and photos of a Google Maps user yet
  • ia.py - A wrapper that uses the Vision API to detect a face on a picture (the wrapper allows to manage the rate-limit, and display directly the result)
  • knowledge.py - All the functions that will interact with the GHunt knowledge (we'll talk about it later)
  • listener.py - The server that allows to receive the data sent by GHunt Companion
  • playgames.py - A wrapper that uses the PlayGames API to retrieve game data from a user
  • utils.py - Everyday functions, which don't really have a place elsewhere

ghunt/knowledge

This folder contains the GHunt knowledge, mainly a lot of hardcoded data. For example, the list of API keys of the different services and the link of these services, the definitions of the user types, the list of parameters that can be used on the Google Drive API, etc.

ghunt/modules

These are simply the modules that will be available via the CLI.

ghunt/objects

These are the data structure classes, a bit like the models in Golang.
This may be subject to change, for now it's like this. 😄

ghunt/parsers

Here are all the classes that will be used to parse the JSON results returned by the Google APIs, to transform them into Python objects, with type definition.
Most of the code has been written automatically using the Autoparse module of the GHunt RDTK (Research & Development Toolkit).

ghunt/protos

These are all files generated by protoc, to interact with Protobuf data.
Protobuf definitions are kept in the "definitions" subdirectories.

Clone this wiki locally