Skip to main content

The handy yet powerful GUI toolkit.

Project description

Python version of the Atlas toolkit

Run on Repl.it Version 0.11 Stars license: MIT Documentation

VersionDownload stats

The Atlas toolkit is available for:

Language GitHub repository Online démonstrations Stars
Java https://github.com/epeios-q37/atlas-java https://q37.info/s/3vwk3h3n Stars
Node.js https://github.com/epeios-q37/atlas-node https://q37.info/s/st7gccd4 Stars
Perl https://github.com/epeios-q37/atlas-perl https://q37.info/s/h3h34zgq Stars
Python https://github.com/epeios-q37/atlas-python https://q37.info/s/vwpsw73v Stars
Ruby https://github.com/epeios-q37/atlas-ruby https://q37.info/s/9thdtmjg Stars

If you are looking for the WebGPIO application, an application with which you can control the Raspberry Pi (or other similar devices) GPIO with your smartphone, you will find it at the bottom of this page, in the Raspberry Pi/ODROID-C2 section.


Straight to the point: the Hello, World! program

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(dom):
  dom.setLayout("", body)
  dom.focus("input")

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

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

callbacks = {
  "": acConnect,  # The action label for a new connection is an empty string.
  "Submit": acSubmit,
  "Clear": acClear,
}

Atlas.launch(callbacks)

Result

Little demonstration

Try it yourself, now

Online, with nothing to install

Thanks to Replit, an online IDE, you can write and run programs using the Atlas toolkit directly in your web browser, without having to install Python on your computer.

To see some examples, like the following TodoMVC application or the above Hello, World! program, simply:

  • go here (also accessible with the Run on Repl.it badge on the top of this page),
  • click on the green run button,
  • select the demonstration you want to see,
  • click (or scan with your smartphone) the then displayed QR code,
  • … and, as you wish, run your own tests directly in your web browser, by modifying the code of the examples or by writing your own code.

TodoMVC

With Python on your computer

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

Your turn

If you want to take your code to the next level, from CLI to GUI, then you found the right toolkit.

With the Atlas toolkit, you transform your programs in modern web applications (SPA), but without the usual hassles:

  • no JavaScript to write; only HTML(/CSS) and Python,
  • no front and back end architecture to bother with,
  • no web server (Apache, Nginx…) to install,
  • no need to deploy your application on a remote server,
  • no incoming port to open on your internet box or routeur.

The Atlas toolkit is written in pure Python, with no native code and no dependencies, allowing the Atlas toolkit to be used on all environments where Python is available.

And, icing on the cake, simply by running them on a local computer with a simple internet connexion, applications using the Atlas toolkit will be accessible from the entire internet on laptops, smartphones, tablets…

The Atlas toolkit is particularly well suited for educational purposes, to write modern programming exercises, i.e. with a true graphical interface instead of the usual outdated textual one. More about this can be found here.

There is also a stub to for this library at address https://q37.info/s/zzcn3wnx.

Content of the repository

The atlastk directory contains the Python source code of the Atlas toolkit, which is the directory 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.

In the examples directory, you will found following examples:

Other examples are detailed in the next section.

Except for the ErgoJr, GPIO and RGB applications, which are detailed in the next section, to run an example, launch, from within the repository, python main.py, and select the example you want to run. You can also directly launch, from within the examples directory, python <Name>/ (don't forget the final /), where <Name> is the name of the example (Blank, Chatroom…).

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 does 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, from within the examples directory, 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

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.11.1.tar.gz (12.9 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.11.1-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: atlastk-0.11.1.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.9

File hashes

Hashes for atlastk-0.11.1.tar.gz
Algorithm Hash digest
SHA256 49b4df787f5777c91ed850c3b6eaaeeb710a402569731cbe73581c57e71cbe00
MD5 f685b963be4a91fa0150f33d44d7ca87
BLAKE2b-256 cd66fab59b8c59c5eeff39743d0e779f3b22d46721614a8cc159f6183c08d701

See more details on using hashes here.

File details

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

File metadata

  • Download URL: atlastk-0.11.1-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.6.9

File hashes

Hashes for atlastk-0.11.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d1609a91db729d588c7a7966fc49f8b3f4f4482e32cb6ac98b1e9be5ec8e8770
MD5 9d952a14d263293d19048e308f94d940
BLAKE2b-256 f5f188eeff742ddde307f389a0fff7473b6334b9eab3e2755910b0fbf0a9cd17

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