Package: shithappens
Customized Shit HappensCreate your ownShit Happensplaying cards!Explore the docs »Report Bug·Request FeatureTable of ContentsAbout The ProjectBuilt WithGetting StartedPrerequisitesInstallationUsageContributingLicenseContactAbout The ProjectEver wanted to play with your ownShit Happensplaying 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 issuein case of any objections.(back to top)Built With(back to top)Getting StartedPrerequisitesA virtual environment with python 3.11 or higher.InstallationRunpip install shithappensfrom within the target environment.To allow for pdf merging, runpip install shithappens[merge].
To show a progressbar, runpip install shithappens[pbar].
To install all dependencies, runpip install shithappens[all].Installing for developersRetrieve the latest version of the codeDevelopers should fork this repository and rungit clone https://github.com/<your-username>/shit-happens.gitThis will place the sources in a directoryshit-happensbelow your current working directory, set up theoriginremote to point to your own fork, and set up theupstreamremote to point to theshit-happensmain repository.
Change into this directory before continuing:cd shit-happensCreate a dedicated environmentYou should set up a dedicated environment to decouple your shithappens development from other Python and shithappens 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.
If mamba is installed, replace conda with mamba in the commands below.conda env create -f environment.ymlActivate the environment usingconda activate shithappens-devRemember to activate the environment whenever you start working on shithappens.Installing shithappens in editable modeInstall shithappens in editable mode from the shithappens directory using the commandpython -m pip install -e .The 'editable/develop mode', builds everything and places links in your Python environment so that Python will be able to import shithappens from your development source directory.
This allows you to import your modified version of shithappens without re-installing after every change.(back to top)UsageCLIThe 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: shithappens [-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.
  -l {en,nl}, --lang {en,nl}
                        Language. 'en' and 'nl' supported. Defaults to 'en'.
  -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
└───*.xlsxIf the output folder does not exist, it will be created.
The format of the expansion logo must be onthis list.(back to top)ContributingAny contributions you make are greatly appreciated.Fork the ProjectCreate your Feature Branch (git checkout -b feature/AmazingFeature)Commit your Changes (git commit -m 'Add some AmazingFeature')Push to the Branch (git push origin feature/AmazingFeature)Open a Pull Request(back to top)LicenseDistributed under the GPL-3.0 license. SeeLICENSEfor more information.(back to top)ContactProject Link:https://github.com/siemdejong/shit-happens(back to top)