Skip to main content
Version:
0.99

Synopsis

This is a port of the excellent Perl module Acme::MetaSyntactic, written by Phillipe (BooK) Bruhat.

In fact it is automatically generated from Acme::MetaSynctacic. And this particular version was generated from version 0.99.

The original CONTRIBUTORS file is shipped with this distribution.

Usage

General

Get a list of all themes:

>>> import metasyntactic
>>> metasyntactic.all_themes
set(...)

Get random theme:

>>> metasyntactic.random()
<module 'metasyntactic.themes.stars' from 'metasyntactic/themes/stars.py'>

Get random metavariable from random theme:

>>> metasyntactic.random().random()
['Barbouille']

Get 4 random metavariables from random theme:

>>> metasyntactic.random().random(4)
['eve', 'irene', 'frank', 'ellen']

Get random metavariables from 4 random themes:

>>> [theme.random() for theme in metasyntactic.random(4)]
['Barbouille', 'Fragarach', 'Grumpy', 'the_Lord_of_the_Rings']

Get 2 random metavariables from 4 random themes:

>>> [theme.random(2) for theme in metasyntactic.random(4)]
[['Lupa', 'Civetta'],
 ['spigot', 'physique'],
 ['Patrice_Petit', 'Yvette_Chauvire'],
 ['GiNG_GiNG', 'DOINK_DOINK_DOINK_DOINK']]

Themes

# Get theme by theme name >>> foo = metasyntactic.get(“foo”) >>> foo <module ‘metasyntactic.themes.foo’ from ‘metasyntactic/themes/foo.py’>

# Get random name >>> foo.random() ‘fubar’

# Get several random names. >>> foo.random(8) [‘bar’, ‘xyzzy’, ‘foobar’, ‘thud’, ‘foo’, ‘fred’, ‘garply’, ‘quux’]

# Get all names >>> foo.all() set(….)

Categories

# Get random name in specific category >>> foo.random(8, category=”fr”) [‘truc’, ‘test1’, ‘machin’, ‘titi’, ‘tutu’, ‘pipo’, ‘test2’, ‘tata’]

# get default category >>> foo.default() ‘en’

# get all available categories >>> foo.categories() set([‘en’, ‘fr’, ‘nl’])

# get all names in specific category >>> foo.all(category=”fr”) set(…)

>>> yapc = metasyntactic.get("yapc")
>>> yapc.random(4, section="america north")
['Buffalo', 'Pittsburgh', 'Boca_Raton', 'Saint_Louis']
>>> yapc.sections()
set(['america north',
     'america south',
     'asia',
     'australia',
     'brazil',
     'canada',
     'europe',
     'israel',
     'taipei'])

Installation

You can install metasyntactic either via the Python Package Index (PyPI) or from source.

To install using pip,:

$ pip install metasyntactic

To install using easy_install,:

$ easy_install metasyntactic

If you have downloaded a source tarball you can install it by doing the following,:

$ python setup.py build
# python setup.py install # as root

Bug tracker

If you have any suggestions, bug reports or annoyances please report them to our issue tracker at http://github.com/ask/metasyntactic/issues/

License

This software is licensed under the Artistic License. And I don’t reserve any copyright for this work, as all the hard work should be credited to the original authors.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metasyntactic-0.99.tar.gz (160.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metasyntactic-0.99-py3-none-any.whl (421.5 kB view details)

Uploaded Python 3

File details

Details for the file metasyntactic-0.99.tar.gz.

File metadata

  • Download URL: metasyntactic-0.99.tar.gz
  • Upload date:
  • Size: 160.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for metasyntactic-0.99.tar.gz
Algorithm Hash digest
SHA256 cc8f75d1fd0cbd9d2ffd30c5f9d6ff86e50a053b88d0687abb0d84296d4dfdc4
MD5 d19938622ed55471ce7e8f0e935c43b5
BLAKE2b-256 afc3b634d7d9b0c48300dfa5fa991540e297b82df785d3d602ce43dcdf15563a

See more details on using hashes here.

File details

Details for the file metasyntactic-0.99-py3-none-any.whl.

File metadata

  • Download URL: metasyntactic-0.99-py3-none-any.whl
  • Upload date:
  • Size: 421.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.0

File hashes

Hashes for metasyntactic-0.99-py3-none-any.whl
Algorithm Hash digest
SHA256 30637a77d8d6bcc6cd9e6d258c347b9ff16298f73ec5d40769866c8e2464460a
MD5 c9731b0909d98d113c4bdbcd5c19e2fb
BLAKE2b-256 ba649ba2afd33974f09b705c9098a3b4c46374ffd89dc3c7e0ee26af53fe5d92

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page