Skip to content

siemdejong/ithappens

Repository files navigation

PyPI Contributors Forks Stargazers Issues GPLv3 License


It Happens

Create your own Shit Happens playing cards!
Go to the app »

Front: "You don't know how to use this tool. Misery index 80" Back: It Happens, Example expansion
Front Back

Ever wanted to play with your own Shit Happens playing cards? Now you can. Write down the most miserable situations you can think of and rank them. This project automatically outputs playing cards in pdf format.

This project is not related to the original card game. Open an issue in case of any objections.

(back to top)

Getting started

App

The tool is available as an online app.

CLI

The tool is also available as a command line interface (CLI), see Local installation. The tool requires an Excel or csv input file and optionally an expansion logo. The input files must have header "misery index" and "situation" and optional "image" for the front image. If an image name is given (stem + ext), it must live in the image dir, given by the optional third positional argument. See the examples directory for an example.

Usage: ithappens create [OPTIONS] INPUT_FILE OUTPUT_DIR [IMAGE_DIR]

  Create cards.

Options:
  -n, --name TEXT                 Expansion name. If no name is specified,
                                  infers name from input_dir.
  -m, --merge                     Merge output.
  -s, --side [front|back|both]    Side(s) to generate.
  -e, --expansion_logo_path FILE  Expansion logo path.
  -f, --format [pdf|png]          Output format.
  -w, --workers INTEGER           Number of workers.
  --help                          Show this message and exit.

If the output folder does not exist, it will be created. The format of the expansion logo must be on this list.

(back to top)

Local installation

The app can be installed with pip install ithappens.

Prerequisites

A virtual environment with python 3.9 or higher.

Installing for developers

Retrieve the latest version of the code

Developers should fork this repository and run

git clone https://github.com/<your-username>/ithappens.git

This will place the sources in a directory ithappens below your current working directory, set up the origin remote to point to your own fork, and set up the upstream remote to point to the ithappens main repository. Change into this directory before continuing:

cd ithappens

Create a dedicated environment

You should set up a dedicated environment to decouple your ithappens development from other Python and ithappens installations on your system.

Installing ithappens in editable mode

Install ithappens in editable mode from the ithappens directory using the command

python -m pip install -e .[dev]

The 'editable/develop mode', builds everything and places links in your Python environment so that Python will be able to import ithappens from your development source directory. This allows you to import your modified version of ithappens without re-installing after every change.

(back to top)

Contributing

Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Built With

Python Streamlit

(back to top)

License

Distributed under the GPL-3.0 license. See LICENSE for more information.

(back to top)