Modular Framework for Serious Projects

We're very close to our first release!

Built with experience

We at strg.at are experts at all things large-scale media. score contains all our experience with several of the largest media platforms in Austria.
strg.at/referenzen

kurier.at futurezone.at freizeit.at autotouring.at wetter.at netdoktor.at

Beginner friendly

We made the switch from PHP to Python, and many of us had no prior experience with the pythonic ways. Since we took great care to make a smooth transition, you will benefit, too.

All the steps ...

Blog Tutorial
  • Introduction
  • The Project
  • Specification
  • Setup
  • Database Basics
    • User
    • Content

... to working code

class Article(Storable):
    __acl__ = [
        (Allow, 'blogger', 'edit'),
        (Allow, 'logged-in', 'comment')]
    author_id = Column(
        Integer,
        ForeignKey('_blogger.id'),
        nullable=False)
    author = relationship('Blogger')

Unobtrusive

Know Pyramid? Know SqlAlchemy? Or Jinja? Great! You will find that you will not lose a single feature, but gain the power of a framework making these and many more libraries work together seamlessly.

Pyramid

def init(file):
    config, scoreconf = scoreinit(file)
    config.add_route('start', '/')
    config.add_route(
        'article',
        '/article/{id}',
        factory=mkfactory(Article),
        pregenerator=mkpregen(Article))
    config.scan()

sqlAlchemy

@view_config(route_name='articles/by_tag',
             renderer='articles.jinja2',
             context=ArticleTag)
def articles_by_tag(request):
    tag = request.context
    articles = request.db.query(Article).\
        filter(Article.tags.contains(tag)).\
        all()
    return {'tag': tag, 'articles': articles}

jinja2

{% for article in articles %}
    <li>
        <a href="{{ request.route_url(
                    'article',
                     article) }}">
           {{ article.title | raw }}
        </a>
    </li>
{% endfor %}

Pluggable Components

Prefer Mako over Jinja? Or SQLObject over SQLAlchemy? Or want to use Flask instead of Pyramid? Anything is possible with score's very modular design.

configure to your hearts desire ...

[score.tpl]
cachedir = ${here}/_cache
rootdir = ${here}/tpl/
; engine.jinja2 = score.tpl.jinja2.Engine
; engine.cheetah = plugin.for.CheetahEngine
; engine.tenshi = custom.TenshiEngine
engine.mako = score.tpl.mako.Engine
default_format = html

... and enjoy your favorites

% for article in articles:
    <li>
        <a href="#{request.route_url(
                   'article', article)}">
           ${article.title}
        </a>
    </li>
% endfor

Developer-Centered

Need to fix a misbehaving URL? Just harness the power of your project-specific python shell and jump in with your favorite debugger to save the day.

analyze your data

$ score repl development.ini
>>> query = request.db.query(db.Article)
>>> article = query.first()
>>> article.title
'History of The Ministry'
>>> article.author.name
'John Cleese'
>>> len(article.author.articles)
2

use your favorite debugger

$ score repl production.ini
>>> r = mkrequest('/bogus-url')
>>> r.url
'http://localhost/bogus-url'
>>> import pdb
>>> pdb.run("r.call_application(app)",
...         {'r': r, 'app': app})
> <string>(1)<module>()
(Pdb) 

Got interested?

We promise not to spam if you want the latest news