Skip to main content

Random curses from Captain Haddock

Project description

Haddock

Aren't you bored of reading and writing the same error messages over and over again like "Wrong argument!", "End date must be after start date!" , "Division by zero!" etc. . With the haddock package you will be able to spice them up a bit:

  • "Wrong argument, dipsomaniac!"
  • "End date must be after start date, whipper-snapper!"
  • "Division by zero, interplanetary goat!"

To do this, the method curse() of this package returns random curses from Captain Haddock. At the moment it supports curses in english (default), german and french.

The sources for the curses are

Pull requests for other languages are welcome.

Installation

pip install haddock-curses

Usage

import haddock
>>> print(haddock.curse())
anthropophagus!

You can use the title() method from Python standard library to capitalize your swears.

>>> print(haddock.curse().title())
Brontosaurus!
>>> print(haddock.curse(lang="de").title())
Sie Logarithmus!
>>> print(haddock.curse(lang="fr").title())
Bande D'Ectoplasmes De Tonnerre De Brest 

You can decorate existing exception message with curses.

>>> try: 0/0
... except Exception as e: print(str(e) + ", " + haddock.curse() + "!")
...
division by zero, confounded rattletrap!!

Upload to PyPi

The project needs poetry for package management. To install on e.g. Mac OS X do

$ brew install poetry

You can then build and upload the package to Pypi simply by

$ poetry build    # will build both sdist and wheel 
$ poetry publish  # by default publishes to PyPi

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

haddock_curses-0.1.6.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

haddock_curses-0.1.6-py2.py3-none-any.whl (9.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file haddock_curses-0.1.6.tar.gz.

File metadata

  • Download URL: haddock_curses-0.1.6.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.1 CPython/3.12.2 Darwin/23.4.0

File hashes

Hashes for haddock_curses-0.1.6.tar.gz
Algorithm Hash digest
SHA256 a1e6f7ed7083fee4d621a120e833d9e9130dac4dd05d4766dd04ab72dfb30b8b
MD5 ec0dc947ad985a4a7fb8e5154a773d10
BLAKE2b-256 9218f2956cbb4315550e8f0fc50a39f9d976dee6772a4346ad4aff507fcfb13a

See more details on using hashes here.

File details

Details for the file haddock_curses-0.1.6-py2.py3-none-any.whl.

File metadata

  • Download URL: haddock_curses-0.1.6-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.1 CPython/3.12.2 Darwin/23.4.0

File hashes

Hashes for haddock_curses-0.1.6-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cae9986251c76bcb29c789aafb8c145d9855cefe2bde19958a115890fc7af0d7
MD5 e5e37db7bd0c8fb85df1ba9a7fb1b236
BLAKE2b-256 fdd980cc4641da2625b1d520cad6a4a07e9ad91397f69a00b7b6b2df095596cf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page