What is Giotto?
Giotto is a python web framework. It encourages a functional style where model, view and controller code is strongly decoupled.
Key Features of Giotto include:
Extremely terse code. A full featured blog application is under 300 lines of code (including templates)
Generic views, generic models and multiple pluggable controllers.
Free RESTful interface along with your normal “browser POST” CRUD site.
Functional CRUD patterns that do away with the need for django-style form objects.
Automatic URL routing.
Built in cache (supports Redis and Memcache, and an API for supporting any other engines)
SQLAlchemy for database persistence.
Jinja2 for HTML templates (with an API for extending for other template engines)
Getting started
Install and create base project files:
pip install giotto mkdir demo giotto create http
Now your project is initialized. Open the manifest.py and add the following:
from giotto.programs import ProgramManifest, GiottoProgram
from giotto.views import jinja_template, BasicView
def multiply(x, y):
x = int(x or 0)
y = int(y or y)
return {'x': x, 'y': y, 'result': x * y}
manifest = ProgramManifest({
'multiply': GiottoProgram(
model=[multiply],
view=BasicView(
html=jinja_template('multiply.html'),
),
),
})
Now create a file called multiply.html:
<!DOCTYPE html>
<html>
<body>
{{ data.x }} * {{ data.y }} == <strong>{{ data.result }}</strong>
</body>
</html>
Or if you’re too lazy to make a template, set the view keyword argument to just BasicView() to use the generic view.
Run the development server:
$ giotto http --run
Point your browser to http://localhost:5000/multiply?x=3&y=3. Additionaly, try http://localhost:5000/multiply.json?x=3&y=3. You can also invoke your multiply program through the command line:
$ giotto create cmd $ giotto cmd multiply --x=4 --y=2
Also:
$ giotto cmd multiply.html --x=4 --y=2
You can also use positional arguments:
$ giotto cmd multiply/4/6
Links:
To discuss Giotto, please visit the Google Group
Read Giotto’s documentation.
Check out giottoblog, a full featured blog application written with the Giotto framework.
Metadata
Release files for giotto 0.10.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| giotto-0.10.5.tar.gz | 25.0 kB | Without provenance | Details |
Release files / giotto-0.10.5.tar.gz
| Download URL | giotto-0.10.5.tar.gz |
|---|---|
| Size | 25.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
30972f753cc8d937af2b0364c09c0a9d890d512d8a53a455382b4a9ac96d0a64
|
|
BLAKE2b-256 checksum How to use checksums |
4fcd7fc03a33a2d317ccf96fdcefc3e75bfab110f258d1e1134cb99524b2df89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for giotto 0.10.5
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.