Skip to main content

PyDocument

Easy way to make a document with gui (tkinter)

Installing

Here is a simple way to install:

pip install pydocument

Here is a simple way to upgrade the package to the newest version:

pip install pydocument --upgrade

Example

from pydocument import Document, ARIALBOLD

document = Document(1000, 900, "Hello World")

document.add_text("Hello World", ARIALBOLD)
document.add_space()  # document.add_newline() also works

document.add_text("""
Hello world.. With PyDocument here, we can make such great documents..
PyDocument is so simple, and so small.. It's really easy to make documents
using PyDocument. It's really fun as well!
""")

document.start()

Documentation

  • Classes
    • Document

Document

Object

Creates new Document object

Note: All arguments are optional, so for example, the width will always be 200 unless you change it.

Parameters

  • width (Integer) = 200
  • height (Integer) = 200
  • title (String) = "pydocument"
  • bg (String) = "white"

Returns

  • Object

Example

Document(500, 500, "Hello Title", "gray")

Example on changing specific argument

Document(height=500, bg="gray")

Properties

  • app (Tkinter) - The document / window you created.
  • width (Integer) - The current width of the document / window.
  • height (Integer) - The current height of the document / window.
  • bg (String) - The background color of the document / window.

Methods

  • start
  • set_title
  • disable_maximize
  • enable_maximize
  • change_width
  • change_height
  • change_size
  • add_text
  • add_arial_text
  • add_arial_bold_text
  • add_space / add_newline

start

Starts the application / document (mainloop of tkinter)

Parameters

None

Returns

None

Example

.start()

set_title

Sets the title of the application / document

Parameters

  • title (String)

Returns

None

Example

.set_title("Hello Title")

disable_maximize

Disables the user from maximizing the window

Parameters

None

Returns

None

Example

.disable_maximize()

enable_maximize

Enables the user from maximizing the window

Parameters

None

Returns

None

Example

.enable_maximize()

change_width

Changes the width of the window

Parameters

  • width (Integer)

Returns

None

Example

.change_width(500)

change_height

Changes the height of the window

Parameters

  • height (Integer)

Returns

None

Example

.change_height(500)

change_size

Changes the size of the window

Parameters

  • width (Integer)
  • height (Integer)

Returns

None

Example

.change_size(500, 500)

add_text

Adds text to the application / document

Note: Arguments 'font', 'font_size', and 'bg' are optional

Parameters

  • text (String)
  • font (String) = "Arial"
  • font_size (Integer) = 20
  • bg (String) = None

Returns

None

Example

.add_text("Hello Text", "Arial Bold", 25, "gray")

Example on changing specific argument

.add_text("Hello Text", font_size=15)

add_arial_text

Adds arial font text to the application / document

Note: Arguments 'font_size' and 'bg' are optional

Parameters

  • text (String)
  • font_size (Integer) = 20
  • bg (String) = None

Returns

None

Example

.add_arial_text("Hello Text", 25, "gray")

Example on changing specific argument

.add_arial_text("Hello Text", bg="gray")

add_arial_bold_text

Adds arial bold font text to the application / document

Note: Arguments 'font_size' and 'bg' are optional

Parameters

  • text (String)
  • font_size (Integer) = 20
  • bg (String) = None

Returns

None

Example

.add_arial_bold_text("Hello Text", 25, "gray")

Example on changing specific argument

.add_arial_bold_text("Hello Text", bg="gray")

add_space

Adds a space to the application / document

Note: Arguments 'spaces' and 'bg' are optional

Parameters

  • spaces (Integer) = 1
  • bg (String) = None

Returns

None

Example

.add_space(3, "gray")

Example on changing specific argument

.add_space(bg="gray")

add_newline

Same thing as add_space.

Metadata

Release files for pydocument 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydocument 1.0
File Size Uploaded Provenance Actions
pydocument-1.0.tar.gz 3.4 kB Without provenance Details for pydocument-1.0.tar.gz

Release files / pydocument-1.0.tar.gz

Download URL pydocument-1.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ff24eaa666d09c05c24bb49de9607f108acfba1675e88a8926855c44b0fafa53
BLAKE2b-256 checksum
How to use checksums
c80206f458214a97bce8e9c84f0d42779e4da2f4e9a0bbedeacecbd8d83f7de8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.2

Security for pydocument 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page