Add Topics to a registry with Python API - python

I need some help with the Google IoT Core API for Python...
For now I'm able to create and delete a registry as needed but, I need to also edit the registry to add more topics to it.
I researched a lot the documentation but no luck, maybe someone here have a similar issue or request? I need to be able to add Topics to a existent registry with active devices in it (no delete and re-creation possible?)
Any help is Greatly appretiated
EDIT: I found this reference: Link to API Reference
But I cant issue the command correctly :( a example could be usefull

You may use the google SDK to edit the registry and wrap the Shell command in a python script that format the topics, the proyect name, etc... the shell comand has this sctructure:
gcloud iot devices update {DEVICE_ID}
--project={PROJECT_ID}
--region={REGION}
--registry={REGISTRY_ID}
For more information of the shell comand check the documentation:
google registry docs

Related

FirebaseMessaging.getToken() using python

I'm building a kivy app and almost got firebase cloud messaging working using the pyfcm
package from pypi.
What i'm stuck on is how to get the "registration token" that the firebase SDK creates on app install so that i have a registration token to send push notifications to.
There seems to be lots of info scattered around the net in regards to doing it using some other language other than "python", but python is all i know so i'm trying to work it out for that language.Any one have tips on how i go about that please ?
I can't find a python package that has the FirebaseMessaging.getToken() in it which is what the firebase documentation keeps referring to, so i'm lost and my brain is going mushy now due to researching this for hours and hours so far :)
any help appreciated
To answer my own question.
For those wondering the same question as i had. I came across this package https://github.com/Fox520/pushyy
In that package the guy has incorporated the ability to get the device token and also update the token when it changes. It takes a little manipulating to get the package to work properly with the latest gradle version but it is do able.
There doesnt seem to be a direct "python" method as such to get the token so using this package makes use of the required java and python code to achieve the task. Using this and using pyfcm from pypi to send messages, i'm now able to send firebase push notifications from my kivy app :)

python elasticsearch error in modifying and adding doc during remote access

Hello I have some questions..
I developed django website on Windows 10 and changed OS to ubuntu for publishing
On Windows, there were no problems but problems appeared on ubuntu
My website uses a remote access on EleasticSearch and also uses elasticsearch, elasticsearch_dsl python lib.
There was no error searching the document in index from an external connection, but an error occurs when adding update_by_query or a new document.
There are no other settings except for modifying network.host in elasticsearch.yml to 0.0.0.0
Do I need special permissions or other settings to modify or create documents from outside?
I am so stressed because of this.
If anyone knows, I'm sure you're busy, but please give me a detailed explanation or a link.
Thank you.

How to find the secret hash stored on a Python server?

I am trying to configure the ChatterBot extension on the LiveHelperChat platform. The official instructions include the following step:
Edit extension settings in lhcchatbot/settings.ini.php
set your
"secret_hash"
"host"
Where do I find the secret_hash value? I am using shared hosting which is already running the Chatterbot application. Thank you in advance.
I'm not familiar with LiveHelperChat specifically. However, services like this will often generate a hash for your account. Look for this in your profile or account settings. Otherwise, you will need to contact the service directly for any questions.

Accessing Google Keep data through script?

I am trying to create a script that get the data from a google keep list I was thinking Google Takeout might do part of what I want but I cannot find a API to automate the downloads. Does anyone know a way to grab this data via script (python/bash) so that I can easily extract what I need?
I am not sure if it is allowed or not, but you could login via a BeautifulSoup session and navigate to the site you wish to parse.
I've written a quite similar script for Python, you can find it at github, i thinkt it's pretty self-explanatory but if you should require any more help feel free to ask.
You could use selenium library for that.
Used the framework to scrape the keep.google.com webpage for all the notes and export them to a csv file
This Might be helpful, i made the script to backup my notes to my computer
https://github.com/darshkpatel/GoogleKeep_Backup
There is no API for Google Keep at this time. I don't think your going to be able automate Google Takeout either the best you will be able to do would be run it manually then create your own application to import it were ever it is you want to import it to.
Here is an automated solution for this question: a link!
Or just execute these commands in the terminal:
git clone https://github.com/Dmitry9/exportKeep.git;
cd exportKeep;
npm install;
npm run scrape;
After all dependencies installed (could take a minute or so) chrome instance will navigate to the sign-in page. After posting credentials it will scroll to the bottom of the window to force the browser to load all of the notes inside DOM. Inspecting the output of the terminal you will find a path to the saved JSON file.
In the meanwhile there is an API, see here: https://developers.google.com/keep/api/reference/rest
Also, there is a python library that implements this API (I'm not the author of the library): https://github.com/kiwiz/gkeepapi

Python Google Checkout Notification API

I am attempting to work with Google Checkout on Google App Engine. Currently, I am writing everything in Python and have the checkout process working. I am having some difficulty getting the notifications of processed orders functioning. I've been searching for Python examples, but thus far have been unsuccessful. Programming directly off of the documentation provided by Google, I have not been able to get my notifications working either. Would anyone happen to have a framework/demo Google Checkout Notification example in Python?
The chippyshop source has a nice example of a python Google Checkout implementation that should get you moving in the right direction.
UPDATE: I actually ended up needing to do this myself so I extended the example linked above and turned it into a reusable RequestHandler for use on GAE.
You can find the source and examples on github which should serve as a good starting point for any others following this path.

Categories

Resources