Skip to main content

Qforms: google-forms like local form generator tool

Project description

QForms

QuickForms (qforms) is a local form generation tool designed as an alternative to proprietary services like Google Forms. It empowers users to maintain complete control over their data while providing a simple, command-line interface for creating forms.

This tool comes to me as quite useful because of how simple and quick it is to make a form. One of the difficulties that appear is sharing the form’s link with other people. We recommend using ngrok so that other people can access your local machine. Ngrok used to be an embedded feature in qforms, but it stopped working for some reason and is no longer included.

This tool is in a very early stage, so we always welcome contributions to the project!

Features

  • Keep your data local - no third-party services involved
  • Generate forms from simple YAML configuration files
  • Automatically creates a web form accessible via browser
  • Support for file submissions
  • JSON and CSV output options

Installation

Install QForms using pip:

pip install qforms

Quick Start

  1. Create a YAML configuration file (see examples below)
  2. Start the server:
qforms [options] [config.yaml]
  1. Open your browser and navigate to the displayed URL
  2. Fill out and submit your form
  3. View collected data in the generated output files

Command Line Options

Option Description
-h Display help message
-c Export submissions to CSV format
-d <domain> Set server host domain (default: localhost)

Configuration File Format

QForms uses YAML configuration files with the following structure:

- title              # Form title (first line of config)

- id: <field_name>   # Unique identifier for the field 
  t: <field_type>    # Type - specifies the HTML input element  (Optinoal, textbox is the default
  o:                 # Options - list of choices (for radio/checkbox)
    - <option1>
    - <option2>
  h: <description>   # Helper - descriptive text for the field  (Optional)
  r: <boolean>       # Required - whether field must be filled  (Optional)

Helper descriptions (h) and required flags (r) are optional. If no type is specified, a text input (str) is used by default. Onlyradio and check types require the options (o) list

Field Types

QForms supports four field types that correspond to different HTML input elements:

Type HTML Element Description Selection
str Text input Single-line text box N/A
file File input File upload field N/A
radio Radio buttons Multiple choice (single selection) 1 option
check Checkboxes Multiple choice (multiple selections) N options

Example Configuration File

Here’s an example of a valid YAML configuration file for qforms

A minimal form for payment processing:

- Payment Information

- id: name
  h: Full name as it appears on your ID
  r: true

- id: date
  h: Transaction date (YYYY-MM-DD)
  r: true

- id: observations
  h: Additional notes or comments

- id: Payment Method
  t: radio
  o:
    - cash
    - bank transfer
  h: How do you plan to pay?
  r: true

- id: Payment Proof
  t: file
  h: If you selected bank transfer, please upload proof of transfer

or a more causal form:

- Favorite Animal Form

- id: name!
  t:  str   # this line can be ommited, the text box will be used as the default
  h:  write first and last name here
  req: True
  
- id: gender
  t:  radio
  o:
    - masculine
    - feminine
  req: False

- id: favourite animal
  t: check
  o:
    - cat
    - cow
    - dog
    - crocodile
    - guinea pig
    - zebra
  h: Select the animal(s) you like the most!

- id: animal photo
  t: file
  h: Upload a photo of your favorite animal
  r: false

Data Storage and Output

Here's an example of what running the first example looks like from the point of view of a user:

example1

Here's the confirmation menu after submission example2

Generated File Structure

When you run QForms with a configuration file, the following structure is automatically created:

<config_name>_uploads/
├── <config_name>.json      # JSON format responses
├── <config_name>.csv       # CSV format (when -c flag is used)
└── <config_name>_submitted_files/  # Uploaded files directory
    ├── file1_unique_hash.ext
    └── file2_unique_hash.ext

Dependencies

QForms requires the following packages (automatically installed with pip):

  • flask: Web framework for serving forms
  • waitress: Production WSGI server
  • pyyaml: YAML configuration file parsing
  • jjcli: Command-line interface utilities

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

qforms-0.0.4.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

qforms-0.0.4-py2.py3-none-any.whl (11.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file qforms-0.0.4.tar.gz.

File metadata

  • Download URL: qforms-0.0.4.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for qforms-0.0.4.tar.gz
Algorithm Hash digest
SHA256 56f04e7e41b0e3f1dbe5eadcad0e118e3e79ebfc1e751ee089c03fd96d457a8d
MD5 b8215fb2fbf793b333bf1bb951be431c
BLAKE2b-256 7ac7cf7ced116f41350830ae0ee97a4e0165d14010399691f016e0ba76a8881f

See more details on using hashes here.

File details

Details for the file qforms-0.0.4-py2.py3-none-any.whl.

File metadata

  • Download URL: qforms-0.0.4-py2.py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for qforms-0.0.4-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1c9a3162e1f55b8a136f7de47c4000154668585c7415e9d33288e2e6704eb026
MD5 b9095994e4d5ae99fba7d6cd498241e8
BLAKE2b-256 fa23e5af943048bb27abdd7a0a9535948a0b11aa43a21e0f41edd3de6f7810e9

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