Skip to main content

Plotly graph export library

Project description

tetsuya

tetsuya collects information and offers it up as JSON packets and pretty print strings.

It's very easy to extend:

  • Write a function (a service) that collects information from web/system.
    • It takes a dataclass as a config object (can be empty).
    • It returns another dataclass as a report.

tetsuya offers the report object to your user (and your user only) as a JSON endpoint available via REST and command-line interface.

You will also define two functions on your report dataclass: short() and long() which can pretty-print the JSON.

It does some helpful stuff automatically:

  1. tetsuya can cache your new service for you and auto-refresh the cache: all tetsuya service configs have a cachelife integer and autorefresh boolean.

  2. tetsuya will derive the default config from your dataclass, but will read a .toml if you want to change it.

  3. tetsuya runs in a client-server model, with a background daemon doing the work, and a CLI interface for basic control.

Try uvx tetsuya --help-tree=ascii to see the whole interface.

Installation

Daemon on systemd

Theres a tetsuya.service file in the repository.

mkdir -p ~/.config/systemd/user

systemctl --user daemon-reload
systemctl --user enable --now "$(realpath ./tetsuya.service)"

loginctl enable-linger "$USER" # (allow it to start at boot even if logged out)

journalctl --user -u tetsuya -f

Roadmap

I think service manager needs to be part of core, and needs to be split into an interface_api subpacket (cli+daemon) which imports the typers/routers from further submodules per section and combines them into one.

Then there would be a subpackage of course services. Note for doing updates:

if which yay 1> /dev/null; then
  (
  set -e
  yay -Qu
  yay -Pw
  checkupdates
  )
fi
  • Some early modules:
    • Do a Basic 200 is it good thing
      • Check domains for email record
      • Check SLL
    • Active sessions on linux
    • Updates available
      • Changelog on kernel
  • Any errors on systemd + --kernel
  • Monarch Money from that guy? - MoneyFlown and redeploy
  • Improve naming and arguments, flags, etc.
    • -> Services to Client
    • Names of services = arguments
    • Add help descriptions
    • Turn off options like --thing, --no-thing, if --no-thing is default?
    • Go back to CLI and do the formatting better
  • Document throughout code
  • If we want to instantiate multiple instances of one service class:
  • Inspect:
    • all instances of get_name()
    • how services are registered
    • Consider Dictionary Storage and Access Here:
      • _config.config_data
      • _timer.timer_tasks
      • service manager.?? (Not written at this time)
    • Will have to pass both service obj + class to _config, _timer
    • Make room for customed name in config + .get_name()
    • Start will have change (calls a lot of this stuff)
  • Don't enable service until it has a config
    • Allow per app config default generation
    • Upon reload, recalculate active services
    • Config API:
      • Separate Touch and Dump
  • Create persistence:
    • Roundtrip reports upon registering (json and back)
    • Save reports upon running
    • Load reports upong starting
  • Services can subscribe to changes of other services
  • Importing modules dynamically from a subfoler

Desired Modules

  • Google drive auditor, google accounts/emails
  • Check agreements (modules subscribed to other modules)
    • are we checking all domains that namecheap lists
    • does google list all
  • Analytics summary + link
  • Git status
  • Scrape forum posts
  • Firewall stats
  • process accounting?

Docs Needed

  • Examples in how its used
  • Browsing available services
  • Activating a new service
  • Controlling inspecting services
  • Writing your own service
  • Connecting remotely

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

tetsuya-0.2.1.tar.gz (14.6 kB view details)

Uploaded Source

Built Distribution

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

tetsuya-0.2.1-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file tetsuya-0.2.1.tar.gz.

File metadata

  • Download URL: tetsuya-0.2.1.tar.gz
  • Upload date:
  • Size: 14.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tetsuya-0.2.1.tar.gz
Algorithm Hash digest
SHA256 8e1f33cec3561b7ee650feccd6ec324f2fde9c1044a898a4b83f058bcb2e5d1c
MD5 26372b3628b84efe54661b6258523065
BLAKE2b-256 2bf6bd1e2975eb6255ed6870a0a115438009b9db691637d68e36a8b82f40ec4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for tetsuya-0.2.1.tar.gz:

Publisher: publish_all.yml on geopozo/tetsuya

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tetsuya-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: tetsuya-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tetsuya-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a2f09f552f927146ee67fe357c89c6197f739389ac9aed86088ae0e594c64f3e
MD5 82f73070865a45a1860eabfdd2c4e386
BLAKE2b-256 37aa39276a0f402884554df628a7f507d23553955cca6e5083be61a2a583ff8a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tetsuya-0.2.1-py3-none-any.whl:

Publisher: publish_all.yml on geopozo/tetsuya

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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