{"id":22843049,"url":"https://github.com/deflatedpickle/quill","last_synced_at":"2025-10-24T21:32:03.550Z","repository":{"id":82963280,"uuid":"85439463","full_name":"DeflatedPickle/quill","owner":"DeflatedPickle","description":"A Python library used to create point-and-click text-based games and software.","archived":false,"fork":false,"pushed_at":"2018-07-16T03:42:24.000Z","size":38,"stargazers_count":10,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T10:11:18.016Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DeflatedPickle.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-18T23:51:59.000Z","updated_at":"2021-02-24T02:12:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"c3919386-45f4-43b8-a22f-6808f089a139","html_url":"https://github.com/DeflatedPickle/quill","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeflatedPickle%2Fquill","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeflatedPickle%2Fquill/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeflatedPickle%2Fquill/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeflatedPickle%2Fquill/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeflatedPickle","download_url":"https://codeload.github.com/DeflatedPickle/quill/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251321525,"owners_count":21570755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T02:12:35.340Z","updated_at":"2025-10-24T21:31:58.497Z","avatar_url":"https://github.com/DeflatedPickle.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# quill\nA Python library used to create text-based games with TkInter.\n\n[![PyPI](https://img.shields.io/pypi/pyversions/quill.svg)](https://pypi.python.org/pypi/quill)\n[![PyPI](https://img.shields.io/pypi/v/quill.svg)](https://pypi.python.org/pypi/quill)\n\n[![PyPI](https://img.shields.io/pypi/dd/quill.svg)](https://pypi.python.org/pypi/quill)\n[![PyPI](https://img.shields.io/pypi/dw/quill.svg)](https://pypi.python.org/pypi/quill)\n[![PyPI](https://img.shields.io/pypi/dm/quill.svg)](https://pypi.python.org/pypi/quill)\n\n## Quill Examples\n\nIncase you would like to read some examples of `quill` in action, feel free to read through the included examples;\n- `quill_game.py`, a simple game made with `quill`.\n- `quill_widgets.py`, a showcase of widgets available.\n- `quill_calculator.py`, a simple calculator made with `quill`.\n\n## Getting Started\n\n### Installing The Library\n\nFirst off, you will need to have Python 3 installed and have Python in your system PATH. Then, you will need to open your system's terminal and type: `pip install quill`, this will install this library to your system.\n\n### Updating The Library\n\nBeing in development, this library will occasionally be updated. Since updates are not automatic, when you would like to update the library to get new features, you will need to open your system's terminal and type: `pip install quill --upgrade`, this will then update the library to the latest version.\n\n## Using The Library\n\nTo use the library in your code, simply import like so: `import quill`.\n\n### Creating The Window\n\nTo create the window, you'll want to subclass `quill.Window`.\n\n```python\nimport quill\n\n\nclass Game(quill.Window):\n    pass\n```\n\nAfter subclassing the `Window` class, you should make use of the classes `startup` function and use it to define your variables.\n\n```python\nimport quill\nfrom tkinter import IntVar\n\n\nclass Game(quill.Window):\n    def startup(self):\n        self.variable = IntVar()\n```\n\n### Creating A Room\n\n`quill` treats functions as rooms, and they should be used as so. We'll first need to make a function.\n\n```python\nimport quill\nfrom tkinter import IntVar\n\n\nclass Game(quill.Window):\n    def startup(self):\n        self.variable = IntVar()\n\n        self.start()\n        \n    def start(self):\n        pass\n```\n\n### Creating An Item\n\nWith `quill`, you can create items for your player to find throughout the game. They can be created by using the `quill.Item` class.\n\n```python\nself.sword_broken = quill.Item(self, \"Broken Sword\", {\"weapon\": {\"type\": \"sword\", \"damage\": 5}}, rarity=\"Common\")\n```\n\n### Creating A LootTable\n\nLootTables are used to store mass amounts of items, a LootTable is then assigned to a container. When the container is opened, a random item can be picked from the LootTable and added to the player's inventory. They can be created with the `quill.LootTable` class.\n\n```python\nself.loot_small_chest = quill.LootTable(self, \"Small Chest\", [self.sword_broken])\n```\n\n### Window Commands\n\nThe `Window` class comes with a lot of built-in commands to use, a few of these are needed with every function. You can find a few helpful ones below:\n\n**Modifier Functions**\n- `enable()` allows for text to be entered into the `tk.Text` widget.\n- `clear()` clears all text from the `tk.Text` widget.\n- `disable()` removes the ability for text to be entered into the `tk.Text` widget, without this at the end of the function, the player could enter in whatever text they wanted.\n- `goto_end()` scrolls the `tk.Text` widget to the bottom.\n\n**Insert Functions**\n- `insert_text(what, fill_line, index, tag)` inserts a string of text.\n- `insert_extending_text(what, extend, fill_line, index, command)` inserts a string of text which changes into a different string once the player clicks on it.\n- `insert_command(what, fill_line, index, command)` inserts a command which can be pressed to run a function.\n- `insert_checkbutton(what, variable, fill_line, index, command)` inserts a checkbutton which can be pressed to change it's state.\n- `insert_radiobutton(what, variable, value, fill_line, index, command)` inserts a radiobutton which can be pressed to change the value of a variable.\n- `insert_trigger(what, index, command)` inserts a trigger which can be used run a command once.\n\n\n- `insert_container(loot_table, fill_line, index, command)` inserts a container which can be clicked to give the player an item.\n- `insert_item(item, fill_line, index)` inserts an item which can be clicked to show it's stats.\n- `insert_merchant(merchant, fill_line, index)` inserts a merchant which can be clicked to show it's inventory.\n- `insert_quest(quest, fill_line, index)` inserts a quest which can be clicked to show it's inventory.\n\n**Insert Spaces**\n\n- `insert_newline()` inserts a new line.\n- `insert_space()` inserts a space.\n- `insert_tab()` inserts a tab.\n\n**Insert Widgets**\n\n- `insert_tk_button()` inserts a `tk.Button`.\n- `insert_tk_checkbutton()` inserts a `tk.Checkbutton`.\n- `insert_tk_entry()` inserts a `tk.Entry`.\n- `insert_tk_frame()` inserts a `tk.Frame`.\n- `insert_tk_label()` inserts a `tk.Label`.\n- `insert_tk_labelframe()` inserts a `tk.LabelFrame`.\n- `insert_tk_menubutton()` inserts a `tk.Menubutton`.\n- `insert_tk_panedwindow()` inserts a `tk.PanedWindow`.\n- `insert_tk_radiobutton()` inserts a `tk.Radiobutton`.\n- `insert_tk_scale()` inserts a `tk.Scale`.\n- `insert_tk_scrollbar()` inserts a `tk.Scrollbar`.\n\n\n- `insert_tk_canvas` inserts a `tk.Canvas`.\n- `insert_tk_listbox` inserts a `tk.Listbox`.\n- `insert_tk_message` inserts a `tk.Listbox`.\n- `insert_tk_text` inserts a `tk.Text`.\n- `insert_tk_spinbox` insert a `tk.Spinbox`.\n\n\n- `insert_ttk_button()` insert a `ttk.Button`.\n- `insert_ttk_checkbutton()` inserts a `ttk.Checkbutton`.\n- `insert_ttk_entry()` inserts a `ttk.Entry`.\n- `insert_ttk_frame()` inserts a `ttk.Frame`.\n- `insert_ttk_label()` inserts a `ttk.Label`.\n- `insert_ttk_labelframe()` inserts a `ttk.LabelFrame`.\n- `insert_ttk_menubutton()` inserts a `ttk.Menubutton`.\n- `insert_ttk_panedwindow()` inserts a `ttk.PanedWindow`.\n- `insert_ttk_radiobutton()` inserts a `ttk.Radiobutton`.\n- `insert_ttk_scale()` inserts a `ttk.Scale`.\n- `insert_ttk_scrollbar()` inserts a `ttk.Scrollbar`.\n\n\n- `insert_ttk_combobox()` inserts a `ttk.Combobox`.\n- `insert_ttk_notebook()` inserts a `ttk.Notebook`.\n- `insert_ttk_progressbar()` inserts a `ttk.Progressbar`.\n- `insert_ttk_separator()` inserts a `ttk.Separator`.\n- `insert_ttk_treeview()` inserts a `ttk.Treeview`.\n\n**Tag Functions**\n- `new_tag()` create a new tag.\n- `tag_configure()` configure an existing tag.\n- `tag_delete()` deletes an existing tag.\n- `tag_get_all()` returns all current tags of the `tk.Text` widget.\n- `tag_get_all_type()` returns all current tags of the `tk.Text` that follow a certain type.\n\n**Window Functions**\n- `normal()` un-maximizes the window\n- `maximise()` maximizes the window\n- `unfullscreen()` un-full-screens the window\n- `fullscreen()` makes the window full-screen\n- `add_borders()` adds the borders and title bar back to the window\n- `remove_borders()` removes the borders and title bar from the window\n\n**Other Functions**\n- `exit()` exits the game.\n\n### Creating A Menu\n\nMost games these days have menus, and it'd be a good idea to have one. Thankfully, menus can easily be made with `quill`.\n\n#### Creating The Start Menu\n\n```python\nimport quill\n\n\nclass Game(quill.Window):\n    def startup(self):\n        self.menu()\n        \n    def menu(self, *args):\n        self.enable()\n        self.clear()\n\n        self.insert_text(\"Maze Game\", True, tag=\"Heading-4\")\n\n        self.insert_command(\"\u003e Start\", command=self.start)\n        self.insert_command(\"\u003e Exit\", command=self.exit)\n\n        self.goto_end()\n        self.disable()\n\n    def start(self, *args):\n        self.enable()\n        self.clear()\n\n        self.goto_end()\n        self.disable()\n```\n\n#### Creating The Option Menu\n\nYou might find that you want an option menu in your game. These can also be made easily.\n\n```python\nimport quill\nfrom tkinter import BooleanVar, IntVar\n\n\nclass Game(quill.Window):\n    def startup(self):\n        self.variable_full_screen = BooleanVar()\n        self.variable_menu = BooleanVar()\n        self.variable_difficulty = IntVar()\n        self.menu()\n\n    def menu(self, *args):\n        self.enable()\n        self.clear()\n\n        self.insert_text(\"Maze Game\", True, tag=\"Heading-3\")\n\n        self.insert_command(\"\u003e Start\", command=self.start)\n        self.insert_command(\"\u003e Options\", command=self.options)\n        self.insert_command(\"\u003e Exit\", command=self.exit)\n\n        self.goto_end()\n        self.disable()\n\n    def start(self, *args):\n        self.enable()\n        self.clear()\n\n        self.goto_end()\n        self.disable()\n\n    def options(self, *args):\n        self.enable()\n        self.clear()\n\n        self.insert_text(\"Options\", tag=\"Heading-3\")\n        self.insert_new_line()\n\n        self.insert_text(\"Window Options\", True, tag=\"Heading-4\")\n        self.insert_checkbutton(\"Full Screen\", self.variable_full_screen)\n        self.insert_checkbutton(\"Show Menu\", self.variable_menu)\n        self.insert_new_line()\n\n        self.insert_text(\"Difficulty\", tag=\"Heading-4\")\n        self.insert_radiobutton(\"Very Easy\", self.variable_difficulty, 0)\n        self.insert_radiobutton(\"Easy\", self.variable_difficulty, 1)\n        self.insert_radiobutton(\"Medium\", self.variable_difficulty, 2)\n        self.insert_radiobutton(\"Hard\", self.variable_difficulty, 3)\n        self.insert_radiobutton(\"Are You Insane?\", self.variable_difficulty, 4)\n        self.insert_new_line()\n\n        self.insert_new_line()\n        self.insert_command(\"\u003c Back\", command=self.menu)\n\n        self.goto_end()\n        self.disable()\n```\n\n### Running Your Game\n\nAt some point, you will find that you actually want to play your game. Put this at the bottom of your script to run it:\n\n```python\ndef main():\n    app = Game(title=\"Maze Game\")\n    app.mainloop()\n\nif __name__ == \"__main__\":\n    main()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeflatedpickle%2Fquill","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeflatedpickle%2Fquill","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeflatedpickle%2Fquill/lists"}