Skip to main content

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 uv

Before you can upload packages to PyPi you need to create an account at PyPi, activate 2FA (e.g. use Ente Authenticator) and create an API-Token. Then you can configure poetry to use the API-Token like

$ poetry config pypi-token.pypi <your-api-token>

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

Metadata

Release files for haddock-curses 0.1.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for haddock-curses 0.1.7
File Size Uploaded
haddock_curses-0.1.7.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for haddock-curses 0.1.7
File Interpreter ABI Platform
haddock_curses-0.1.7-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 18.2 kB

Release files / haddock_curses-0.1.7.tar.gz

Download URL haddock_curses-0.1.7.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6916ca1b38b7939ac0baf014ce446230850137353c709fe67b1322e65979959d
BLAKE2b-256 checksum
How to use checksums
0d4bb96ae68bcc043d1721fe8616f1d1a150c246ba61ab4b565b9f3db0108669
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.7

Release files / haddock_curses-0.1.7-py2.py3-none-any.whl

Download URL haddock_curses-0.1.7-py2.py3-none-any.whl
Size 9.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
91a82fe48eb6f55d3fc9109cb476efe35f012bcdcf1fa3a33bedb050efe8fd93
BLAKE2b-256 checksum
How to use checksums
37e39a6d8e7623ea0e6c80d5c28fdd6e767967f2bd91a16aa704e0c8a4985756
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.7

Release history Release notifications | RSS feed

This release

0.1.7 This release

2 release files

0.1.6

2 release files

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page