A git-friendly form builder using TSV storage
Project description
dbbasic-forms: Git-Native Form Builder
A simple, git-friendly form builder that stores everything in TSV files. Build forms, collect responses, export to CSV—all without a database.
Why This Exists
Form builders shouldn't cost $29/month. Your data shouldn't be locked in a SaaS platform. Forms are just tables, and tables are just TSV files.
Features
- Visual Form Builder: Drag-drop interface for creating forms
- TSV Storage: All data in human-readable text files
- Git-Friendly: Version control your forms and responses
- Admin Interface: Auto-discovered by dbbasic-admin
- CSV Export: One-click export to spreadsheet
- Zero Setup: No database, no configuration, just works
Installation
pip install dbbasic-forms
Requires Python 3.8+ and dbbasic-tsv.
Quick Start
Create a Form
from dbbasic_forms import FormBuilder
builder = FormBuilder()
contact_form = builder.create_form(
form_id="contact",
name="Contact Form",
description="Get in touch with us",
fields=[
{
"name": "name",
"type": "text",
"label": "Name",
"required": True
},
{
"name": "email",
"type": "email",
"label": "Email",
"required": True
},
{
"name": "message",
"type": "textarea",
"label": "Message"
}
]
)
Submit Responses
# From your web handler
form = builder.get_form("contact")
response_id = form.submit_response({
"name": "Alice Johnson",
"email": "alice@example.com",
"message": "Love your product!"
})
View Responses
# Get all responses
responses = form.get_responses(limit=10)
for response in responses:
print(f"{response['submitted_at']}: {response['email']}")
# Export to CSV
csv_data = form.export_responses_csv()
with open("responses.csv", "w") as f:
f.write(csv_data)
Data Format
Your forms and responses are stored in TSV files:
$ cat data/forms.tsv
id name description fields created_at
contact Contact Form Get in touch with us [{"name":"email"...}] 2024-01-15T10:30:00
$ cat data/responses_contact.tsv
id submitted_at name email message
resp_20240115... 2024-01-15T14:22:00 Alice Johnson alice@example.com Love your product!
This means you can:
- Debug with
tail -f data/responses_contact.tsv - Search with
grep alice data/responses_contact.tsv - Edit in Excel, Google Sheets, or vim
- Track changes in Git with meaningful diffs
Field Types
text- Single-line text inputemail- Email with validationtextarea- Multi-line textnumber- Numeric inputdate- Date pickerselect- Dropdown menuradio- Radio buttons (single choice)checkbox- Checkboxes (multiple choice)file- File upload (coming soon)
Admin Interface
dbbasic-forms integrates with dbbasic-admin for visual management.
The admin interface includes:
- Form builder with drag-drop fields
- Response viewer with filtering
- CSV export
- Form analytics
Install dbbasic-admin:
pip install dbbasic-admin
The forms interface is auto-discovered at /admin/forms.
Web Framework Integration
Flask Example
from flask import Flask, request, jsonify
from dbbasic_forms import FormBuilder
app = Flask(__name__)
builder = FormBuilder()
@app.route('/api/forms/<form_id>/submit', methods=['POST'])
def submit_form(form_id):
form = builder.get_form(form_id)
if not form:
return jsonify({"error": "Form not found"}), 404
response_id = form.submit_response(request.json)
return jsonify({
"success": True,
"response_id": response_id,
"message": form.settings["success_message"]
})
FastAPI Example
from fastapi import FastAPI, HTTPException
from dbbasic_forms import FormBuilder
app = FastAPI()
builder = FormBuilder()
@app.post("/api/forms/{form_id}/submit")
async def submit_form(form_id: str, data: dict):
form = builder.get_form(form_id)
if not form:
raise HTTPException(status_code=404, detail="Form not found")
response_id = form.submit_response(data)
return {
"success": True,
"response_id": response_id,
"message": form.settings["success_message"]
}
API Reference
FormBuilder
builder = FormBuilder(data_dir="data")
Methods:
create_form(form_id, name, description, fields, settings)→ Formget_form(form_id)→ Form | Nonelist_forms()→ List[Dict]delete_form(form_id)→ bool
Form
form = builder.get_form("contact")
Methods:
submit_response(response_data)→ str (response_id)get_responses(limit, offset)→ List[Dict]count_responses()→ intget_response(response_id)→ Dict | Nonedelete_response(response_id)→ boolupdate_form(name, description, fields, settings)→ boolexport_responses_csv()→ strto_dict()→ Dict
When to Use This
✅ Perfect for:
- Contact forms on static sites
- Feedback forms
- Event registrations
- Surveys and polls
- Internal tools (HR forms, IT requests)
- Prototypes and MVPs
❌ Not suitable for:
- High-volume transactional forms (>1K submissions/day)
- Payment forms (use Stripe Checkout)
- Multi-tenant SaaS applications
- Real-time collaboration
Rule of thumb: If your form responses can safely live in Git (because they're content, not transactions), use dbbasic-forms.
Deployment
Development
pip install dbbasic-forms
# Data is stored in ./data directory
# Commit to git: git add data/ && git commit -m "Add form data"
Production (Git-Based)
git clone https://github.com/yourorg/yourapp.git
cd yourapp
pip install -r requirements.txt
# Data is in the repo
# New responses append to TSV files
# Push updates: git add data/ && git commit && git push
Performance
- Form Creation: <1ms
- Response Submission: <5ms
- Query 10K Responses: ~100ms
- CSV Export (10K rows): ~200ms
Limits:
- Responses per form: 100K recommended, 1M maximum
- Fields per form: 50 recommended
Comparison
| Feature | dbbasic-forms | Google Forms | Typeform |
|---|---|---|---|
| Cost | Free | Free/Limited | $25+/mo |
| Data Ownership | ✅ | ❌ | ❌ |
| Git-Friendly | ✅ | ❌ | ❌ |
| Self-Hosted | ✅ | ❌ | ❌ |
| Visual Builder | ✅ | ✅ | ✅ |
| File Uploads | 🚧 | ✅ | ✅ |
Documentation
- Full Specification - Complete technical spec
- API Reference - Method documentation
- Examples - Code examples and demos
Contributing
Contributions welcome! See CONTRIBUTING.md for guidelines.
License
MIT License - see LICENSE for details.
Credits
Created by the AskRobots team as part of the dbbasic ecosystem.
Inspired by the philosophy that forms shouldn't require infrastructure.
Remember: The best form builder is the one you control.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dbbasic_forms-1.0.0.tar.gz.
File metadata
- Download URL: dbbasic_forms-1.0.0.tar.gz
- Upload date:
- Size: 24.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
256d44c871343aa037ba856b9203dbe2a3bbd4acc2c2d85d8d96ed7b770b14f0
|
|
| MD5 |
84b267c6fe7e1e6c8ae3c3aed30141c5
|
|
| BLAKE2b-256 |
f662b62c269b5a0fc6a22f91ce90c86942d552bcc3e26a49078626c26078c36a
|
File details
Details for the file dbbasic_forms-1.0.0-py3-none-any.whl.
File metadata
- Download URL: dbbasic_forms-1.0.0-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28335e27f8d19c52ea4dd4dde79dc914a8ca7524a63f0f415dd202da970e57e7
|
|
| MD5 |
3ed0b1daeab5dde1d650f0be69cc6064
|
|
| BLAKE2b-256 |
b35ad970f40a104fe766308eba6e8743b5aa832034569d455edbf228638a3a95
|