create ms project xml file using python - python

I am using python 2.7.
I would like to create a xml file like the one ms project creates. I need it (the file) to import it to RadiantQ jQuery Gantt.
any suggestions??
thank you

I would suggest trying MPXJ, if the platform you are working on allows interoperation between Python and Java or .Net.
Similar question and answer here with some suggestions for interoperability tools.

There are lots of libraries available in python to deal with xml files. I personally used ElementTree. Below link is the summary tutorial for this:
http://docs.python.org/2.7/library/xml.etree.elementtree.html#parsing-xml

Related

OpenApi for Python

I'm trying to use OpenAPI for a Python project.
I've previously used OpenAPI with Java and it was really easy as you could configure it into pom.xml so that you would write a yaml file and then you would get an interface that you could implement into your controller.
I'm now working in Python and I'm trying to do a similar thing where you write an yaml file and get an interface or something similar that you can use.
I've tried openapi-generator-cli generate but it seems like it creates a lot of bloat files as it creates the whole server but I only need a single file that I can use further.
Is there something similar for Python as it is for Java?
Thanks in advance
You may want to try import flask_restx.
Then visit top-level URL of your flask app to see the swagger details.
https://flask-restx.readthedocs.io/en/latest/swagger.html#swaggerui
EDIT
Consider using apispec.
$ pip install -U 'apispec[yaml]'
can try flask-toolkits link very easy to setup as it will generate your openapi/swagger spec. Once you already done your code can try with app.run() then access http://localhost:5000/openapi.yaml

Use Pdftron library

I trying to use Pdftron api in my python project but I can't add library in the project.
I read all document in pdftron site for python in the end I can't.
please help.
Currently you have to build your own Python3 bindings. Following this guide, it typically takes ~15 minutes to generate your bindings.
https://github.com/PDFTron/PDFNetWrappers#linux
Once created, you can look at our any of our Python samples to see how to load PDFNet.
https://github.com/PDFTron/PDFNetWrappers/tree/master/Samples/AddImageTest/PYTHON
https://github.com/PDFTron/PDFNetWrappers/blob/master/Samples/AddImageTest/PYTHON/RunTest.sh
https://github.com/PDFTron/PDFNetWrappers/blob/master/Samples/AddImageTest/PYTHON/AddImageTest.py

query rdf file windows

I wanna know how to query a RDF file using Sparql on windows. I'm using python 2.7 and on linux os.system(roqet... ) is there something similar to roqet (rasqal) on windows, like curl for example?, can I make this query with rdflib or something like that? it is very important that this rdf is not online, I wanna perform this query locally through the file.
Thanks
Take a look at either the ARQ tools provided by Apache Jena which will run on Windows provided Java is installed
Or take a look at the rdfQuery tool provided by dotNetRDF which will run on Windows provided .Net 4.0 Full is installed
Disclaimer - I'm a developer on both of the above projects
If your file is reasonably small (less than a few 100,000 triples), I would highly recommend RDFlib, as you suggested. It can be used anywhere you've installed Python and allows full use of SPARQL (both select and update/delete statements), and also gives many other handy features that can be utilized on a local file completely in-memory.
The nice part about using RDFlib is that to get it up and running requires only adding the Python library, so it is very simple to install.

How to wrap Objective-C, to be called from Python?

I have created an objective-C framework that I would like to import and access through a python script. I understand how to import this stuff in Python, but what do i need to do on the obj-c side to make that framework importable?
Thanks
You'll want to use PyObjC, as Chuck said. Specifically, I'd suggest getting the source, which contains a collection of scripts, pyobjc-metadata (here's the readme), that doesn't seem to be included in the default Apple installation, for wrapping a framework, generating the metadata the Python side needs, and so forth.
You can just use PyObjC, which is included in Mac OS X 10.5 and later.
I'm not sure if this particular combination works, but you might be able to use SWIG to create a Python module out of your Objective-C which can then be imported into Python.

Is there any scripting SVG editor?

I would like to edit SVG files using some scripting language (preferably Python). In particular, I would like to merge two SVG files, add some annotations, and arrange them in a larger image. Is there any software available for such purposes?
Thanks,
Bartosz
UPDATE
I finally decided to use the approach proposed by nosklo. You can find the code of SVG handling python module on github repo. I also described how to use it in this post
You could use something like lxml - after all SVG files are XML. It's available from PyPI pip: https://pypi.python.org/pypi/lxml/
I don't know if you could do what you describe, but Inkscape supports some degree of scripting with Python.
Very late answer, but in case it helps anyone, I have written a very small extension for Inkscape that allows writing short python code snippets from within Inkscape.
You can type up to 5 lines and iterate over objects in the current selection or in an XPath. Includes some code examples.

Categories

Resources