Commit Graph

58 Commits

Author SHA1 Message Date
Fabio Manganiello 59c693d6a0
[#394] All `manifest.yaml` converted to `manifest.json`.
YAML isn't part of the Python standard library, while JSON is.

If we want `setup.py` to dynamically parse the available integration
manifest files in order to populate the extra dependencies, then it's
better to rely on a JSON format for manifest files - the parser is part
of the standard library and it doesn't require the user to install
`pyyaml` before `platypush`.
2024-05-17 02:21:57 +02:00
Fabio Manganiello c77cf2c98b
[#372] Removed Google Fit plugin.
continuous-integration/drone/push Build is passing Details
The Fit API has (unfortunately) been deprecated by Google with no
alternatives - the new Health Connect API is only available on Android
devices.

Other Google APIs don't seem to be affected by the refresh token issue
either, so this should hopefully close that issue too.

Closes: #372
2024-05-16 02:42:54 +02:00
Fabio Manganiello 15b1c1f3c0
[#398] Replaced `GoogleDriveFile` response with `GoogleDriveFileSchema`.
continuous-integration/drone/push Build is passing Details
2024-05-13 01:25:33 +02:00
Fabio Manganiello 6003b205c8
[#398] Removed `TranslateResponse`. 2024-05-13 01:25:33 +02:00
Fabio Manganiello eb47f9ded0 [#351] Merged `google.pubsub` plugin and backend.
Closes: #351
2024-01-19 02:14:49 +00:00
Fabio Manganiello 1323156838
Fixed `google.credentials` script order of arguments in the docstring.
continuous-integration/drone/push Build is passing Details
2024-01-19 01:48:33 +01:00
Fabio Manganiello 6775208b2e Fixed minor docstring typo. 2024-01-18 23:31:27 +00:00
Fabio Manganiello f9bd5b3abc [#350] Merge `google.fit` backend and plugin.
Closes: #350.
2024-01-18 23:31:27 +00:00
Fabio Manganiello e3c04d9316 Fixed bullet points indentation in Google plugins docstrings. 2024-01-18 23:31:27 +00:00
Fabio Manganiello e022712b7b [Google] Updated authorization flow for Google plugins.
The new authorization flow also requires the user to input a code
returned on the browser's authorization page.

Since the Google authentication libraries seem to use a simple `input()`
to read this code, things are likely to fail quite badly if Platypush is
run in non-interactive mode - e.g. through a systemd service or in a
Docker container.

Thus we need to go with Google's automatic flow only if `DISPLAY` or
`BROWSER` are set (thus the interactive flow can proceed), and throw an
`AssertionError` with the command to execute if no display/browser are
detected.
2024-01-18 23:31:27 +00:00
Fabio Manganiello 31de917631 [Google] Updated documentation of Google plugins.
Expanded explanation of the desktop vs. headless authentication process
and where the credential files are supposed to be copied if the user
opts for a non-automatic authentication flow.
2024-01-18 23:31:27 +00:00
Fabio Manganiello efdb63443d
Renamed the `youtube` plugin.
From `google.youtube` to `youtube`.
2023-11-04 00:07:29 +01:00
Fabio Manganiello 1e93af86f4
Fixed some broken docstring references.
continuous-integration/drone/push Build is passing Details
2023-10-09 01:33:45 +02:00
Fabio Manganiello 2aefc4e5c8
Several improvements for the Google integrations.
1. Improved documentation. Every plugin now reports the exact steps to
   get the integration up and running with the right API scopes.

2. All Google plugins now have a standard process to get (and reuse) the
   client secret. Except for PubSub, Translate and Maps (which have
   their own flows), all the Google plugins now read the client secrets
   from `<WORKDIR>/credentials/google/client_secret.json` by default.

3. Black/LINT for some of those plugins, which hadn't been touched in a
   while.

4. The interface to pass API scopes is now leaner. It's now possible to
   pass a scope directly as e.g. `calendar.readonly` rather than
   `https://www.googleapis.com/auth/calendar.readonly`.

5. Improved the logic to retrieve the right scope tokens file. If e.g.
   an integration requires the role `A`, and a credentials file exists
   for the roles `A` and `B`, then this file will be used rather than
   prompting the user to authenticate again.
2023-10-01 15:37:20 +02:00
Fabio Manganiello 966a6ce29e
httplib2 should be an explicit dependency for Google integrations.
Plus, some misc LINT/Black chores.
2023-10-01 00:52:59 +02:00
Fabio Manganiello c3337ccc6c
[#311] Docs deps autogen sphinx plugin.
continuous-integration/drone/push Build is passing Details
Added an `add_dependencies` plugin to the Sphinx build process that
parses the manifest files of the scanned backends and plugins and
automatically generates the documentation for the required dependencies
and triggered events.

This means that those dependencies are no longer required to be listed
in the docstring of the class itself.

Also in this commit:

- Black/LINT for some integrations that hadn't been touched in a long
  time.

- Deleted some leftovers from previous refactors (deprecated
  `backend.mqtt`, `backend.zwave.mqtt`, `backend.http.request.rss`).

- Deleted deprecated `inotify` backend - replaced by `file.monitor` (see
  #289).
2023-09-24 17:00:08 +02:00
Fabio Manganiello 761f2768cb
[#316] Added RPM dependencies.
continuous-integration/drone/push Build is passing Details
2023-09-21 23:20:06 +02:00
Fabio Manganiello 98e9abde18
Extended manifest files with Python system packages (if available).
continuous-integration/drone/push Build is passing Details
- If a Python optional dependency is available as a system package on
  the target system, try and install it that route rather than pip. It's
  usually faster and it decreases the risk of breaking system packages.

- Added support for apk dependencies in manifest files. This brings the
  number of distros officially supported by all the extensions to four:

  - Alpine
  - Arch
  - Debian
  - Ubuntu
2023-08-16 22:43:51 +02:00
Fabio Manganiello 66981bd00b
Updated email addresses and black'd some old source files. 2023-07-22 23:02:44 +02:00
Fabio Manganiello 56dc8d0972
Migrated the webapp to Tornado.
It was just too painful to find a combination of versions of  gunicorn,
gevent, eventlet, pyuwsgi etc. that could work on all of my systems.

On the other hand, Tornado works out of the box with no headaches.

Also in this commit:

- Updated a bunch of outdated/required integration dependencies.
- Black'd and LINTed a couple of old plugins.
2023-05-08 02:06:45 +02:00
Fabio Manganiello 64c402b1c0 [#115] Added `google.maps.get_travel_time` method 2021-10-16 22:35:37 +02:00
Fabio Manganiello 3bfc5b83ef Moved to manifest files for describing plugins and backends and their dependencies 2021-09-16 17:53:40 +02:00
Fabio Manganiello 18e99c6f12 Added new Google Fit scopes for sleep and heart rate read 2021-05-10 21:21:03 +02:00
Fabio Manganiello 2a78f81a7b Major LINT fixes 2021-04-05 00:58:44 +02:00
Fabio Manganiello 2e6388f6f4 ReadTheDocs fixes 2020-08-24 01:14:40 +02:00
Fabio Manganiello 590d416682 Google Translate API supports a maximum of 2000 characters per API call.
Therefore it's a good idea to split the input text/html.
2020-07-05 21:04:54 +02:00
Fabio Manganiello a4824a4e95 Google Cloud Translate API works through GOOGLE_APPLICATION_CREDENTIALS env variable 2020-07-02 02:24:54 +02:00
Fabio Manganiello 46515020cf Added Google Translate plugin 2020-07-02 02:07:57 +02:00
Fabio Manganiello 4c3140c9b5 Fixed docs 2020-01-09 23:40:59 +01:00
Fabio Manganiello f2de1015a8 Fixed doc URL 2020-01-09 22:24:15 +01:00
Fabio Manganiello e709908d7e Added Google Drive plugin - closes #91 2020-01-09 22:07:03 +01:00
Fabio Manganiello bc7c248f72 Added Google Pub/Sub integration 2019-12-30 09:33:26 +01:00
Fabio Manganiello d38746d278 Moved imports for extra dependencies inside the methods where they are actually used 2019-12-01 23:35:05 +01:00
Fabio Manganiello 9c4646bed5 Fixed documentation and added missing docs to the index 2019-07-16 20:28:00 +02:00
Fabio Manganiello 9305f86d0c New media webplugin WIP 2019-06-24 01:01:08 +02:00
Fabio Manganiello eb40024c53 Only initalize credentials map in Google plugins if some scopes are required 2019-03-18 01:06:10 +01:00
Fabio Manganiello 87d63d7cb3 Added Google Fit backend 2019-03-16 01:22:42 +01:00
Fabio Manganiello 55c0896b31 Refactored Google plugins with support multiple scopes and a simpler API and added Google Fit plugin 2019-03-14 01:12:39 +01:00
BlackLight e89046f12a Added max_results to YouTube search 2018-12-12 23:03:17 +01:00
BlackLight 679cad53b5 Added YouTube plugin that leverages the YouTube API; Replaced OMXPlayer search references to the old HTML parser withe new YouTube plugin 2018-12-12 22:33:41 +01:00
Fabio Manganiello 0dafa16958 Added get_elevation_from_latlng method to Google Maps plugin 2018-07-25 12:01:27 +00:00
Fabio Manganiello cfda6e019c Don't wrap events in a Response object twice 2018-07-06 02:55:36 +02:00
Fabio Manganiello 66d78c8615 [#61] Plugins actions refactoring
- Using `@action` annotation to indicate methods that are allowed to be
executed as actions

- The output and errors of an action are automatically wrapped into a
`Response` object without any response build required on the plugin side
2018-07-06 02:08:38 +02:00
Fabio Manganiello 54dcb2cba3 Documentation v0.1 2018-06-23 01:00:43 +02:00
Fabio Manganiello 4da74b1096 Refactored logging submodule 2018-06-06 20:09:23 +02:00
Fabio Manganiello bc3e100217 New general-purpose plugin for managing multiple calendar + support for ICal format 2018-05-30 15:59:10 +02:00
Fabio Manganiello a8015addbf Only take the first component of formatted_address 2018-05-23 08:06:52 +00:00
Fabio Manganiello 3ce6cf8b41 Just use formatted_address from the Google geocode response instead of considering all the cases of address formatting 2018-05-22 21:43:21 +00:00
Fabio Manganiello 2c7880874d Logging geocode response 2018-05-22 21:34:06 +00:00
Fabio Manganiello 9923742e74 Prevent plugins from breaking in case of concatenations with None elements 2018-05-14 19:06:11 +02:00