{ "info": { "author": "Kacper Kubkowski", "author_email": "kkubkowski@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3" ], "description": "## **sysfsgpio**\n\nPython GPIO library, using Linux `sysfs` interface. This is a fork of `trimarlib-sysfsgpio`\nproject, originally hosted [here](https://dsl2.trimar.org/pythons-ll/sysfsgpiolib).\n\n### Getting started\n\nThese instructions will get you a copy of the project on your local machine for development and testing purposes. \nSee [Deployment](#deployment) for notes on how to deploy the project on a live system.\n\n#### Prerequisites\n\nThe build process requires some basic development tools:\n\n* `make` - GNU Make program, either for *nix or Windows system, used to execute build and test targets\n* `git` - used not only to clone the repository, but also in auto-versioning (see [Versioning](#versioning))\n* `python3`\n\nTwo standard Python packages are used for build and installation steps:\n\n* `setuptools`\n* `wheel`\n\nTesting depends on `nose` package - this dependency is defined in `setup.py` and should be satisfied automatically. \nThe library itself has no dependencies on any third-party packages.\n\n#### Building and releasing\n\nInvoking `make all` (default target) executes test-suite and prepares archives for distribution.\nIt is done in two steps:\n\n1. query Git repository for tags (`git describe` command) to determine current version and generate \n`version.py` file,\n2. invoke Python interpreter passing `setup.py` script to prepare source and wheel distributions.\n\nThe Python interpreter invoked by the `Makefile` defaults to `python` when running on Windows machine and\n`python3` otherwise. In both cases it is possible to override it passing a `PYTHON` variable to the command,\n e.g. `make all PYTHON=python3`.\n\nThe release process is automated and based on GitLab CI/CD environment, see [configuration file](.gitlab-ci.yml).\n\n#### Testing\n\nTest source files are located in `sysfsgpio/tests` directory. Testing is based on `unittest` Python \nbuilt-in package, `nose` is used as the test runner. \nThe `Makefile` defines `test` target which runs the test suite. \n\nTesting is divided into two steps:\n\n* utility functions testing - performs unit tests of all ancillary features. Those tests are\nplatform independent (i.e. shall pass on either a *nix or a Windows machine);\n* `Pin` testing - performs unit tests of `Pin` class. Those tests depend on the `sysfs` Linux \nfilesystem and are skipped when running on Windows machine. \n\n### Deployment\n\nThe library is not intended to be used in a standalone configuration - the primary purpose is to be used\nby higher-level applications, which should define it as a dependency. However it is perfectly correct\nto install it manually using `pip`. \nPlease keep in mind that there are some platform dependent steps needed to be taken before the\npins are accessible without super-user privileges. The package designates 3 entry points (accessible\nas command-line tools) to ease-up the set-up process (the scripts are developed and confirmed to be\nworking on Orange Pi platform running Armbian distribution). These entry points are:\n\n* `sysfsgpio-install-service` - this command installs and enables `systemd` `gpio-exporter` service,\nwhich exports all free pins available on the Orange Pi SBC at system boot;\n* `sysfsgpio-install-rules` - this command install `udev` rules file which ensures that each exported\npin has `rw` mode available to `staff` group;\n* `sysfsgpio-install` - this one invokes the above to reduce number of commands needed to set-up system.\n\nEach of the commands may be invoked with `--force` switch to overwrite existing files - without that\nswitch commands fail printing proper message. \n\n> **NOTE:**\n> The user needs to become member of the `staff` group to use the pins without super-user rights.\n\n### Versioning\n\nThe project is versioned using a simple pattern based on repository tagging feature. See [Makefile](Makefile)\nfor implementation details, for versions available see \n[tags on this repository](https://dsl2.trimar.org/pythons-ll/sysfsgpio/tags).\n\n### Usage\n\nSee docstrings for API documentation.\n\n* Example of using pin PA21 as input:\n\n```python\nfrom sysfsgpio import Pin\n\n\ndef callback(sender, value):\n print('pin={}, value={}'.format(sender, value))\n\n\npin = Pin('PA21')\npin.direction = 'in'\npin.register_callback(callback)\npin.enabled = True\n```\n\n* Example of using pin PA20 as output:\n\n```python\nfrom sysfsgpio import Pin\nimport time\n\npin = Pin('PA20')\npin.direction = 'out'\nfor i in range(10):\n time.sleep(.1)\n pin.value = pin.value ^ 1\n```\n\n* Example of using pin PA7 as inverted output to generate timed pulses:\n\n```python\nfrom sysfsgpio import Pin\n\npin = Pin('PA20')\npin.direction = 'out'\npin.configuration = dict(ontime=3.33, offtime=6.67, repeat=3)\npin.enable()\n```\n\n### License\n\nThis software is licensed under the MIT License - see [LICENSE](LICENSE).\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/kkubkowski/sysfsgpiolib", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "sysfsgpio", "package_url": "https://pypi.org/project/sysfsgpio/", "platform": "", "project_url": "https://pypi.org/project/sysfsgpio/", "project_urls": { "Homepage": "https://gitlab.com/kkubkowski/sysfsgpiolib" }, "release_url": "https://pypi.org/project/sysfsgpio/0.3.0/", "requires_dist": null, "requires_python": "", "summary": "Sysfs GPIO utility", "version": "0.3.0" }, "last_serial": 4338667, "releases": { "0.2.0rc5": [ { "comment_text": "", "digests": { "md5": "b694980ba0b1af946d286292823f68a4", "sha256": "22fe764b9052aab405cd4cc262de55a2b6d5780ae493eb61c18c940d194e87c3" }, "downloads": -1, "filename": "sysfsgpio-0.2.0rc5-py3-none-any.whl", "has_sig": false, "md5_digest": "b694980ba0b1af946d286292823f68a4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 11474, "upload_time": "2018-10-03T23:32:22", "url": "https://files.pythonhosted.org/packages/a2/a6/e4f057364ed37020f407c0e1749b929e635cf47a41fa4bf02fb365be364d/sysfsgpio-0.2.0rc5-py3-none-any.whl" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "dd20b6677f312735aaba906fac979ee9", "sha256": "270d56a90b31213ea69b98397e13d6fe107bb7fbf3e50209ceae04c72215e3e5" }, "downloads": -1, "filename": "sysfsgpio-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "dd20b6677f312735aaba906fac979ee9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10977, "upload_time": "2018-10-04T01:07:03", "url": "https://files.pythonhosted.org/packages/f9/79/2d13e67e5efb6c00e54d23f815ca26e2f16058d94129efcf6f58af280b19/sysfsgpio-0.3.0-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dd20b6677f312735aaba906fac979ee9", "sha256": "270d56a90b31213ea69b98397e13d6fe107bb7fbf3e50209ceae04c72215e3e5" }, "downloads": -1, "filename": "sysfsgpio-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "dd20b6677f312735aaba906fac979ee9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 10977, "upload_time": "2018-10-04T01:07:03", "url": "https://files.pythonhosted.org/packages/f9/79/2d13e67e5efb6c00e54d23f815ca26e2f16058d94129efcf6f58af280b19/sysfsgpio-0.3.0-py3-none-any.whl" } ] }