Skip to main content

A package for accessing termux-api

Project description

pimux

Build Status

PIMUX is here, made with :heart:

What is pimux?

pimux is a python module created by me, to access the termux-api(hardware and software api). To ease the access of these beautiful api's which can be really useful for IOT projects deploying using your own android phone.

Why to use pimux?

For every pythonist and enthusiast pimux can really ease hardware and software access through termux-api.

Special thanks

I would like to thank every developer before me who made this beautiful language(python),termux-api, termux, os(linux), and all others, on whose contributions I have been able to make this.

This project is originally located at pimux

Table of Contents

Requirements

  • Termux app
  • Termux-api (both app and package)
  • Python

Installation

🚀  To install in your local machine follow the steps below:

Method-1

You can always get the latest version of pimux maintained here in the github.

To get the latest feature:

  • Clone this repo to your local machine(termux) using https://github.com/azwyane/pimux.git

Goto to your terminal and type:

git clone https://github.com/azwyane/pimux.git

Now add this to site packages by first building by being where the setup.py is:

$ python3 setup.py sdist bdist_wheel

$ python3 -m pip install -e <path to pimux main dir>

Finally, you have it installed.

Method-2

Install by pip

The stable version is available in the Pypi, which you can download by:

$ python3 -m pip install pimux

Run the project

Now to run the pimux type in your terminal:

$ python
>>> from pimux import function

>>>help(function)
CLASSES
    builtins.object
        camera
        clipboard
        misc
        tts
        volume
        wifi

    class camera(builtins.object)
     |  The class camera is for fetching
     |  camera info or taking picture with the
     |  camera on the android.
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  camera(self)
     |      This method returns camera info
     |      of the android device.It takes no argument.
     |
     |  takephoto(self, cid=0, saveas='newimg.jpeg')
     |      This method is for taking picture from the
     |      available camera on the device.
     |      It takes two argument:
     |      cid : camera id in int default(0)
     |      saveas: output file name in str format default("newimg.jpeg")
     |
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
>>> v=function.misc()

>>>help(v)
class misc(builtins.object)
 |  The class misc has miscellaneous methods
 |  of termuxa-pi available.
 |  Available methods are :
 |  battery,
 |  brightness,
 |  vibrate,
 |  contactlist,
 |  torch,
 |  downloadFile
 |
 |  Methods defined here:
 |
 |  __init__(self)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  battery(self)
 |      This method return battery status info.
 |
 |  brightness(self, Brightness)
 |      Set the brightness of your device.

>>>v.vibrate()    This command vibrates your device if not in silent.
'Done'

>>>v.brightness(Brightness=100) This command sets the brightness to 100.
'Done'

Also

$ python
>>>from pimux import Sensors

 >>>help(Sensors)
 CLASSES
    builtins.object
        sensor

    class sensor(builtins.object)
     |  This is a class that lets to view
     |  sensor data directly from your android device.
     |
     |  Methods defined here:
     |
     |  __init__(self)
     |      Initialize self.  See help(type(self)) for accurate signature.
     |
     |  allsensors(self)
     |      Method to print sensor data all at once.
     |      WARNING: Can cause over load to the device.
     |
     |  cleanup(self)
      Performs cleanup releasing sensor resources.
     |
     |  delay(self, sensorname='', delayvalue=3000)
     |      Method to delay time in milliseconds
     |      on receiving every new sensor update.
     |      Arguments:
     |      sensorname=""
     |      delayvalue=3000(default)(delayed by 3 sec)
     |
     |  listSensor(self)
     |      lists available sensors on the device.
>>> s=Sensors.sensor()
>>>help(s)
class sensor(builtins.object)
 |  This is a class that lets to view
 |  sensor data directly from your android device.
 |
 |  Methods defined here:
 |
 |  __init__(self)
 |      Initialize self.  See help(type(self)) for accurate signature.
 |
 |  allsensors(self)
 |      Method to print sensor data all at once.
 |      WARNING: Can cause over load to the device.
 |
 |  cleanup(self)
 |      Performs cleanup releasing sensor resources.
 |
 |  delay(self, sensorname='', delayvalue=3000)
 |      Method to delay time in milliseconds
 |      on receiving every new sensor update.
 |      Arguments:
 |      sensorname=""


>>>s.listSensor()
'{  "sensors": [ ........]}'

Features

It is a side project of making use of android sensors and IOT projects. It has the feature of termux-api which can be easily used with python projects.


Contributing

Step 1

  • Option 1

    • 🍴 Fork this repo!
  • Option 2

    • 👯 Clone this repo to your local machine using https://github.com/azwyane/pimux.git

Step 2

  • HACK AWAY!

Step 3


Found a bug? Missing a specific feature?

Feel free to file a new issue with a respective title and description on the the azwyane/pimux repository. If you already found a solution to your problem, I would love to review your pull request!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pimux-2.0.1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pimux-2.0.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file pimux-2.0.1.tar.gz.

File metadata

  • Download URL: pimux-2.0.1.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for pimux-2.0.1.tar.gz
Algorithm Hash digest
SHA256 d3f59d7ee994f3ba7a13cc01c4f4b2d2b084ec623a5a3f8b13bddb0c1f58480b
MD5 0e0120a6e505dd359da234c7e009d973
BLAKE2b-256 6d10ce23084eac89f306d5596a6ac1d6108bca6fd7a77763394c7ef74da4153d

See more details on using hashes here.

File details

Details for the file pimux-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: pimux-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for pimux-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2ad974037f5e8ad7eae3cc48831bda2f9d94b9b15dae4474f16eb4dce2090af8
MD5 531c1a736c9638faa5cdd734b9e8bea3
BLAKE2b-256 ad98a18dd2df67e8bee731c85739354f0c57da9ee91c042164bc6f3590d4ac8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page