The open-source PyNX toolkit has been extended to provide tools for coherent X-ray imaging data analysis and simulation. All calculations can be executed on graphical processing units (GPUs) to achieve high-performance computing speeds. The toolkit can be used for coherent diffraction imaging (CDI), ptychography and wavefront propagation, in the far- or near-field regime. Moreover, all imaging operations (propagation, projections, algorithm cycles…) can be implemented in Python as simple mathematical operators, an approach which can be used to easily combine basic algorithms in a tailored chain. Calculations can also be distributed to multiple GPUs, e.g. for large ptychography data sets. Command-line scripts are available for on-line CDI and ptychography analysis, either from raw beamline data sets or using the coherent X-ray imaging data format.