Giter VIP home page Giter VIP logo

lpod-python's Introduction

lpod-python

Python library implementing the ISO/IEC 26300 OpenDocument Format standard.

This library is the python implementation of the lpOD Project (Languages & Platforms OpenDocument, definition of a Free Software API implementing the ISO/IEC 26300 standard).

This branch is the 'current' branch, aiming to be the next stable version.

Maintained branches are:

  • legacy : compatible with 0.9x versions
  • current : next stable version
  • master : currently, master = current

The most recent version of this package is there:

https://github.com/lpod/lpod-python

How to get the code with git:

git clone git://github.com/lpod/lpod-python.git
git checkout current

Documentation: see the ./documentation/html folder.

Some usefull packages for the use of the lpod-python library:

About the Lpod Project, see:

http://lpod-project.net

Architect: Jean-Marie GouarnŽ [email protected]

Coordinator: Luis Belmar-Letelier [email protected]

lpod-python's People

Contributors

jdum avatar luisbl avatar thorstenb avatar tokeshu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lpod-python's Issues

Best way to add new properties

Hi,

I need to work with some more properties that the actual ones on lpod.
I enable the properties I need in a fork of lpod:
danieltellez@42c1d8a

I know this is not the best way to do this things, mainly because it is difficult to maintain these fork in parallel with yours with my properties.

Is it possible to pull these properties on your code ?
Or is this any way to work with some kind of plugin over your code ?

Create image in a document (not presentation)

Hi,

I am trying to create an image inside a document, using frames, as you suggests in docs:

uri = my_doc.add_file(chartfilename)
image_frame = odf_create_image_frame(
  url = uri,
  name = "Chart",
)
my_doc.get_body().append(image_frame)

I tried also by adding position and size properties, but neither works.

I've noted in your examples that for presentations you first call get_draw_page. It is needed to do that also in documents ? Can I add images on documents or only on presentations ?

odf_create_heading bug

Code example:

from lpod.document import odf_new_document
from lpod.heading import odf_create_heading
import lpod

print lpod.version
doc = odf_new_document("text")
body = doc.get_body()
heading = odf_create_heading(level=1,text="A heading",start_value=11)
doc.save("/tmp/bug.odf")

throws:

v1.1.3
Traceback (most recent call last):
File "lpod_bug_report.py", line 8, in
heading = odf_create_heading(level=1,text="A heading",start_value=11)
File "/usr/local/lib/python2.7/dist-packages/lpod/heading.py", line 64, in odf_create_heading
element.set_attribute('text:start-value', start_value)
File "/usr/local/lib/python2.7/dist-packages/lpod/element.py", line 607, in set_attribute
element.set(name, value)
File "lxml.etree.pyx", line 695, in lxml.etree._Element.set (src/lxml/lxml.etree.c:35440)
File "apihelpers.pxi", line 563, in lxml.etree._setAttributeValue (src/lxml/lxml.etree.c:15471)
File "apihelpers.pxi", line 1364, in lxml.etree._utf8 (src/lxml/lxml.etree.c:22039)

TypeError: Argument must be bytes or unicode, got 'int'

Documentation:

lpod.heading.odf_create_heading(level, text=None, restart_numbering=False, start_value=None, suppress_numbering=False, style=None)¶

start_value – int

Feature: request api for merge/concatenate two files odt

is it possible implement a good api for to merge/concatenate two or more filese in one without lost formattation and style of every element?

if i use lpod-merge.py in scripts it no take good the style formar of the last files

Installation fail

After downloading lpod-1.1.3, installation fail :
No such file or directory: 'version.txt'
No such file or directory: 'MANIFEST'

After downloading using git :
ImportError: No module named setuptools

Query

Is this project is still under maintenance?, I would like to contribute to this project for GSOC 2018. It would be helpful if I can get any guidance on the project

Miscomputed coordinate

With rows to repeat function enabled in spreadsheet, if you do table.set_value((x,y), value), the value is shift-down. It seems it will take the first non-repeating row as row 0.

get toc from existing .odt file

is it possible to get a table of contents (toc) of an existing .odt file as element?

Because i need to update a TOC, which is already included.

Missing feature - selecting fonts

I am having issues using several different fonts (can change font sizes but not the font face).

The perl version of the library states:

However, if you don't take care, your font specification could produce no visible effect in some situations. Of course you have checked the availability of the needed font in your environment. But, in any ODF document, a font must be declared to be used by a style. Fortunately such declaration is very easy to register thanks to the document-based set_font_declaration() method:

    $doc->set_font_declaration("Times New Roman");

Python binding appears to be missing this capability

Which is the correct way to add a break page ?

This is how I am doing:

    stylename = str(uuid.uuid1())
    break_style = odf_create_style('text', stylename, break_before='page')
    break_style.set_properties(page_break_before='page', area="paragraph")
    self.report.insert_style(break_style)
    breakp = odf_create_paragraph('', stylename)
    body = self.report.get_body()
    body.append(breakp)

And it is not working. I've also tried with a paragraph with some text.

patch?

I was curious about this tool set for generating diff+patch type of workflow. It is great for text files and i wondered if it can be used for documents with this tool-set?

Issue embedding images

First time I added images, I did by passing an URL, so lpod insert the image as a reference. It was enough for me, up to now, that I need to be embedded.

When I use the second method it seems like the image has been added correctly, but I can't open the document on LibreOffice (3.6.2.2). It throws an exception about corrupted file.

I've tried few workarounds to do it, but nothing works. Could be something as simple as reader version incompatibility ? Is there a known issue ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.