semvec/pypi-packages huggingface dataset:
pypostscript 0.1.7
Create PostScript page (including barcodes) using Python objects
License: MIT
Keywords: postscript printing barcode

pypostscript
============

Create A4 Portrait PostScript output with Python Objects

Version 0.1:
    Portrait A4 only
    4 Font choices
    TextLines
    Code39Barcodes
    Code93Barcodes
    Circles
    Rectangles

Usage
=====

Example of usage::

    from pypostscript.barcode import Code39Barcode, Code93Barcode
    from pypostscript.shapes import Circle, Rectangle
    from pypostscript.text import HelveticaBoldFont, TextLine, TimesPlainFont
    from pypostscript.page import Page


    def sample_page():
        page = Page()
        page.extend(TextLine(x_pts=40,
                             y_pts=740,
                             font=HelveticaBoldFont(size_pts=22),
                             text='A Test Portrait Page'))
        page.extend(TextLine(x_pts=40,
                             y_pts=650,
                             font=TimesPlainFont(size_pts=12),
                             text='PostScript library, test portrait page.'))
        page.extend(Code39Barcode(x_pts=40,
                                  y_pts=500,
                                  chars='ABC123'))
        page.extend(Code93Barcode(x_pts=40,
                                  y_pts=400,
                                  chars='ABC987'))
        page.extend(Rectangle(x_pts=30,
                              y_pts=390,
                              width_pts=170,
                              height_pts=185,
                              line_width_pts=2))
        page.extend(Circle(centre_x_pts=80,
                           centre_y_pts=150,
                           radius_pts=72,
                           line_width_pts=1))
        return page

    if __name__ == '__main__':
        page = sample_page()
        print page.render()
django-auth-remember 0.3
Django app for remember-me functionality (using a token)
License: MIT

Django auth remember app
========================

Add the auth_remember authentication backend to django::

    AUTHENTICATION_BACKENDS = (
        'django.contrib.auth.backends.ModelBackend',
        'auth_remember.backend.AuthRememberBackend',
    )

Add the remember middleware in your settings, right after
AuthenticationMiddleware::

    MIDDLEWARE_CLASSES = (
        ...
        'django.contrib.auth.middleware.AuthenticationMiddleware',
        'auth_remember.middleware.AuthRememberMiddleware',
        ...
    )


Add auth_remember to INSTALLED_APPS::

    INSTALLED_APPS = (
        'auth_remember',
    )


Set the cookie name and expire time (optional)::

    AUTH_REMEMBER_COOKIE_NAME = 'remember_token'
    AUTH_REMEMBER_COOKIE_AGE = 86400 * 28  # 4 weeks by default


Set the expire time of the session to browser close (optional)::

    SESSION_EXPIRE_AT_BROWSER_CLOSE = True


To remember a user add the following code to your authentication handler::

    from auth_remember import remember_user
    remember_user(request, user)


Use the user.is_fresh attribute to test if the user is fresh::

    {% if user.is_fresh %}
        This user session is fresh
    {% else %}
        This user session is NOT fresh
    {% endif %}

Under the hood auth_remember uses the session var ``AUTH_REMEMBER_FRESH`` to
indicate if the user session is fresh. The name of the session var can be
changed by setting the ``AUTH_REMEMBER_SESSION_KEY`` in you're settings file.


More information
----------------

See:
 - http://fishbowl.pastiche.org/2004/01/19/persistent_login_cookie_best_practice/
 - http://stackoverflow.com/questions/549/the-definitive-guide-to-forms-based-website-authentication#477579


TODOs
-----

- Introduce settings for AUTH_REMEMBER_COOKIE_DOMAIN
macaron 0.3.1
Simple object-relational mapper for SQLite3, includes plugin for Bottle web framework
License: MIT

Macaron is a small object-relational mapper (ORM) for SQLite on Python.
It is distributed as a single file module which has no dependencies other
than the Python Standard Library.

Macaron provides easy access way to SQLite database as standalone. And also
it can work in Bottle web framework through the plugin mechanism.

Example::

    >>> import macaron
    >>> macaron.macaronage("members.db")
    >>> team = Team.create(name="Houkago Tea Time")
    >>> team.members.append(name="Ritsu", part="Dr")
    <Member object 1>
    >>> mio = team.members.append(name="Mio", part="Ba")
    >>> print mio
    <Member 'Mio : Ba'>
    >>> for member in team.members: print member
    ...
    <Member 'Ritsu : Dr'>
    <Member 'Mio : Ba'>
    >>> macaron.bake()
    >>> macaron.cleanup()