Package: nuxeo
Client Library for Nuxeo APIThe Nuxeo Python Client is a Python client library for the Nuxeo
Automation and REST API. It works with Python 3.6+.This is an ongoing project, supported by Nuxeo.Getting StartedThe installation is as simple as:python-mpipinstall-U--usernuxeoThe client can make use of the Amazon S3 provider, to install its requirements:python-mpipinstall-U--user"nuxeo[s3]"The client is compatible with OAuth2 mechanism, to install its requirements:python-mpipinstall-U--user"nuxeo[oauth2]"And to install several flavors of requirements:python-mpipinstall-U--user"nuxeo[oauth2, s3]"ImportThen, use the followingimportstatement to have access to the Nuxeo
API:fromnuxeo.clientimportNuxeoDocumentationCheck out theAPI documentation.RequirementsThe Nuxeo Python client works only with:the Nuxeo Platform >= LTS 2015requests>= 2.12.2 (for unicode authentication)setuptools>= 30.3.0Quick StartThis quick start guide will show how to do basics operations using the
client.Connect to the Nuxeo PlatformThe easiest way to connect to the Nuxeo Platform with a basic authentication
is passing a tuple containing theusernameand thepasswordto the
client, like so:nuxeo=Nuxeo(auth=('Administrator','Administrator'))You can then use thenuxeoobject to interact with the Platform. If you want
to use a specific instance, you can specify thebase_urllike so:nuxeo=Nuxeo(host='http://demo.nuxeo.com/nuxeo/',auth=('Administrator','Administrator'))Download/Upload ConfigurationIn thenuxeo/constants.pyfile, you have several constants that are
used throughout the client that you can change to fit your needs. Some of them are:CHECK_PARAMS(False by default), to check operation’s parameters for each and every HTTP calls.CHUNK_LIMIT(10 MiB by default), the size above which the upload will automatically be chunked.CHUNK_SIZE(8 KiB by default), the size of the chunks when downloading.MAX_RETRY(5 by default), the number of retries for connection error on any HTTP call.UPLOAD_CHUNK_SIZE(20 MiB by default), the size of the chunks when uploading.Run NXQL QueriesYou can run queries in NXQL (NXQL is a subset of SQL,
you can check how to use itin the documentation).
Here, we are firstfetching a workspace, and then using itsuidto build a query which will find all its children that have aFileorPicturetype, and are not deleted.# Fetch a workspacews=nuxeo.documents.get(path='/default-domain/workspaces/ws')# Build a query using its UIDnxql=("SELECT * FROM Document WHERE ecm:ancestorId = '{uid}'""   AND ecm:primaryType IN ('File', 'Picture')""   AND ecm:currentLifeCycleState != 'deleted'")query=nxql.format(uid=ws.uid)# Make the requestsearch=nuxeo.client.query(query,params={'properties':'*'})# Get resultsentries=search['entries']entrieswill be alistcontaining adictfor each
element returned by the query.UsageNow that your client is set up, here are pages to help you with the
main functions available:Available authentication mechanismsManage users and groupsWork with documentsWork with directoriesWork with blobsWork with commentsRun requestsHelpersUseful snippetsScript: Find duplicatesScript: Create a live proxyYou can also checkthe  API documentationof this Python client for further options.ContributingSee ourcontribution documentation.Setupgitclonehttps://github.com/nuxeo/nuxeo-python-clientcdnuxeo-python-clientpython-mpipinstall-e".[oauth2, s3]"TestA Nuxeo Platform instance needs to be running onhttp://localhost:8080/nuxeofor the tests to be run, and then:python-mpipinstall-U--usertoxtoxSentryWe use Sentry to catch unhandled errors from tests.
You can tweak it before runningtox.It can be disabled:exportSKIP_SENTRY=1You can also customize the Sentry DSN for your own team:exportSENTRY_DSN="XXX"And customize the Sentry environment too:# Note that the default value is "testing"exportSENTRY_ENV="testing"DeployingReleases are fully automated, have a look at thatGitHub Action.Reporting IssuesYou can follow the developments in the Nuxeo Python Client project of
our JIRA bug tracker:NXPY.You can report issues onanswers.nuxeo.com.LicenseApache License 2.0Copyright (c) NuxeoAbout NuxeoNuxeo dramatically improves how content-based applications are built,
managed and deployed, making customers more agile, innovative and
successful. Nuxeo provides a next generation, enterprise ready platform
for building traditional and cutting-edge content oriented applications.
Combining a powerful application development environment with SaaS-based
tools and a modular architecture, the Nuxeo Platform and Products
provide clear business value to some of the most recognizable brands
including Verizon, Electronic Arts, Sharp, FICO, the U.S. Navy, and
Boeing. Nuxeo is headquartered in New York and Paris. More information
is available atwww.nuxeo.com.