py-c3d
======
This is a small library for reading and writing C3D binary files. C3D files are
a standard format for recording 3-dimensional time sequence data, especially
data recorded by a 3D motion tracking apparatus.
Installing
----------
Install with pip::
pip install c3d
Or if you'd like to use the bleeding-edge version, just clone the github
repository and build and install using the normal Python setup process::
pip install git+https://github.com/EmbodiedCognition/py-c3d
Usage
-----
Tools
~~~~~
This package includes a script for converting C3D motion data to CSV format
(``c3d2csv``) and an OpenGL-based visualization tool for observing the motion
described by a C3D file (``c3d-viewer``).
Note for the viewer you need to install `pyglet`.
This can be done by installing the gui extra of py-c3d::
pip install "c3d[gui]"
Library
~~~~~~~
To use the C3D library, just import the package and create a ``Reader`` or
``Writer`` depending on your intended usage
.. code-block:: python
import c3d
with open('data.c3d', 'rb') as handle:
reader = c3d.Reader(handle)
for i, (points, analog) in enumerate(reader.read_frames()):
print('Frame {}: {}'.format(i, points.round(2)))
You can also get and set metadata fields using the library; see the `package
documentation`_ for more details.
.. _package documentation: http://c3d.readthedocs.org
Developer Install
~~~~~~~~~~~~~~~~~
To work on `c3d`, first install `poetry <https://python-poetry.org>`_ and then run::
git clone https://github.com/EmbodiedCognition/py-c3d
cd py-c3d
poetry install
This will create a new virtual environment with all the required dependency and `c3d` in develop mode.
Tests
~~~~~
To run tests available in the test folder, following command can be run from the root of the package directory::
python -m unittest discover .
Test scripts will automatically download test files from `c3d.org`_.
.. _c3d.org: https://www.c3d.org/sampledata.html
Caveats
-------
This library is minimally effective, in the sense that the only motion tracking
system I have access to (for testing) is a Phasespace system. If you try out the
library and find that it doesn't work with your motion tracking system, let me
know. Pull requests are also welcome!
Also, if you're looking for more functionality than just reading and writing C3D
files, there are a lot of better toolkits out there that support a lot more file
formats and provide more functionality, perhaps at the cost of increased
complexity. The `biomechanical toolkit`_ is a good package for analyzing motion
data.
.. _biomechanical toolkit: http://code.google.com/p/b-tk/
Raw data
{
"_id": null,
"home_page": "https://github.com/EmbodiedCognition/py-c3d",
"name": "c3d",
"maintainer": "Leif Johnson",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "leif@cs.utexas.edu",
"keywords": "c3d,motion-capture",
"author": "UT Vision, Cognition, and Action Lab",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/33/cf/0c81bce436d8ace6619d9bf0144b6c9ba01dd95549a7c34ecc2e80724397/c3d-0.5.2.tar.gz",
"platform": null,
"description": "py-c3d\n======\n\nThis is a small library for reading and writing C3D binary files. C3D files are\na standard format for recording 3-dimensional time sequence data, especially\ndata recorded by a 3D motion tracking apparatus.\n\nInstalling\n----------\n\nInstall with pip::\n\n pip install c3d\n\nOr if you'd like to use the bleeding-edge version, just clone the github\nrepository and build and install using the normal Python setup process::\n\n pip install git+https://github.com/EmbodiedCognition/py-c3d\n\nUsage\n-----\n\nTools\n~~~~~\n\nThis package includes a script for converting C3D motion data to CSV format\n(``c3d2csv``) and an OpenGL-based visualization tool for observing the motion\ndescribed by a C3D file (``c3d-viewer``).\n\nNote for the viewer you need to install `pyglet`.\nThis can be done by installing the gui extra of py-c3d::\n\n pip install \"c3d[gui]\"\n\nLibrary\n~~~~~~~\n\nTo use the C3D library, just import the package and create a ``Reader`` or\n``Writer`` depending on your intended usage\n\n.. code-block:: python\n\n import c3d\n\n with open('data.c3d', 'rb') as handle:\n reader = c3d.Reader(handle)\n for i, (points, analog) in enumerate(reader.read_frames()):\n print('Frame {}: {}'.format(i, points.round(2)))\n\nYou can also get and set metadata fields using the library; see the `package\ndocumentation`_ for more details.\n\n.. _package documentation: http://c3d.readthedocs.org\n\nDeveloper Install\n~~~~~~~~~~~~~~~~~\n\nTo work on `c3d`, first install `poetry <https://python-poetry.org>`_ and then run::\n\n git clone https://github.com/EmbodiedCognition/py-c3d\n cd py-c3d\n poetry install\n\nThis will create a new virtual environment with all the required dependency and `c3d` in develop mode.\n\nTests\n~~~~~\n\nTo run tests available in the test folder, following command can be run from the root of the package directory::\n\n python -m unittest discover .\n\nTest scripts will automatically download test files from `c3d.org`_.\n\n.. _c3d.org: https://www.c3d.org/sampledata.html\n\nCaveats\n-------\n\nThis library is minimally effective, in the sense that the only motion tracking\nsystem I have access to (for testing) is a Phasespace system. If you try out the\nlibrary and find that it doesn't work with your motion tracking system, let me\nknow. Pull requests are also welcome!\n\nAlso, if you're looking for more functionality than just reading and writing C3D\nfiles, there are a lot of better toolkits out there that support a lot more file\nformats and provide more functionality, perhaps at the cost of increased\ncomplexity. The `biomechanical toolkit`_ is a good package for analyzing motion\ndata.\n\n.. _biomechanical toolkit: http://code.google.com/p/b-tk/\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A library for manipulating C3D binary files",
"version": "0.5.2",
"split_keywords": [
"c3d",
"motion-capture"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "027e83b04057d01546ae8f62db311769",
"sha256": "16f8edf55c04d2fdd46f59a709253affd8f1d7e0a62995437091d74440d8f278"
},
"downloads": -1,
"filename": "c3d-0.5.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "027e83b04057d01546ae8f62db311769",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 31313,
"upload_time": "2022-12-19T12:20:08",
"upload_time_iso_8601": "2022-12-19T12:20:08.730334Z",
"url": "https://files.pythonhosted.org/packages/c2/4e/84cf2582a0cf0640917a9aa5079135769c668f168650aea7f0a882537749/c3d-0.5.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "cb66e4e7704ebf10aa075bd74e143c10",
"sha256": "b49801237be3b3cede1731a5058f48a96c0bd02339ef25e4e384a4648e23e580"
},
"downloads": -1,
"filename": "c3d-0.5.2.tar.gz",
"has_sig": false,
"md5_digest": "cb66e4e7704ebf10aa075bd74e143c10",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 30798,
"upload_time": "2022-12-19T12:20:11",
"upload_time_iso_8601": "2022-12-19T12:20:11.017311Z",
"url": "https://files.pythonhosted.org/packages/33/cf/0c81bce436d8ace6619d9bf0144b6c9ba01dd95549a7c34ecc2e80724397/c3d-0.5.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-19 12:20:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "EmbodiedCognition",
"github_project": "py-c3d",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "c3d"
}