{"id":19798818,"url":"https://github.com/axopy/pymcc","last_synced_at":"2025-10-05T12:53:14.077Z","repository":{"id":201552326,"uuid":"95814479","full_name":"axopy/pymcc","owner":"axopy","description":"Interface to Measurement Computing DAQs that works with AxoPy","archived":false,"fork":false,"pushed_at":"2018-06-23T00:16:54.000Z","size":65,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-09T13:28:40.836Z","etag":null,"topics":["data-acquisition"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/axopy.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-06-29T19:56:30.000Z","updated_at":"2025-07-18T19:36:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"baac6ce9-fc46-4fa5-9982-ac946ef6c7a5","html_url":"https://github.com/axopy/pymcc","commit_stats":null,"previous_names":["axopy/pymcc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/axopy/pymcc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axopy%2Fpymcc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axopy%2Fpymcc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axopy%2Fpymcc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axopy%2Fpymcc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axopy","download_url":"https://codeload.github.com/axopy/pymcc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axopy%2Fpymcc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278457469,"owners_count":25989956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-acquisition"],"created_at":"2024-11-12T07:32:07.309Z","updated_at":"2025-10-05T12:53:14.049Z","avatar_url":"https://github.com/axopy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"=====\npymcc\n=====\n\n``pymcc`` provides access to Measurement Computing USB data acquisition\ndevices, thanks to `PyDAQFlex \u003chttps://github.com/torfbolt/PyDAQFlex/\u003e`_ (which\nhas been copied here so it is not necessary to install it separately).\n\nDependencies\n============\n\n- NumPy_\n- PyUSB_\n\n*Note*: on Windows, you'll need to install a USB backend like libusb. See the\nPyUSB_ README for more information.\n\n.. _NumPy: https://www.numpy.org/\n.. _PyUSB: https://github.com/pyusb/pyusb\n\nSetup\n=====\n\nThis implementation has been verified to work with the USB-1608G, though it\nshould also work with other MCC USB DAQs. As long as the device supports analog\ninput, it should *just work* (TM). Start by installing the package on your\nchosen platform. On Windows, that *should* be all that's needed. On Linux,\nyou'll need to install a udev rule (e.g. create a file\n``/etc/udev/rules.d/61-mcc.rules``) for your device to be accessible by\nnon-root users. Populate the file with a line like the following::\n\n    SUBSYSTEM==\"usb\", ATTR{idVendor}==\"09db\", ATTR{idProduct}==\"0110\", MODE=\"0666\"\n\nReplace the ``idProduct`` attribute with the product ID of your device (the\nexample above is for the USB-1608G). The product ID can be found using\n``lsusb``. After creating the udev rule, you can log out of your account and\nlog back in. After adding the rule, you can reload the rules by logging out and\nback in or using ``udevadm``. Finally, try running the\n``examples/check_mccdaq.py`` script. If no errors occur, the device should be\nset up correctly.\n\nUsage\n=====\n\n``pymcc`` consists of low-level library (PyDAQFlex) as well as a high-level\nwrapper called ``MccDaq``. You can create an ``MccDaq`` object and then poll\nthe device for samples.\n\n.. code-block:: python\n\n    from pymcc import MccDaq\n\n    # sample rate, in Hz\n    samp_rate = 2048\n    # number of samples to fetch per `read()` call\n    samp_per_read = 256\n    # range of channels to read from, zero-indexed, endpoint inclusive\n    ch = (0, 3)\n\n    # create the device\n    dev = MccDaq(samp_rate, samp_per_read, channel_range=ch)\n\n    # start the DAQ so it begins filling the internal buffer\n    dev.start()\n\n    # request samples from the device\n    # this method blocks\n    # it only returns once the requested number of samples have been recorded\n    dev.read()\n\n    # stop the device (call start() again to start over)\n    dev.stop()\n\nThe doc strings in `\u003cpymcc/mccdaq.py\u003e` contain more details about the\nparameters and methods of the ``MccDaq`` class.\n\n**Important Note**: the packet size when reading from the device is 512 bytes\nwhen the device is enumerated as a high-speed USB device. This means for\na 16-bit device (like the USB-1608G), you must request a multiple of 256\n*total* samples per read operation. For instance, if you are recording from one\nchannel (``channel_range=(0, 0)``), you need to set ``samples_per_read`` to\nsome integer multiple of 256. If you're using two channels, you can read 128\nsamples at a time (2 channels * 128 samples/read * 2 bytes/sample = 512\nbytes/read). See Measurement Computing's `Message-based Firmware\nSpecification`_ for details.\n\n.. _Message-based Firmware Specification: https://www.mccdaq.com/pdfs/manuals/Message-based%20Firmware%20Specification.pdf\u003e`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxopy%2Fpymcc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxopy%2Fpymcc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxopy%2Fpymcc/lists"}