- Version:
- 1.0.14
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.
Release files for metasyntactic 1.0.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| metasyntactic-1.0.14.tar.gz | 336.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| metasyntactic-1.0.14-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 758.4 kB
Release files / metasyntactic-1.0.14.tar.gz
| Download URL | metasyntactic-1.0.14.tar.gz |
|---|---|
| Size | 336.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
85b59cc35cfc20ce9762145de7039f533a8e2239bc1a69bc0054b5a4934ba977
|
|
BLAKE2b-256 checksum How to use checksums |
8c9391ed437d6301d1f6969ced94773201f5566eb8ea2d799a7b5de5e72df09f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / metasyntactic-1.0.14-py3-none-any.whl
| Download URL | metasyntactic-1.0.14-py3-none-any.whl |
|---|---|
| Size | 421.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cea5130ec4f0dd4902c37e76866fdc6db645d45b34f566d0ebc63b492921a127
|
|
BLAKE2b-256 checksum How to use checksums |
29026148efd4bfaa43a234ea9b94d9c89ba9515a769f0fa8f4e36a3d1e692daf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|