Personal tools
Skip to content. | Skip to navigation
This module optimizes Moo type checks when used with Type::Tiny to perform better. It will automatically apply to isa checks and coercions that use Type::Tiny. Non-Type::Tiny isa checks will work as normal.
See MooX::Types::MooseLike::Base for a list of available base types. Its source also provides an example of how to build base types, along with both parameterizable and non-parameterizable.
Moo types for numbers, adapted from MooseX::Types::Common::Numeric.
Moose is an extension of the Perl 5 object system. The main goal of Moose is to make Perl 5 Object Oriented programming easier, more consistent and less tedious. With Moose you can to think more about what you want to do and less about the mechanics of OOP. Additionally, Moose is built on top of Class::MOP, which is a metaclass system for Perl 5. This means that Moose not only makes building normal Perl 5 objects better, but it provides the power of metaclass programming as well. Moose is different from other Perl 5 object systems because it is not a new system, but instead an extension of the existing one.
Moose::Autobox provides an implementation of SCALAR, ARRAY, HASH & CODE for use with autobox.
Sodium is a new, easy-to-use software library for encryption, decryption, signatures, password hashing and more. It is a portable, cross-compilable, installable, packageable fork of NaCl, with a compatible API, and an extended API to improve usability even further. Its goal is to provide all of the core operations needed to build higher-level cryptographic tools. The design choices emphasize security, and "magic constants" have clear rationales. The same cannot be said of NIST curves, where the specific origins of certain constants are not described by the standards. And despite the emphasis on higher security, primitives are faster across-the-board than most implementations of the NIST standards.
S3transfer is a Python library for managing Amazon S3 transfers.
gocept python module
This package lets you use the pycountry database within Zope 3. In practice, this means e.g., that you can easily get a zope.schema.Choice field to provide a full list of iso 3166 country codes. For more information about the database please refer to the pycountry product. gocept.country gocept.country provides Zope 3 sources for the pycountry databases. You can use it e.g. to get a zope.schema.Choice field with all iso 3166 countries. >>> import gocept.country >>> import gocept.country.db >>> import zope.schema ISO 3166 Countries To get a list of ISO 3166 countries in a webform, you can use the zope.schema.Choice field and provide the gocept.country.countries as source: >>> countries_field = zope.schema.Choice(title=u'Country', ... source=gocept.country.countries) >>> countries_field <zope.schema._field.Choice object at 0x...> >>> countries = iter(countries_field.source) The gocept.country.countries sourcefactory returns Country objects as values, which use the values from pycountry: >>> afghanistan = countries.next() >>> afghanistan <gocept.country.db.Country object at 0x...> >>> afghanistan.name u'Afghanistan' Calling the next() method again returns the next country from the source: >>> islands = countries.next() >>> islands.name u'\xc5land Islands' There are all information available, which you can get from pycountry: >>> afghanistan.alpha2 'AF' >>> afghanistan.alpha3 'AFG' >>> afghanistan.numeric '004' >>> afghanistan.official_name 'Islamic Republic of Afghanistan' To smaller the amount of results you can provide a list or tuple of countries you like to have in your source: >>> countries = iter(gocept.country.CountrySource(alpha2=['DE', 'US'])) >>> countries.next().name u'Germany' >>> countries.next().name u'United States' >>> countries.next().name Traceback (most recent call last): ... StopIteration Please note, that the result items are sorted by alpha2 code. Please also note, that you can provide alpha3 and numeric codes and names resp. official_names to smaller the amount of result items, too: >>> len(list(gocept.country.CountrySource())) 246 >>> len(list(gocept.country.CountrySource(alpha2=['DE', 'US', 'GB']))) 3 >>> len(list(gocept.country.CountrySource(alpha3=['DEU', 'USA']))) 2 >>> len(list(gocept.country.CountrySource(numeric=['276', ]))) 1 >>> countries_list = ['Germany', 'Italy', 'Poland', 'France'] >>> len(list(gocept.country.CountrySource(name=countries_list))) 4
This package provides base classes for defining Munin graphs and a main function to handle munin-typical symlinked scripts. Munin plugin scripts ==================== A single plugin file defines (multiple) graphs by subclassing the bases as mentioned in the next section. The main function uses the called script's filename to determine which of the defined graphs is relevant. Data for each graph is determined by retrieving a text file from a URL (with possibly given basic authentication data). The format for the data is plain/text wich each line having key/value pairs split by ':'. The values are expected to be floats. All graph bases expect two environment variables to be set: URL The URL at which to retrieve data from. Must include a '%s' which encodes the graph name. AUTH HTTP basic authentication information. Either empty or in the form of 'username:password'. The environment variables can be configured using munin's `plugin-conf.d` like this: The plugin is called `prefix_something_1`:: [prefix_*] env.URL http://foo:8900/myapp/munin?data=%s env.AUTH admin:admin Graph bases =========== The following base classes are currently defined: SimpleGraph A simple graph with a single value that is plotted as an absolute value. SimpleMultiGraph Multiple absolute values plotted on the same graph and scale. more bases will be added as needed. Main function ============= The main function handles munin-typical `type_option_index` symlink scripts by looking at the name from which the main script was called. Example script ============== Here's a sample script that you could symlink into the `plugins` directory:: from gocept.munin.client import SimpleGraph, main class people(SimpleGraph): name = key = 'people' title = 'How many people are there?' category = 'Office' main() [root@mistress gocept.munin-0.1]# cat README.txt ========================================== Utilities for writing munin client scripts ========================================== This package provides base classes for defining Munin graphs and a main function to handle munin-typical symlinked scripts. Munin plugin scripts ==================== A single plugin file defines (multiple) graphs by subclassing the bases as mentioned in the next section. The main function uses the called script's filename to determine which of the defined graphs is relevant. Data for each graph is determined by retrieving a text file from a URL (with possibly given basic authentication data). The format for the data is plain/text wich each line having key/value pairs split by ':'. The values are expected to be floats. All graph bases expect two environment variables to be set: URL The URL at which to retrieve data from. Must include a '%s' which encodes the graph name. AUTH HTTP basic authentication information. Either empty or in the form of 'username:password'. The environment variables can be configured using munin's `plugin-conf.d` like this: The plugin is called `prefix_something_1`:: [prefix_*] env.URL http://foo:8900/myapp/munin?data=%s env.AUTH admin:admin Graph bases =========== The following base classes are currently defined: SimpleGraph A simple graph with a single value that is plotted as an absolute value. SimpleMultiGraph Multiple absolute values plotted on the same graph and scale. more bases will be added as needed. Main function ============= The main function handles munin-typical `type_option_index` symlink scripts by looking at the name from which the main script was called. Example script ============== Here's a sample script that you could symlink into the `plugins` directory:: from gocept.munin.client import SimpleGraph, main class people(SimpleGraph): name = key = 'people' title = 'How many people are there?' category = 'Office' main()