semvec/pypi-packages huggingface dataset:
castorapi 0.3
Python API wrapper for Castor EDC to fetch data from you clinical study.
License: MIT
Keywords: Castor EDC,API,Castor,Clinical study,database,data science

# castorapi
Python API wrapper for Castor EDC to fetch data from or post data to your clinical study.

## Install
Using conda and the conda-forge channel (recommended):

    conda install -c conda-forge castorapi

But, you can also install using pip (https://pypi.org/project/castorapi/):

    pip install castorapi

## Update
Using conda and the conda-forge channel:

    conda update -c conda-forge castorapi

Using pip (https://pypi.org/project/castorapi/):

    pip install castorapi --upgrade

## Usage
First, make sure that save the client and secret from your Castor account in 
seperate *client* and *secret* files (without line endings) in a private 
folder on your PC. Do not share these files with anyone.

![image](https://user-images.githubusercontent.com/981436/130036568-6209334a-2a8b-4948-9387-7c6c74e0ef08.png)

See also https://data.castoredc.com/api and https://helpdesk.castoredc.com/article/124-application-programming-interface-api

## Example code
    import castorapi as ca
    c = ca.CastorApi('/path/to/folder/with/secret_client')
    c.select_study_by_name('<CASTOR_STUDY_NAME>') # all following commands use this study selection
    stats = c.request_statistics()
    print(stats)
    df_study, df_structure_study, df_report, df_structure_report, df_optiongroups_structure = c.records_reports_all()
    users_in_study = c.request_studyuser()
    print(users_in_study)
    
    # Getting data from castor about patients in a study
    c.request_study_records(record_id='CASTOR00010')
    
    # Posting data to castor to create a new patient
    # add institute_id and , request_method='POST' to use this functionality.
    c.request_study_records(record_id='CASTOR00010', institute_id=<instituteID>, request_method='POST')

## Known issues
1. The documentation is sparse. Feel free to contribute.
2. Not all Castor API functions are implemented (I implement them on a need-to-use basis), feel free to contribute.
3. See https://github.com/wouterpotters/castorapi/issues for an overview of all open issues.

## NOTE
I am not affiliated with Castor EDC in any way. Use this software at your own risk.
If this API tool does not suffice - take a look at the work from Reinier van Linschoten, who also created a Python package for two-way communication Castor EDC (2021). (https://github.com/reiniervlinschoten/castoredc_api)
pyopencl-extension 0.2.9
This package extends PyOpenCl by providing an object-oriented kernel programming framework and debugging capabilities.
License: MIT
Requires Python: >=3.10.0



pyopencl-extension
==========================

This package extends PyOpenCl by providing an object-oriented kernel programming framework and debugging capabilities.

What makes pyopencl-extension special?
   * Build on top of `PyOpenCl <https://pypi.org/project/pyopencl/>`_ which can increase performance significantly.
   * Usage of this framework forces consistent code when programming for GPU.
   * Allows debugging of OpenCl-Programs through kernel emulation in Python using a visual debugger (tested with Pycharm).
   * OpenCl emulation allows to find out-of-bounds array indexing more easily.
   * Integrated profiling features give quick overview over performance bottlenecks.

The project is in an early development stage and actively maintained.
For any feature requests/feedback/etc. you can get in touch via
`Github <https://github.com/philipp-mohr/pyopencl-extension/issues>`_ or by E-Mail (philipp.mohr@tuhh.de).

Installation
------------
Install this library with :code:`pip install pyopencl-extension`.

When automatic installation of PyOpenCl fails (happens when using Windows):

    1. Download appropriate .whl binary from `PyOpenCl binaries for Windows <https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyopencl>`_

    2. Make sure to have `proper <https://streamhpc.com/blog/2015-03-16/how-to-install-opencl-on-windows/>`_ OpenCl driver for your graphics card installed.

    3. Run :code:`pip install "pyopencl-X-cpX-cpX-X.whl"` in terminal, where X must be replaced with corresponding version.

Usage
-----
One very simple example is given below.


.. code-block:: python

    from pyopencl_extension import Kernel, Global, Scalar, Types, zeros
    import numpy as np

    ary = zeros((10,), Types.short)

    knl = Kernel('some_operation',
                 {'ary': Global(ary),  # notice that ary is set as default argument
                  'number': Scalar(Types.short)},
                 """
                    ary[get_global_id(0)] = get_global_id(0) + number;
                 """,
                 global_size=ary.shape).compile(emulate=True)
    knl(number=3)
    assert np.allclose(ary.get(), np.arange(10) + 3)

By setting the argument 'emulate=True' the kernel will be compiled in emulation mode. This mode creates a
file 'some_operation.py', which can be inspected using a visual debugger:

.. image:: https://i.imgur.com/Gfg9AtZ.png
    :width: 600

More advanced examples can by found in the `tests hosted on  Github <https://github.com/philipp-mohr/pyopencl-extension/tree/main/tests>`_.