Skip to main content

A fast and easy way to add a graphical user interface (GUI) to your programs.

Project description

Python version of the Atlas toolkit

For Python

Version 0.10.2 Download stats StarsLicense

If you are looking for the WebGPIO application, you will find it at the bottom of this page (in the Raspberry Pi/ODROID-C2 section).

A fast and easy way to add a graphical user interface (GUI) to your Python programs.

With the Atlas toolkit, both front and back ends are handled by the same code, and the programs will also be reachable from all over the internet.

Only basic knowledge of web technologies are required (no JavaScript knowledge required). And, with the Atlas toolkit, you can easily add a GUI to a programs originally designed to have a CLI, so the users of this programs can choose which interface they want to use.

If you want to use the Atlas toolkit without installing the examples, simply install the atlastk package from PyPI (pip install atlastk). This package has no dependencies.

You can also use the Atlas toolkit on Repl.it, an online IDE, so you have nothing to install. You will find some examples in the next sections. Important: you have to fork this examples before launching them (by clicking the dedicated button or by modifying the source code), or they won't work properly! See http://q37.info/s/zbgfjtp9 for more details.

15-puzzle game

Before we dive into source code, let's begin with a live demonstration of the 15-puzzle game made with Atlas toolkit: http://q37.info/s/mdghbt3n (more about live demonstrations)!

Reversi game

Yet another game; the Reversi (aka Othello) game: http://q37.info/s/jhv7dtsp.

There are two other versions of this game: a version with less CSS stuff (http://q37.info/s/kwck3t7n), and another which demonstrates the use of XSL (http://q37.info/s/3cbd7w9n). There are intended as part of a future tutorial about the Atlas toolkit.

Hello, World!

Here's how a Hello, World! type program made with the Atlas toolkit looks like:

Little demonstration

  • git clone http://github.com/epeios-q37/atlas-python
  • cd atlas-python
  • python Hello/Hello.py

You can also put below source code in a file and launch it after having installed the atlastk package (pip install atlastk), or, with absolutely no installation, paste the below code here, and open the displayed URL in a web browser.

For a live demonstration: http://q37.info/s/vhnb3q3v.

Source code:

import atlastk as Atlas

body = """
<div style="display: table; margin: 50px auto auto auto;">
 <fieldset>
  <input id="input" maxlength="20" placeholder="Enter a name here" type="text"
         data-xdh-onevent="Submit" value="World"/>
  <div style="display: flex; justify-content: space-around; margin: 5px auto auto auto;">
   <button data-xdh-onevent="Submit">Submit</button>
   <button data-xdh-onevent="Clear">Clear</button>
  </div>
 </fieldset>
</div>
"""

def acConnect(hello, dom):
  dom.setLayout("", body)
  dom.focus("input")

def acSubmit(hello, dom):
  dom.alert("Hello, " + dom.getContent("input") + "!")
  dom.focus("input")

def acClear(hello, dom):
  if ( dom.confirm("Are you sure?") ):
    dom.setContent("input", "")
  dom.focus("input")

callbacks = {
  "": acConnect,  # This key is the action label for a new connection.
  "Submit": acSubmit,
  "Clear": acClear,
}

Atlas.launch(callbacks)

TodoMVC

And here's how the Atlas toolkit version of the TodoMVC application looks like:

TodoMVC

For a live demonstration: http://q37.info/s/n9nnwzcg.

Content of the repository

The atlastk directory contains the Python source code of the Atlas toolkit, which is not needed to run the examples.

Atlas.python.zip is the file you have to reference in PYTHONPATH in order to use the Atlas toolkit in your own program (unless you have installed the atlastk package with pip install atlastk).

All other directories are examples.

To run an example, launch python <Name>/ (don't forget the final /), where <Name> is the name of the example (Blank, Chatroom…), except for the ErgoJr, GPIO and RGB applications, which are detailed just below.

The Stars application is an example where the Atlas toolkit is used to control a Pygame based application. Of course, Pygame needs to be installed.

Raspberry Pi/ODROID-C2

If the applications do not work on your Raspberry Pi, please see this issue: https://github.com/epeios-q37/atlas-python/issues/1

The GPIO and RGB applications are designed to be used on a Raspberry Pi or a ODROID-C2.

For the Raspberry Pi, the RPi.GPIO Python module have to be installed (this is probably already the case).

For the ODROID-C2, The Python version of WiringPi must be installed, and the application has to be launched with sudo (sudo python GPIO/ or sudo python RGB/).

The ErgoJr application is experimental and to control a Poppy Ergo Jr robot.

The RGB application is dedicated to the control of a RGB led, and the GPIO (aka WebGPIO) application allows to control the basic pins. Here is a video to see how they works:

RGB video

Same video on PeerTube : https://peertube.video/videos/watch/e7e02356-c9c3-4590-8ec0-8f8da06ff312

This applications are only examples to show how easily it is to write your own applications.

Miscellaneous

The Atlas toolkit is also available for:

For more information about the Atlas toolkit, go to http://atlastk.org/.

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

atlastk-0.10.2.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

atlastk-0.10.2-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

File details

Details for the file atlastk-0.10.2.tar.gz.

File metadata

  • Download URL: atlastk-0.10.2.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.4

File hashes

Hashes for atlastk-0.10.2.tar.gz
Algorithm Hash digest
SHA256 f6a9ab1b4402b13318aede3d514682e444d7a0ed2f38b5e22aa15c9e97f34e03
MD5 28331cea50850a10ce51e410d11c1644
BLAKE2b-256 d963f181a40badd17a08254ea5103b40b552d749e4655a9c092ea6fcc57410a0

See more details on using hashes here.

File details

Details for the file atlastk-0.10.2-py3-none-any.whl.

File metadata

  • Download URL: atlastk-0.10.2-py3-none-any.whl
  • Upload date:
  • Size: 19.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.4

File hashes

Hashes for atlastk-0.10.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5e29774a3257dc241c7409ddd5831bcab4a9fcef3bd5be6ce558ef76e0f6df62
MD5 9b9d711ca876a9881f9104ca4b8eefb5
BLAKE2b-256 abb4ddb728e0dfe35dc20d7144b4b303bb95482bc2e8b8a501ad384801172781

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page