Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install wm.sampledata

How to install wm.sampledata

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install wm.sampledata
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.2
0.2.2Never BuiltWhy not?
0.2 Available View build log
0.1 Available View build log
Windows (64-bit)
0.2
0.2.2Never BuiltWhy not?
0.2 Available View build log
0.1 Available View build log
Mac OS X (10.5+)
0.2
0.2.2Never BuiltWhy not?
0.2 Available View build log
0.1 Available View build log
Linux (32-bit)
0.2
0.2.2Never BuiltWhy not?
0.2 Available View build log
0.1 Available View build log
Linux (64-bit)
0.2.2 Available View build log
0.2 Available View build log
0.1 Available View build log
 
License
GPL
Dependencies
Lastest release
version 0.2.2 on May 20th, 2013

Why use this?

Standardized sampledata makes it soo much easier to work on a project (especially when working in teams).

This package eases the generation of sampledata for your plone project.

How to use it

For developers working on a project there's a view listing and running all available sampledata plugins:

http://localhost/plone/@@sampledata

Screenshot of the @@sampledata with enabled example plugin

By default the view does not list any plugins. The screen above shows the example plugin activated via <include package="wm.sampledata.example" />.

Writing and registering your custom sampledata plugin is very easy:

    from wm.sampledata import utils

class MyPlugin(object):
    implements(ISampleDataPlugin)

    title = u"My Plugin Content"
    description = u"Creates a portlet and a random image"

    def generate(self, context):
        portlet = StaticAssignment(u"Sample Portlet", "<p>some content</p>")
        utils.addPortlet(context, 'plone.leftcolumn', portlet)

        utils.createImage(context, 'random-nature.jpg',
                    file = utils.getRandomImage(category='nature', gray=False),
                    title=u"Random Image",
                    description=u"Downloaded from lorempixel.com")


myPlugin = MyPlugin()
component.provideUtility(myPlugin,
                         ISampleDataPlugin
                         'my.plugin')

See wm.sampledata.example for a complete example of a custom plugin.

There is a growing set of utility methods in wm.sampledata.utils (eg for handling portlets and files, or download images from http://lorempixel.com) which you can use in your plugins.

Installation

Simply add wm.sampledata to your buildout's instance eggs - a zcml slug is not needed in plone versions that ship with z3c.autoinclude (Plone>=3.3):

[buildout]
...
eggs =
    ...
    wm.sampledata

Why yet another package?

There are several other packages for generating test/sampledata but none of them fitted my usecase. (Which is providing a user interface for pluggable sampledata generators so developers/skinners can use standardized data when developing on a project)

A while ago i asked what other people do on plone.users

z3c.sampledata

Would do the same and much more (dependencies, groups, configuration ui for each plugin)

for me it was too complex to get it running on my zope2 instance and it seems to be tailored for zope3 anyway.

Basically it would be great to make wm.sampledata use z3c.sampledata and provide plone specific plugins for it.

zopyx.ipsumplone

Seems to provide very similar utility methods. No pluggable Generators, No User-Interface

ely.contentgenerator
provides a xml syntax to create samplecontent, might be useful to use in custom plugins
collective.contentgenerator
looks like this is meant for creating (random) sampledata for stresstests
collective.lorem
content action to fill content with lorem-ipsum text and provides utility methods createStandardContent to create random content (news, documents, files, image) and createNestedStructure to create arbitrary nested folder structures.
collective.loremipsum
Allows to create members (names taken from fakenamegenerator.com)

If you have any ideas for improvement or know another alternative to this package please drop me a mail

0.2.2 (2013-05-08)

  • add traceback logging on errors [saily]
  • added utility functions (utils.getImage and utils.getRandomImage) to download images from lorempixel.com (see wm.sampledata.example for usage) [fRiSi]
  • more intuitive syntax for blockPortlets (change breaks backward compatibility) [fRiSi]

0.2.1 (2012-05-29)

0.2 (2011-12-02)

  • SampledataView.runPlugin returns the result of Plugin.generate. This makes it easy to check if the plugin was sucessfully run in unittests.

0.1 (2011-01-31)

  • Initial release

Subscribe to package updates

Last updated May 20th, 2013

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.