Sandbox=False breaks OAuth in Evernote Application - python-3.x

I have this app that I've built, which scrapes recipes and adds them to evernote. Link here. In the EvernotePy folder, there is a python3 script called Add_to_Evernote.py that interfaces with the API. When I have Sandbox = True, then it works like normal, but when I turn Sandbox = False it breaks when trying to call the function client.get_authorize_url(). I just received an email today saying that my API-Key got activated for their production servers, so Idk what' wrong.
The error I'm getting is:
Traceback (most recent call last):
File "./EvernotePy/Add_to_evernote.py", line 69, in <module>
webbrowser.open(client.get_authorize_url(request_token))
File "/usr/local/lib/python3.8/dist-packages/evernote3-1.25.0-
py3.8.egg/evernote/api/client.py", line 58, in get_authorize_url KeyError: 'oauth_token'
What do I have to do?

This happened to me too,happened it was because though I changed the sandbox to FALSE I didn't redeploy the app. so make sure after changing the sandbox value the app is redeploy so the changes takes effect

Related

How to get a YAML file containing api keys to work in django?

I'm new to django and I am trying to make an API call to ebay when a user clicks a button, using ebay python SDK. There is a YAML file inside my project which contains the api keys. In my app, I have a python file that contains a function that makes the api call. When I run the function that python file separately, it works fine and finds the YAML file no problem. But when I try to run that same function from views.py, it gives me an error that says - config file 'ebay.yaml' not found. Can anyone please help me with this as I have no idea what's wrong... Do I have to do anything special when running the API call through django, besides just having a YAML file in the same direcotry?
Your ebay.yaml file should be in the same directory as manage.py in order to work properly.
Here is an example:
folder/
ebay.yaml
manage.py

why is Airtable API and Python not workinng?;

I am new to Python and APIs and I am trying to get some data from the API. More specifically I am trying to get some tables from a base. I am following this GitHub repository's instructions:
https://github.com/bayesimpact/airtable-python
So far I have created a virtual environment called mypyth and in there I have initiated a script called get_data.py
This is what my script looks like (I have written API KEY instead of my real api key:
import requests
from airtable import airtable
at = airtable.Airtable('appa3r2UUo4JxpjSv', 'API KEY')
at.get('Campaigns')
Now these are the commands I run on the console:
(mypyth) PS C:\Users\andri\PythonProjects\mypyth> py do_get_account.py
Traceback (most recent call last):
File "do_get_account.py", line 2, in <module>
from airtable import airtable
ModuleNotFoundError: No module named 'airtable'
(mypyth) PS C:\Users\andri\PythonProjects\mypyth>
Does anyone understand why I get this error? Perhaps there is a step I havent followed? Thanks in advace for any answer

Google Cloud Speech: Insufficient tokens for quota group

I'm getting the following error when I try to process a single 10 minute audio file. I'm just getting started with Google Cloud products and so I'm the only person accessing this resource. How could I have exceeded the quota? The quota is set at its default values and I dont think that I am anywhere near the limits. Is there another reason for this?
I'm using the transcribe_async.py demo code. The audio files (22MB) are stored in a bucket and being accessed through a uri audio source, otherwise the demo code is unchanged.
Waiting for server processing...
Traceback (most recent call last):
File "/Users/kevin/Downloads/python-docs-samples-master/speech/api-client/transcribe_async.py", line 116, in <module>
main(args.speech_file)
File "/Users/kevin/Downloads/python-docs-samples-master/speech/api-client/transcribe_async.py", line 93, in main
response = service_request.execute()
File "/Users/kevin/anaconda2/lib/python2.7/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Users/kevin/anaconda2/lib/python2.7/site-packages/googleapiclient/http.py", line 840, in execute
raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 429 when requesting https://speech.googleapis.com/v1beta1/operations/596739883637256586?alt=json returned "Insufficient tokens for quota group and limit 'Default_GroupCLIENT_PROJECT-100s' of service 'speech.googleapis.com', using the limit by ID '764086051850'.">
I've been having this problem too. I'm still trying to understand more about how the GCP credentials generally, but in the meantime I think I've figured out enough to make this work. I'm also using the example Python scripts. I followed the instructions at this page.
The gist of it is:
Create a "private key" using the Credentials page of the Google Cloud Console. It's really more than simply a "key", it's a (JSON) config file with many values such as 'type', 'project_id', and so forth.
Download that file and save it somewhere. I put mine in the ~/.config/gcloud/ folder which seems to also have a lot of relevant config files.
Set the environment variable GOOGLE_APPLICATION_CREDENTIALS to point at that file, i.e. export GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json
There's also a way to do this from within the code shown on that page, but the environment variable route made more sense for me.
It seems that the process above sets the "default" credentials, and in the example code those are fetched on line 39.
There's additional documentation on the Google sites, I found the one on Google Cloud Storage authentication to be the most useful so far.
I think you get error because use Application Default Credentials specified by the command "gcloud auth application-default login". Try to create a Service Account for your project. Save the JSON key in the private folder. Then specify the path to the key, like this:
var speech = require('#google-cloud/speech')({
keyFilename: '/path/to/keyfile.json'
});
It's important, your project should be enabled billing. To enable billing, you can activate the Free Trial period

Getting a server error (500) as soon as File Sync is used in Xamarin Forms app

Sample Source Code:
https://drive.google.com/file/d/0BzYXG8uD6JT3ai1SN3lfRE5oNWs/view
Background:
Creating a Xamarin Forms app with Azure Data Sync with Azure app Services as backend. Using Dot Net based Managed backend on azure.
My Issue:
My app works fine in offline mode & I can click on sync to sync all offline data to azure.
If now I need to also incorporate File Syncing so I can use files in my app in offline mode & also sync them to azure, I can use Azure File Sync. I am following the steps given here:
https://azure.microsoft.com/en-in/documentation/articles/app-service-mobile-xamarin-forms-blob-storage/
In the attached sample code, If you comment the file sync related code in AzureHelper.cs at line numbers 44, 46 & 74 and uncomment the data sync call at Line number 41 it works as expected.
If you now comment the code on Line Number 41 & uncomment the code for for File Sync at 44, 46, 74 in the same file & run the code, you get a 500 error. Moreover this 500 error is shown in a Box in Visual Studio as an unhandlled exception, where as I have catch block used at all possible erroneous locations. Because of this it has become incredibly difficult to catch the source of this error.
This is what led me to believe that the error is somewhere in File Sync changes, just can't figure out what block?
Can someone please shed some light on this?
Thanks
ST
Either you need to create storage controller for all, or modify the
public sealed class ReportSwiftEntityDataFileSyncTrigger : IFileSyncTrigger, IDisposable
{
private async void OnStoreOperationCompleted(StoreOperationCompletedEvent storeOperationEvent)
{
if (storeOperationEvent.Operation.TableName!="Report")
{
return;
}
}
}
class as shown to ignore any cases where class name is not where you need to use the storage controller.
Hope this helps.

Rally sandbox queries fail that work on rally1

I have an app that has working WSAPI queries to populate a cardboard and grid (works on rally1.rallydev.com), and it was even working 2 weeks ago in the rally sandbox (sandbox.rallydev.com). Now, when I run the app in the sandbox environment, I get network errors saying the get requests from sandbox.rallydev.com failed:
Failed to load resource
https://sandbox.rallydev.com/slm/webservice/v2.0/PortfolioItem...
but when I click on the link that failed, it shows the data I requested!
{"QueryResult": { "_rallyAPIMajor": "2", ...
Any ideas what is going on here?
This error:
Uncaught Ext.JSON.decode(): You're trying to decode an invalid JSON String:Failed to load resource
may come up if you have
parentRepos:"{{{parents}}}"
in
Rally.launchApp('{{className}}', {
name:"{{name}}",
parentRepos:"{{{parents}}}"
});
in App.html
Please comment it out
Note: commenting out or deleting this line must be done in App.html under templates folder. It does not help if it is done in App.html deploy folder because the line gets regenerated from the template(assuming you are using 'grunt deploy' command).

Resources