{ "info": { "author": "UNKNOWN", "author_email": "UNKNOWN", "bugtrack_url": null, "classifiers": [], "description": "===========\nWhiffle\n===========\n\nWhiffle provides a wrapper around the Wikidot XML-RPC API.\nExample scripts are provided for re-parenting pages and changing tags\nin large batches.\n\nChange Log\n==========\n\nv0.1\tInitial release\nv1.0\tModified for the v2 API\n\n\nInstallation\n============\n\nWhiffle is a normal Python package and is held on the PyPI repository.\nIt can be installed using *pip* or any other method of your choice. If\nyou know what I'm talking about then you don't need me to hold your\nhand.\n\nIf you are new to Python or installing packages from PyPI, then the\neasiest way to install Whiffle is manually.\n\n* Extract all the files into an empty folder.\n* From a command prompt in that folder, give the command\n python setup.py install\n\nUsing Whiffle\n=============\n\nThe first thing you need to do is to configure the \"identity.ini\" file.\nThis file must be in the current directory when an application that uses\nwhiffle executes. There is a skeleton in the bin folder that you can use\nto get started.\n\nThe identity.ini file\n---------------------\n\n [default@wikidot]\n This heading allows you to have multiple identities and sites.\n\tUntil you want to do two things at once, leave it alone. The\n\t\"@wikidot\" and the brackets must be there, but you can change\n\tthe name (\"default\"). \n user: AWikidotUserName\n This is the Wikidot username that has API access to the site\n key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n This is the API key of the wikidot user\n site: AWikidotSiteName\n This is the Wikidot site that you are working on. It's just the\n\tname, no \"http\" or \"wikidot.com\".\n\nOnce you have set up the identity.ini file, look at the examples:\naddtag.py and chparent.py in the bin sub-folder of the installation\nfolder. These are probably the best way to get started and may be all\nyou need.\n\naddtag.py\n---------\n\nUsage: addtag.py [options] page [tag]\nAdds or removes tags from Wikidot pages.\n\nOptions:\n -h, --help\n show this help message and exit\n\t\n -i IDENTITY, --identity=IDENTITY\n define the name of the entry in the identity.ini file to use.\n\tThe default is \"default\".\n\t\n -r, --remove\n remove the specified tag (default action is to add it).\n\t\n -f FILE, --file=FILE\n define the name of the a file, each line of which\n contains SPACE or just . If is\n not specified on any line, then the one specified on\n the command line is used. If every line specifies a\n tag, then a tag is not required on the command line.\n\nExamples:\n* addtag.py start fred\n adds the tag \"fred\" to the page \"start\".\n\n* addtag.py -r start fred\n removes the tag \"fred\" from the page \"start\".\n\n* addtag.py language:python good\n adds the tag \"good\" to the page \"language:python\"\n \n* addtag.py -f myfile.txt defaulttag\n assuming the file myfile.txt contains:\n start fred\n\tstop\n adds the tag \"fred\" to the page \"start\" and adds the tag\n \"defaulttag\" to the page \"stop\".\n \n Specifying the the tag on the command line is not necessary if every\n line of the file specifies a tag.\n \nchparent.py\n-----------\n\nUsage: chparent.py [options] parent child\nChanges the parent of a page\n\nOptions:\n -h, --help\n show this help message and exit\n -i IDENTITY, --identity=IDENTITY\n define the name of the entry in the identity.ini file to use.\n The default is \"default\".\n -f FILE, --file=FILE\n define the name of the a file, each line of which contains\n SPACE. If this option is specified then the\n parent and child should not be given on the command line.\n\nExamples:\n\n* chparent start help\n makes page \"start\" the parent of page \"help\"\n \n* chparent -f myfile.txt\n assuming the file myfile.txt contains:\n start help\n help help:how-to-edit\n makes page \"start\" the parent of page \"help\" and makes page \"help\"\n the parent of page \"help:how-to-edit\" \n\n \n \nUsing Whiffle in your own application\n=====================================\n\nEach program should include the following::\n from whiffle import wikidotapi, ApiError, SemanticError\n ...\n api = wikidotapi.connection(identity)\n ...\n \nThe parameter to wikidotapi.connection() is optional, and it defaults to\n\"default\", which is the identity used in the skeleton identity.ini file.\n\nCalls can then be made on the methods of the \"api\" object. See the\nexample code for the syntax.\n\npage_is_valid(name)\n-------------------\nReturns True if the name is a valid page name. Validation is only aimed\nat preventing pages being created that are impossible to delete, and\ndoes not attempt to replicate Wikidot rules.\n\ncategory_is_valid(name)\n-------------------\nReturns True if the name is a valid category name. Validation is only aimed\nat preventing pages being created that are impossible to delete, and\ndoes not attempt to replicate Wikidot rules.\n\nsite_is_valid(name)\n-------------------\nReturns True if the name is a valid page name. Validation is only basic,\nand does not attempt to replicate Wikidot rules.\n\nSite\n----\nThe name of the current site. The default is that found in the\nidentity.ini file. Site can be assigned to in order to work on multiple\nsites in the same application::\n dosomething()\n api.Site = \"newsite\"\n dosomething()\n \nPages\n-----\nA list of page names. This list is updated the first time Pages is used\nand a cached copy is used thereafter. To refresh the cache, call\n\"refresh_pages()\".\n\nThe content of this list is that returned by a pages.select API call. \n\nCategories\n----------\nA list of dictionaries, each of which describe a category. This list is\nupdated the first time Categories is used and a cached copy is used\nthereafter. To refresh the cache, call \"refresh_categories()\".\n\nThe content of this list is that returned by a categories.select API\ncall. \n\npage_exists(page, category=\"_default\")\n--------------------------------------\nReturns True if the page already exists (according to the Pages cache).\nThe page name can be given either as \"category:page\" or the page name\nand the category can be given separately.\n\nget_page_item(page, item, category=\"_default\")\n----------------------------------------------\nGets a datum from the given key for the given page (from the Pages\ncache). The page name can be given either as \"category:page\" or the page name\nand the category can be given separately.\n\nThe item parameter is a string containing the dictionary key. Valid keys\nare those returned by the page.get_one API method.\n\nset_page_item(page, item, value, create=False, category=\"_default\")\n----------------------------------------------\nSets the datum for given key on the given page. The page name can be\ngiven either as \"category:page\" or the page name and the category can be\ngiven separately.\n\nThe item parameter is a string containing the dictionary key. Valid keys\nare those taken by thepages.save-one API method, and the value parameter\nmust be a valid value for that entry.\n\nIf the create parameter is True, then this call may create a new\n(probably blank) page. Otherwise this call will raise an exception if\nthe page does not already exist (according to the Pages cache).\n\nadd_tag(page, tag, category=\"_default\", ErrorIfRedundant=True)\n--------------------------------------------------------------\nAdds the given tag to the given page. The page name can be\ngiven either as \"category:page\" or the page name and the category can be\ngiven separately.\n\nIf the ErrorIfRedundant parameter is False, then this call will not fail\nif the page already has the given tag. Otherwise an exception will be\nraised if the tag is already on the page.\n\nremove_tag(page, tag, category=\"_default\", ErrorIfRedundant=True)\n--------------------------------------------------------------\nRemoves the given tag from the given page. The page name can be\ngiven either as \"category:page\" or the page name and the category can be\ngiven separately.\n\nIf the ErrorIfRedundant parameter is False, then this call will not fail\nif the page does not have the given tag. Otherwise an exception will be\nraised if the tag is not on the page.\n\nserver\n------\nThe API server proxy. This can be used to make API calls::\n api.server.site.categories ({\"site\": self.Site})\nOf course if you make calls through this object then Whiffle does not\ndo any validation checks; you are on your own.\n\nApiError\n--------\nAn exception raised by the api object. Most exceptions are of this type\nexcept for...\n\nSemanticError\n-------------\nAn exception raised by the api object due to an atempt to write to a\nread-only object.\n\n\n\nHello World\n===========\n\nHere is the Whiffle version of Hello World::\n\n from whiffle import wikidotapi\n \n api = wikidotapi.connection()\n api.set_page_item(\"hello\", \"content\", \"**Hello World!**\", create=True)\n\nThat creates the page \"hello\" and puts the text \"Hello World!\" on it in\nbold.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "GNU Lesser General Public License v3 or later", "maintainer": null, "maintainer_email": null, "name": "Whiffle", "package_url": "https://pypi.org/project/Whiffle/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/Whiffle/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/Whiffle/1.0/", "requires_dist": null, "requires_python": null, "summary": "A wrapper around the Wikidot XML-RPC API", "version": "1.0" }, "last_serial": 786009, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "7165db8386115051595ba71666fb05fa", "sha256": "827c75a33e15dd90e444454e363316b245bfded94713b430396e4b6b9c784b1c" }, "downloads": -1, "filename": "Whiffle-0.1.0.tar.gz", "has_sig": false, "md5_digest": "7165db8386115051595ba71666fb05fa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22533, "upload_time": "2010-09-05T16:06:10", "url": "https://files.pythonhosted.org/packages/56/08/8e72076a18bd47734bb86ac738b89fc79710f6aab4817eecdfcf6e1edc44/Whiffle-0.1.0.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "a9bc9844d00fce3ab7d3e06277d14f73", "sha256": "b47cad9126ab26ca4309170d37294ef0763174360a01a75a71f1ba1ff702dfcc" }, "downloads": -1, "filename": "Whiffle-1.0.tar.gz", "has_sig": false, "md5_digest": "a9bc9844d00fce3ab7d3e06277d14f73", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21886, "upload_time": "2010-09-28T00:52:00", "url": "https://files.pythonhosted.org/packages/79/29/dc911d0f06b38a4cf94b7dc378e5ed554fb422488761e1b913c44e715f2b/Whiffle-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a9bc9844d00fce3ab7d3e06277d14f73", "sha256": "b47cad9126ab26ca4309170d37294ef0763174360a01a75a71f1ba1ff702dfcc" }, "downloads": -1, "filename": "Whiffle-1.0.tar.gz", "has_sig": false, "md5_digest": "a9bc9844d00fce3ab7d3e06277d14f73", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21886, "upload_time": "2010-09-28T00:52:00", "url": "https://files.pythonhosted.org/packages/79/29/dc911d0f06b38a4cf94b7dc378e5ed554fb422488761e1b913c44e715f2b/Whiffle-1.0.tar.gz" } ] }