Skip to main content

Create your own Shit Happens playing cards!

Project description

PyPI Contributors Forks Stargazers Issues MIT License


It Happens

Create your own Shit Happens playing cards!
Explore the docs »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contributing
  5. License
  6. Contact

About The Project

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)

Built With

Python

(back to top)

Getting Started

Prerequisites

A virtual environment with python 3.9 or higher.

Installation

Run

pip install ithappens

from within the target environment.

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.

The simplest way to do this is to use either Python's virtual environment venv or conda. Here, instructions for conda are shown.

conda env create -f environment.yml

Activate the environment using

conda activate ithappens-dev

Remember to activate the environment whenever you start working on ithappens.

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)

Usage

CLI

The tool is available as a command line interface (CLI). It requires an Excel file in the input directory (default current working directory). The excel files must have two columns with any header. The first column must contain the miserable situations. The second column must contain the corresponding misery indices. See the examples directory for an example.

usage: ithappens [-h] [-n NAME] [-m | --merge | --no-merge] [-s {front,back,both}] [-l {en,nl}] [-f {pdf,png}] [-r | --rank | --no-rank] [-w WORKERS] [-c CHUNKS] [input_dir]

help:
  -h, --help            show this help message and exit

input:
  input_dir             Input directory. Defaults to current working directory.

options:
  -n NAME, --name NAME  Expansion name. If no name is specified, infers name from input_dir.
  -m, --merge, --no-merge
                        Merge output. Defaults to --no-merge
  -s {front,back,both}, --side {front,back,both}
                        Side(s) to generate. Defaults to both.
  -f {pdf,png}, --format {pdf,png}
                        Output format. 'pdf' and 'png' supported. Defaults to 'pdf'.
  -r, --rank, --no-rank
                        Rank situations and output in new file. Does not guarantee a linear ranking, i.e. situations can have equal misery index. Ignores all other options. Defaults to --no-rank.

multiprocessing:
  -w WORKERS, --workers WORKERS
                        Number of workers. Defaults to 4.
  -c CHUNKS, --chunks CHUNKS
                        Number of chunks for the workers to process. Defaults to 30.

The input directory must be structured as follows:

expansion
├───images
│   └───expansion-logo.*
├───outputs
│   ├───back
│   └───front
└───*.xlsx

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)

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)

License

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

(back to top)

Contact

Project Link: https://github.com/siemdejong/ithappens

(back to top)

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

ithappens-5.0.2.tar.gz (58.1 kB view hashes)

Uploaded Source

Built Distribution

ithappens-5.0.2-py3-none-any.whl (43.4 kB view hashes)

Uploaded Python 3

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