{ "info": { "author": "Ralf Schlatterbeck", "author_email": "rsc@runtux.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Office/Business :: Office Suites", "Topic :: Text Editors :: Word Processors", "Topic :: Text Processing", "Topic :: Text Processing :: General", "Topic :: Text Processing :: Markup :: XML" ], "description": "OOoPy: Modify OpenOffice.org documents in Python\n================================================\n\n:Author: Ralf Schlatterbeck \n\nOpenOffice.org (OOo) documents are ZIP archives containing several XML\nfiles. Therefore it is easy to inspect, create, or modify OOo\ndocuments. OOoPy is a library in Python for these tasks with OOo\ndocuments. To not reinvent the wheel, OOoPy uses an existing XML\nlibrary, ElementTree_ by Fredrik Lundh. OOoPy is a thin wrapper around\nElementTree_ using Python's ZipFile to read and write OOo documents.\n\n.. _ElementTree: http://effbot.org/zone/element-index.htm\n\nIn addition to being a wrapper for ElementTree_, OOoPy contains a\nframework for applying XML transforms to OOo documents. Several\nTransforms for OOo documents exist, e.g., for changing OOo fields (OOo\nInsert-Fields menu) or using OOo fields for a mail merge application.\nSome other transformations for modifying OOo settings and meta\ninformation are also given as examples.\n\nApplications like this come in handy in applications where calling\nnative OOo is not an option, e.g., in server-side Web applications.\n\nIf the mailmerge transform doesn't work for your document: The OOo\nformat is well documented but there are ordering constraints in the body\nof an OOo document.\nI've not yet figured out all the tags and their order in the\nOOo body. Individual elements in an OOo document (like e.g., frames,\nsections, tables) need to have their own unique names. After a mailmerge,\nthere are duplicate names for some items. So far I'm renumbering only\nframes, sections, and tables. See the renumber objects at the end of\nooopy/Transforms.py. So if you encounter missing parts of the mailmerged\ndocument, check if there are some renumberings missing or send me a `bug\nreport`_.\n\n.. _`bug report`: http://ooopy.sourceforge.net/#reporting-bugs\n\nThere is currently not much documentation except for a python doctest in\nOOoPy.py and Transformer.py and the command-line utilities_.\nFor running these test, after installing\nooopy (assuming here you installed using python into /usr/local)::\n\n cd /usr/local/share/ooopy\n python run_doctest.py /usr/local/lib/python2.X/site-packages/ooopy/Transformer.py\n python run_doctest.py /usr/local/lib/python2.X/site-packages/ooopy/OOoPy.py\n\nBoth should report no failed tests.\nFor running the doctest on python2.3 with the metaclass trickery of\nautosuper, see the file run_doctest.py. For later versions of python the\nbug in doctest is already fixed.\n\nUsage\n-----\n\nThere were some slight changes to the API when supporting the open\ndocument format introduced with OOo 2.0. See below if you get a traceback\nwhen upgrading from an old version.\n\nSee the online documentation, e.g.::\n\n % python\n >>> from ooopy.OOoPy import OOoPy\n >>> help (OOoPy)\n >>> from ooopy.Transformer import Transformer\n >>> help (Transformer)\n\nHelp, I'm getting an AssertionError traceback from Transformer, e.g.::\n\n Traceback (most recent call last):\n File \"./replace.py\", line 17, in ?\n t = Transformer(Field_Replace(replace = replace_dictionary))\n File \"/usr/local/lib/python2.4/site-packages/ooopy/Transformer.py\", line 1226, in __init__\n assert (mimetype in mimetypes)\n AssertionError\n\nThe API changed slightly when implementing handling of different\nversions of OOo files. Now the first parameter you pass to the\nTransformer constructor is the mimetype of the OpenOffice.org document\nyou intend to transform. The mimetype can be fetched from another opened\nOOo document, e.g.::\n\n ooo = OOoPy (infile = 'test.odt', outfile = 'test_out.odt')\n t = Transformer(ooo.mimetype, ...\n\nUsage of Command-Line Utilities\n-------------------------------\n\nA, well, there are command-line _`utilities` now:\n\n- ooo_cat for concatenating several OOo files into one\n- ooo_grep to do equivalent of grep -l on OOo files -- only runs on\n Unix-like operating systems, probably only with the GNU version of grep\n (it's a shell-script using ooo_as_text)\n- ooo_fieldreplace for replacing fields in an OOo document\n- ooo_mailmerge for doing a mailmerge from a template OOo document and a\n CSV (comma separated values) input\n- ooo_as_text for getting the text from an OOo-File (e.g., for doing a\n \"grep\" on the output).\n- ooo_prettyxml for pretty-printing the XML nodes of one of the XML\n files inside an OOo document. Mainly useful for debugging.\n\nAll utilities take a ``--help`` option.\n\nResources\n---------\n\nProject information and download from `Sourceforge main page`_\n\n.. _`Sourceforge main page`: http://sourceforge.net/projects/ooopy/\n\nYou need at least version 2.3 of python.\n\nFor using OOoPy with Python versions below 2.5, you need to download and\ninstall the\n`ElementTree Library`_ by Fredrik Lundh. For documentation about the OOo\nXML file format, see the book by J. David Eisenberg called\n`OASIS OpenDocument Essentials`_ which is under the Gnu Free\nDocumentation License and is also available `in print`_. For a reference\ndocument you may want to check out the `XML File Format Specification`_\n(PDF) by OpenOffice.org.\n\nA german page for OOoPy exists at `runtux.com`_\n\n.. _`ElementTree Library`: http://effbot.org/downloads/#elementtree\n.. _`OASIS OpenDocument Essentials`: http://books.evc-cit.info/\n.. _`in print`:\n http://www.lulu.com/product/paperback/oasis-opendocument-essentials/392512\n.. _`XML File Format Specification`:\n http://xml.openoffice.org/xml_specification.pdf\n.. _`runtux.com`: http://www.runtux.com/ooopy.html\n\nReporting Bugs\n--------------\nPlease use the `Sourceforge Bug Tracker`_ and\n\n - attach the OOo document that reproduces your problem\n - give a short description of what you think is the correct behaviour\n - give a description of the observed behaviour\n - tell me exactly what you did.\n\n.. _`Sourceforge Bug Tracker`:\n http://sourceforge.net/tracker/?group_id=134329&atid=729727\n\nChanges\n-------\n\nVersion 1.11: Small Bug fix ooo_mailmerge\n\nNow ooo_mailmerge uses the delimiter option, it was ignored before.\nThanks to Bob Danek for report and test.\n\n - Fix setting csv delimiter in ooo_mailmerge\n\nVersion 1.10: Fix table styles when concatenating\n\nNow ooo_cat fixes tables styles when concatenating (renaming): We\noptimize style usage by re-using existing styles. But for some table\nstyles the original names were not renamed to the re-used ones.\nFixes SF Bug 10, thanks to Claudio Girlanda for reporting.\n\n - Fix style renaming for table styles when concatenating documents\n - Add some missing namespaces (ooo 2009)\n\nVersion 1.9: Add Picture Handling for Concatenation\n\nNow ooo_cat supports pictures, thanks to Antonio S\u00e1nchez for reporting\nthat this wasn't working.\n\n - Add a list of filenames + contents to Transformer\n - Update this file-list in Concatenate\n - Add Manifest_Append transform to update META-INF/manifest.xml with\n added filenames\n - Add hook in OOoPy for adding files\n - Update tests\n - Update ooo_cat to use new transform\n - This is the first release after migration of the version control from\n Subversion to GIT\n\nVersion 1.8: Minor bugfixes\n\nDistribute a missing file that is used in the doctest. Fix directory\nstructure. Thanks to Michael Nagel for suggesting the change and\nreporting the bug.\n\n - The file ``testenum.odt`` was missing from MANIFEST.in\n - All OOo files and other files needed for testing are now in the\n subdirectory ``testfiles``.\n - All command line utilities are now in subdirectory ``bin``.\n\nVersion 1.7: Minor feature additions\n\nAdd --newlines option to ooo_as_text: With this option the paragraphs in\nthe office document are preserved in the text output.\nFix assertion error with python2.7, thanks to Hans-Peter Jansen for the\nreport. Several other small fixes for python2.7 vs. 2.6.\n\n - add --newlines option to ooo_as_text\n - fix assertion error with python2.7 reported by Hans-Peter Jansen\n - fix several deprecation warnings with python2.7\n - remove zip compression sizes from regression test: the compressor in\n python2.7 is better than the one in python2.6\n\nVersion 1.6: Minor bugfixes\n\nFix compression: when writing new XML-files these would be stored\ninstead of compressed in the OOo zip-file resulting in big documents.\nThanks to Hans-Peter Jansen for the patch. Add copyright notice to\ncommand-line utils (SF Bug 2650042). Fix mailmerge for OOo 3.X lists (SF\nBug 2949643).\n\n - fix compression flag, patch by Hans-Peter Jansen\n - add regression test to check for compression\n - now release ooo_prettyxml -- I've used this for testing for quite\n some time, may be useful to others\n - Add copyright (LGPL) notice to command-line utilities, fixes SF Bug\n 2650042\n - OOo 3.X adds xml:id tags to lists, we now renumber these in the\n mailmerge app., fixes SF Bug 2949643\n\nVersion 1.5: Minor feature enhancements\n\nAdd ooo_grep to search for OOo files containing a pattern. Thanks to\nMathieu Chauvinc for the reporting the problems with modified\nmanifest.xml.\nSupport python2.6, thanks to Erik Myllymaki for reporting and anonymous\ncontributor(s) for confirming the bug.\n\n - New shell-script ooo_grep (does equivalent to grep -l on OOo Files)\n - On deletion of an OOoPy object close it explicitly (uses __del__)\n - Ensure mimetype is the first element in the resulting archive, seems\n OOo is picky about this.\n - When modifying the manifest the resulting .odt file could not be\n opened by OOo. So when modifying manifest make sure the manifest\n namespace is named \"manifest\" not something auto-generated by\n ElementTree. I consider this a bug in OOo to require this. This now\n uses the _namespace_map of ElementTree and uses the same names as OOo\n for all namespaces. The META-INF/manifest.xml is now in the list of\n files to which Transforms can be applied.\n - When modifying (or creating) archive members, we create the OOo\n archive as if it was a DOS system (type fat) and ensure we use the\n current date/time (UTC). This also fixes problems with file\n permissions on newer versions of pythons ZipFile.\n - Fix for python2.6 behavior that __init__ of object may not take any\n arguments. Fixes SF Bug 2948617.\n - Finally -- since OOoPy is in production in some projects -- change the\n development status to \"Production/Stable\".\n\nVersion 1.4: Minor bugfixes\n\nFix Doctest to hopefully run on windows. Thanks to Dani Budinova for\ntesting thoroughly under windows.\n\n - Open output-files in \"wb\" mode instead of \"w\" in doctest to not\n create corrupt OOo documents on windows.\n - Use double quotes for arguments when calling system, single quotes\n don't seem to work on windows.\n - Dont use redirection when calling system, use -i option for input\n file instead. Redirection seems to be a problem on windows.\n - Explicitly call the python-interpreter, running a script directly is\n not supported on windows.\n\nVersion 1.3: Minor bugfixes\n\nRegression-test failed because some files were not distributed.\nFixes SF Bugs 1970389 and 1972900.\n\n - Fix MANIFEST.in to include all files needed for regression test\n (doctest).\n\nVersion 1.2: Major feature enhancements\n\nAdd ooo_fieldreplace, ooo_cat, ooo_mailmerge command-line utilities. Fix\nooo_as_text to allow specification of output-file. Note that handling of\nnon-seekable input/output (pipes) for command-line utils will work only\nstarting with python2.5. Minor bug-fix when concatenating documents. \n\n - Fix _divide (used for dividing body into parts that must keep\n sequence). If one of the sections was empty, body parts would change\n sequence.\n - Fix handling of cases where we don't have a paragraph (only list) elements\n - Implement ooo_cat\n - Fix ooo_as_text to include more command-line handling\n - Fix reading/writing stdin/stdout for command-line utilities, this\n will work reliably (reading/writing non-seekable input/output like,\n e.g., pipes) only with python2.5\n - implement ooo_fieldreplace and ooo_mailmerge\n\nVersion 1.1: Minor bugfixes\n\nSmall Documentation changes\n\n - Fix css stylesheet\n - Link to SF logo for Homepage\n - Link to other information updated\n - Version numbers in documentation fixed\n - Add some checks for new API -- first parameter of Transformer is checked now\n - Ship files needed for running the doctest and explain how to run it\n - Usage section\n\nVersion 1.0: Major feature enhancements\n\nNow works with version 2.X of OpenOffice.org. Minor API changes.\n\n - Tested with python 2.3, 2.4, 2.5\n - OOoPy now works for OOo version 1.X and version 2.X\n - New attribute mimetype of OOoPy -- this is automatically set when\n reading a document, and should be set when writing one.\n - renumber_all, get_meta, set_meta are now factory functions that take\n the mimetype of the open office document as a parameter.\n - Since renumber_all is now a function it will (correctly) restart\n numbering for each new Attribute_Access instance it returns.\n - Built-in elementtree support from python2.5 is used if available\n - Fix bug in optimisation of original document for concatenation", "description_content_type": null, "docs_url": null, "download_url": "http://downloads.sourceforge.net/project/ooopy/ooopy/1.11/OOoPy-1.11.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://ooopy.sourceforge.net/", "keywords": null, "license": "GNU Library or Lesser General Public License (LGPL)", "maintainer": null, "maintainer_email": null, "name": "OOoPy", "package_url": "https://pypi.org/project/OOoPy/", "platform": "Any", "project_url": "https://pypi.org/project/OOoPy/", "project_urls": { "Download": "http://downloads.sourceforge.net/project/ooopy/ooopy/1.11/OOoPy-1.11.tar.gz", "Homepage": "http://ooopy.sourceforge.net/" }, "release_url": "https://pypi.org/project/OOoPy/1.11/", "requires_dist": null, "requires_python": null, "summary": "OOoPy: Modify OpenOffice.org documents in Python", "version": "1.11" }, "last_serial": 1094629, "releases": { "0.2": [], "1.0.4299": [], "1.1.4479": [], "1.10": [], "1.11": [], "1.2.4576": [], "1.3.4825": [], "1.4.4873": [], "1.5.6973": [], "1.6.7680": [], "1.7.9569": [], "1.8.10901": [], "1.9": [] }, "urls": [] }