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 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

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.7.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

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

haddock_curses-0.1.7-py2.py3-none-any.whl (9.7 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: haddock_curses-0.1.7.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for haddock_curses-0.1.7.tar.gz
Algorithm Hash digest
SHA256 6916ca1b38b7939ac0baf014ce446230850137353c709fe67b1322e65979959d
MD5 9a6e31b26d91d978c1857f88675996ef
BLAKE2b-256 0d4bb96ae68bcc043d1721fe8616f1d1a150c246ba61ab4b565b9f3db0108669

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for haddock_curses-0.1.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 91a82fe48eb6f55d3fc9109cb476efe35f012bcdcf1fa3a33bedb050efe8fd93
MD5 954f39d3fc9b99a1ddd23c55a5232679
BLAKE2b-256 37e39a6d8e7623ea0e6c80d5c28fdd6e767967f2bd91a16aa704e0c8a4985756

See more details on using hashes here.

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