MarkLogic Connect
MarkLogic Connect Client API Collection
|
The main page for Python coding documentation.
This is the home page for Python support.
The Python API supports the same features as the C++ API.
Here is some sample code. The full detail can be found in the Python basic sample.
#!/usr/bin/python import mlclientpython connection = mlclientpython.Connection(); connection.configure("192.168.123.4","8122","admin","admin",False); response = connection.getDocument("/some/doc.json") print "Document content: ", response.getContent()
As you can see, the above sample simply connects to a MarkLogic REST API HTTP endpoint and fetches the raw text content of the JSON document with the specified document ID (URI).
This section describes language specific features. I.e. features provided for the Idioms developers of this language would expect.
Unfortunately some C++ methods from the core API are overloaded with different call parameters. This is not currently supported by the SWIG Python generator. This will be resolved in a future version, as other languages have the same restriction.
Python Classes are generated on a 1:1 basis with C++ classes. SWIG Python does support the STL iterator and collection mechanisms, mapping them on to Python idioms. There are known non-STL compliance issues with the current iterators, and so you may experience some issues using iterators (E.g. via SearchResultSet or DocumentSet). Please log an issue on GitHub if you have any problems.
C++ operators such as >> and << and +, =, ++, –, are not mapped to Python idioms currently. == is mapped to eq() and != is mapped to ne().
TODO
TODO