Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pythus

A python and CLI client for Pithus API.

Installation

$ git clone https://github.com/Pithus/pythus.git
$ cd pythus
$ poetry build
$ pip install dist/pythus-$VERSION-py3-none-any.whl

Usage

CLI

$ pythus --help
Usage: pythus [OPTIONS] COMMAND [ARGS]...

Options:
  -h, --host TEXT       API Host address
  -p, --port INTEGER    API port  [default: 80]
  -k, --api-key TEXT    Your API key, can be found in the My Hunting tab of
                        your instance
  --https / --no-https  Use HTTP instead of HTTPS  [default: https]
  -b, --beautify        Output pretty JSON
  -c, --color           Output pretty JSON
  -f, --config TEXT     Path to configuration file.
  --install-completion  Install completion for the current shell.
  --show-completion     Show completion for the current shell, to copy it or
                        customize the installation.
  --help                Show this message and exit.

Commands:
  list-reports
  get-report
  report-status
  report-exists
  list-apk
  upload-apk
  download-apk
  search

And for each command use --help to see the arguments, for example:

$ pythus get-report --help 
Usage: pythus get-report [OPTIONS] REPORT_ID

Arguments:
  REPORT_ID  Report identifier (sha256 of the APK)  [required]

Options:
  --help  Show this message and exit

Example usage:

pythus -h example.com -p 80 -k <YOUR API KEY> --no-https --color --beautify list-reports

Python library

from pythus.api_client import ApiClient

client = ApiClient(host="example.com", port=80, key="your api key")

h = client.list_reports()['reports'][0]["apk_hash"]
client.get_report_status(h)
client.get_report_exists(h)

Configuration file

If you are not a fan of passing arguments for host, port and API key, you can use a configuration file.

Copy the example config file to config.toml

$ cp config.example.toml config.toml

It will be automatically loaded from /etc/pythus/config.toml or $XDG_CONFIG_HOME/.config/config.toml or from the current working directory.

You can also pass it to the CLI or python library directly.

About

Pithus bazaar API client in python

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages