{ "info": { "author": "WillowTree Apps DevOps Team", "author_email": "devops@willowtreeapps.com", "bugtrack_url": null, "classifiers": [], "description": "========================================\n Tango: Scripting Framework for the Web\n========================================\n\nPre-process web content from a variety of sources, one Python script at a time.\n\nTango is a web framework for content middleware, great for respinning content\nfor mobile web sites or repurposing upstream data (no matter how messy) for new\nand improved APIs, built with Python and Flask.\n\n\nOverview\n========\n\nTango targets users who are:\n\n* application developers who need a clean JSON feed from upstream sources.\n* backend developers who have to reuse data from the wild.\n* template developers who implement mobile website designs.\n* client developers who'd like to manage their own templates.\n\nTango supports activities of:\n\n* developing templates in a sandbox environment.\n* sourcing site data from a mashup of sources,\n and building tools without any concern for request/response details.\n\nTango completely separates site content from it's templates. Template\ndevelopers work in a ``templates`` directory with pure Jinja2 templates and a\n``static`` directory for assets, including but not limited to images, CSS, and\nJavaScript. Backend developers work in a site ``stash`` package or module\nwhich declaratively exports content into template contexts for given routes.\nThese ``stash`` module are pure Python scripts with structured yaml metadata in\nmodule docstring.\n\nThe templates, static assets, and stash modules are discovered and integrated\nby the Tango core with the help of ``config.py`` and headers written in yaml.\n\nSee existing sites and examples for more detail.\n\n\nWhat is Tango?\n==============\n\nHere is Tango's plan:\n\n\nAt a glance, Tango...\n---------------------\n\n* is a mobile web framework built with Python\n* is a scripting layer for reflowing data...\n if you can pull your data via a Python script, you can serve it for free\n* provides a basis for testing data integrity with unit and functional tests\n\n\nBenefits\n--------\n\n* Two teams develop Tango site packages in parallel:\n\n * template developers, implementing designs and arranging content\n * data sourcers, tapping into origin database or site to push content into\n templates\n\n* Spec-first development\n\n * Tango site developers codify site's URL routes and data using Python & yaml\n definitions.\n * spec clearly spells out template content -- develop the spec as a collection\n of yaml headers, then develop templates & data at the same time\n\n* Productivity Measures\n\n * Tango snapshots data - develop templates without fetching data\n * data sourcing occurs outside of web context - develop & unit-test data\n modules in isolation, in a simple scripting environment\n\n\nSpecifics\n---------\n\n* Tango deploys as a Python WSGI app:\n\n * complies with the WSGI web standard.\n * most deployments use mod_wsgi under Apache httpd.\n * if needed, can readily port to ISAPI interface on Microsoft's IIS platform.\n\n* Tango automates content and deployment on a schedule, including:\n\n * automated deploy using Python standards & automated upgrade using git\n revision control\n * dynamic views with caching -- cached on a time-to-live schedule via cron\n * failsafe -- data updates which fail do not overwrite production data\n (essential in productions where an API is built from screen scraping)\n\n* Tango site packages include\n\n * a template package in Python's Jinja2\n * a stash package in Python, using yaml headers, includes stashable content\n * static assets - images, CSS, JavaScript\n * config.py using simple key/value pairs\n\n* Tango supports stand-alone Python scripts where full packages are not needed.\n\n* Templating: Tango uses Python's highly regarded Jinja2 (inspired by Django).\n\n\nStashing Content\n----------------\n\nStashable content is that which can be fetched up front and served to all\nusers. In a Tango project, this content is scripted in Python modules, which\nhave structured metadata written in yaml. When serving an application, the\nTango framework walks the ``sitename.stash`` package or module (or accepts a\nsingle Python module for small projects), building all of the application view\nfunctions based on the yaml metadata. Simple Tango sites are just a ``stash``\npackage with a ``templates`` directory. A simpler Tango site is just a\n``stash`` package with a config telling Tango to return json. The simplest\nTango site is single Python module, which is treated as a ``stash`` and is\nuseful in building light APIs.\n\n\nDynamic Content\n---------------\n\nPure dynamic content and forms require custom view functions. In this case,\nTango builds an ``app`` object from the stash module, and this ``app`` object\nallows for additional routes, view functions, and other features as provided by\nFlask. Projects without stashable content are effectively just Flask projects\nwhich use utilities/tools provided by Tango.\n\nNeed to drop into Flask development? Simply::\n\n from tango.factory.app import build_app\n app = build_app('sitename')\n\nThis app is a flask.Flask instance ready for any of the APIs provided by `Flask\n`_, a full web framework with a small accessible\ncore.\n\n\nOther Notes\n-----------\n\nTango:\n\n* framework reduces web request & response code to 0.\n* developers can theme sites easily using template inheritance and CSS.\n* is a rapid prototyping framework (think *very* rapid), but is ready for\n primetime & full applications.\n* provides for automated unit and functional tests, testing all the way up to\n (but not including) browser quirks.\n\nOn redirecting users from the desktop site:\n\n* Most site owners target iPhone, Android, and Blackberry.\n\n * Nearly all of these devices have JavaScript enabled.\n * Use a simple JavaScript redirection script (preferably on every page, but at\n least the home page).\n\n* For wider device targets:\n\n * Set URL rewrite rules for Apache httpd or IIS.\n * Redirect devices even if JavaScript is disabled.\n\nOn screen scraping:\n\n* Sometimes the client data with the best structure is structured as (X)HTML.\n* Tango does not have a general rule or silver bullet for screen scraping.\n Each case is treated specially. Developers study the client's markup, decide\n which elements to select, and strip/cleanup attributes and tags as needed.\n Some origin elements and attributes flow through, others are mutated. For\n maintenance, this requires a close eye on how the origin site changes.\n\n\nDiscussion Topics\n=================\n\nOn Context\n----------\n\nThroughout the Tango project, there are two uses of the word \"context\":\n\n* The Flask app current in context;\n here \"context\" is the same as used in the Flask project.\n (Flask has request contexts and context-locals.)\n* The template context, a collection of variables available in the template;\n here \"context\" is the same as used in the Jinja project.\n\n\nLogic in Templates?\n-------------------\n\nTemplate developers say that heavy logic should stay out of templates, and\nthere are good reasons for that. In stark contrast, Tango relies on heavy\nlogic in the templates. This is intentional; for stashable content, *all*\nrequest-based logic is in the templates. Where Tango stashes content, there\nare no explicit view functions, only templates and a freestyle data layer.\n\n\nYet Another Web Framework?\n--------------------------\n\nNo, Tango extends Flask, or rather, Tango *builds* Flask, Flask WSGI\napplication objects to be exact. Flask:\n\n* builds on Werkzeug, a WSGI implementation and toolkit\n* builds on Jinja2, a templating platform\n* allows for a Pythonic app-building pattern\n* provides for extensions with clear conventions\n (and the Flask committers review & approve these extensions)\n\nTango focuses on the templating platform, completely hides the WSGI layer (but\nexposes APIs to WSGI if needed), establishes a spec-first development pattern\non top of Flask, leverages Flask-related tools & extensions, and as a result,\nmakes the Tango developers more productive in building mobile web sites.\n\nTango is WillowTree's platform on Flask, but is developed for general use.\n\n\nReleases\n========\n\nThe current release is 0.2 (Salida), released on Oct 26, 2011.\nAll releases are guaranteed with 100% statement test coverage.\n\nTango is built for CPython (the reference Python implementation),\nfor versions 2.6 and 2.7.\n\n\nLicense\n=======\n\nBSD.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://www.willowtreeapps.com", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "Tango", "package_url": "https://pypi.org/project/Tango/", "platform": "POSIX", "project_url": "https://pypi.org/project/Tango/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://www.willowtreeapps.com" }, "release_url": "https://pypi.org/project/Tango/0.2.7/", "requires_dist": null, "requires_python": null, "summary": "Tango mobile web optimization framework.", "version": "0.2.7" }, "last_serial": 785773, "releases": { "0.2.2": [ { "comment_text": "", "digests": { "md5": "c05b503d8fa64853599dc5036163ec66", "sha256": "1eb0167a5b8e5fd0bc79b9e7cc3ccd962e3e77876c2467e62a3c3287363db7f7" }, "downloads": -1, "filename": "Tango-0.2.2.tar.bz2", "has_sig": false, "md5_digest": "c05b503d8fa64853599dc5036163ec66", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 88417, "upload_time": "2012-07-03T20:00:27", "url": "https://files.pythonhosted.org/packages/8d/96/7b3ca1af097112f2e016e5835a512db144d3803fbd543c77cc3b3b4fd192/Tango-0.2.2.tar.bz2" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "f67bae6c7d42db80c492c6e71ed89c2a", "sha256": "bdde5971f1c764a4cff2ba9fd5778c27cb4cf29a012239e6afe4a13db5fe8b58" }, "downloads": -1, "filename": "Tango-0.2.3.tar.bz2", "has_sig": false, "md5_digest": "f67bae6c7d42db80c492c6e71ed89c2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 92772, "upload_time": "2012-08-22T16:03:36", "url": "https://files.pythonhosted.org/packages/87/8f/d3f51e23bced60895c39b476411a5d9ab4b405bbfec89453c206b7971555/Tango-0.2.3.tar.bz2" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "3b476fcb31db4013c3958b85c6608e88", "sha256": "05c1f18302aea78fbf7328e4ee47c5133e28153ae7598ebd2fd57044b94866ce" }, "downloads": -1, "filename": "Tango-0.2.4.tar.bz2", "has_sig": false, "md5_digest": "3b476fcb31db4013c3958b85c6608e88", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 91878, "upload_time": "2012-09-13T19:18:21", "url": "https://files.pythonhosted.org/packages/8b/4e/502f86da4f2ac0971efafc67f676acb3bb342f4d51985f8b4b1c8bd3d694/Tango-0.2.4.tar.bz2" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "b1e83820a1c1c3a45fc162192540e869", "sha256": "d1620bc1e14e9f672a0d411acff0a3991053fee5ab350e56856ddfb1b45af8e7" }, "downloads": -1, "filename": "Tango-0.2.5.tar.gz", "has_sig": false, "md5_digest": "b1e83820a1c1c3a45fc162192540e869", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 128531, "upload_time": "2012-10-03T14:13:43", "url": "https://files.pythonhosted.org/packages/70/7f/6decfda05ca61643653c5857dbe0eee04abdc4089158fd8eea1a4596b2c1/Tango-0.2.5.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "b1c1572ec48a2797dda58737ce55a84f", "sha256": "c578069a64224048b300bab0b7330085cba28d2ce6f63d737c3283b83565b78f" }, "downloads": -1, "filename": "Tango-0.2.7.tar.bz2", "has_sig": false, "md5_digest": "b1c1572ec48a2797dda58737ce55a84f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 92987, "upload_time": "2012-10-09T15:40:04", "url": "https://files.pythonhosted.org/packages/78/48/a8fc055046c7586be4ed5b41f96e72d00a26b0feb0a03fb722ad8336f73c/Tango-0.2.7.tar.bz2" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b1c1572ec48a2797dda58737ce55a84f", "sha256": "c578069a64224048b300bab0b7330085cba28d2ce6f63d737c3283b83565b78f" }, "downloads": -1, "filename": "Tango-0.2.7.tar.bz2", "has_sig": false, "md5_digest": "b1c1572ec48a2797dda58737ce55a84f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 92987, "upload_time": "2012-10-09T15:40:04", "url": "https://files.pythonhosted.org/packages/78/48/a8fc055046c7586be4ed5b41f96e72d00a26b0feb0a03fb722ad8336f73c/Tango-0.2.7.tar.bz2" } ] }