• Stars
    star
    612
  • Rank 73,287 (Top 2 %)
  • Language
    Python
  • License
    Other
  • Created over 12 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Evernote SDK for Python

Evernote SDK for Python

Evernote API version 1.28

This SDK is intended for use with Python 2.X

For Evernote's beta Python 3 SDK see https://github.com/evernote/evernote-sdk-python3

Overview

This SDK contains wrapper code used to call the Evernote Cloud API from Python.

The SDK also contains a sample script. The code demonstrates the basic use of the SDK for single-user scripts. Real web applications must use OAuth to authenticate to the Evernote service.

Prerequisites

In order to use the code in this SDK, you need to obtain an API key from http://dev.evernote.com/documentation/cloud. You'll also find full API documentation on that page.

In order to run the sample code, you need a user account on the sandbox service where you will do your development. Sign up for an account at https://sandbox.evernote.com/Registration.action

In order to run the client client sample code, you need a developer token. Get one at https://sandbox.evernote.com/api/DeveloperToken.action

Getting Started - Client

The code in sample/client/EDAMTest.py demonstrates the basics of using the Evernote API, using developer tokens to simplify the authentication process while you're learning.

  1. Open sample/client/EDAMTest.py

  2. Scroll down and fill in your Evernote developer token.

  3. On the command line, run the following command to execute the script:

    $ export PYTHONPATH=../../lib; python EDAMTest.py

Getting Started - Django with OAuth

Web applications must use OAuth to authenticate to the Evernote service. The code in sample/django contains a simple web apps that demonstrate the OAuth authentication process. The application use the Django framework. You don't need to use Django for your application, but you'll need it to run the sample code.

  1. Install django, oauth2 and evernote library. You can also use requirements.txt for pip.

  2. Open the file oauth/views.py

  3. Fill in your Evernote API consumer key and secret.

  4. On the command line, run the following command to start the sample app:

    $ python manage.py runserver
  5. Open the sample app in your browser: http://localhost:8000

Getting Started - Pyramid with OAuth

If you want to use Evernote API with Pyramid, the code in sample/pyramid will be good start.

  1. Install the sample project using pip on your command line like this.

    $ pip install -e .
  2. Open the file development.ini

  3. Fill in your Evernote API consumer key and secret.

  4. On the command line, run the following command to start the sample app:

    $ pserve development.ini
  5. Open the sample app in your browser: http://localhost:6543

Usage

OAuth

client = EvernoteClient(
    consumer_key='YOUR CONSUMER KEY',
    consumer_secret='YOUR CONSUMER SECRET',
    sandbox=True # Default: True
)
request_token = client.get_request_token('YOUR CALLBACK URL')
client.get_authorize_url(request_token)
 => https://sandbox.evernote.com/OAuth.action?oauth_token=OAUTH_TOKEN

To obtain the access token

access_token = client.get_access_token(
    request_token['oauth_token'],
    request_token['oauth_token_secret'],
    request.GET.get('oauth_verifier', '')
)

Now you can make other API calls

client = EvernoteClient(token=access_token)
note_store = client.get_note_store()
notebooks = note_store.listNotebooks()

UserStore

Once you acquire token, you can use UserStore. For example, if you want to call UserStore.getUser:

client = EvernoteClient(token=access_token)
user_store = client.get_user_store()
user_store.getUser()

You can omit authenticationToken in the arguments of UserStore functions.

NoteStore

If you want to call NoteStore.listNotebooks:

note_store = client.get_note_store()
note_store.listNotebooks()

NoteStore for linked notebooks

If you want to get tags for linked notebooks:

linked_notebook = note_store.listLinkedNotebooks()[0]
shared_note_store = client.getSharedNoteStore(linked_notebook)
shared_notebook = shared_note_store.getSharedNotebookByAuth()
shared_note_store.listTagsByNotebook(shared_notebook.notebookGuid)

NoteStore for Business

If you want to get the list of notebooks in your business account:

business_note_store = client.get_business_note_store()
business_note_store.listNotebooks()

References

Known Issues

Regular expressions

In general, the "re" regex module doesn't handle some of our regular expressions in Limits, but re2 does.

More Repositories

1

android-job

Android library to handle jobs in the background.
Java
5,373
star
2

android-state

A utility library for Android to save objects in a Bundle without any boilerplate.
Java
862
star
3

evernote-sdk-js

Evernote SDK for JavaScript
JavaScript
561
star
4

evernote-sdk-android

Evernote SDK for Android
Java
429
star
5

evernote-sdk-ios

Evernote SDK for iOS
Objective-C
398
star
6

evernote-sdk-python3

Testing the Evernote Cloud API for Python 3
Python
276
star
7

evernote-sdk-java

Evernote SDK for Java
Java
259
star
8

evernote-cloud-sdk-ios

Evernote Cloud SDK for iOS
Objective-C
256
star
9

evernote-sdk-php

Evernote SDK for PHP
PHP
248
star
10

serge

Continuous localization platform
Perl
231
star
11

evernote-sdk-ruby

Evernote SDK for Ruby
Ruby
163
star
12

evernote-cloud-sdk-php

PHP
149
star
13

evernote-sdk-csharp

Evernote SDK for C#
C#
125
star
14

evernote-thrift

Thrift IDL files for the Evernote Cloud API
Thrift
96
star
15

evernote-sdk-mac

Evernote SDK for Cocoa
Objective-C
89
star
16

evernote-sdk-cpp

Evernote SDK for C++
C++
78
star
17

evernote-cloud-sdk-windows

C#
78
star
18

evernote-oauth-ruby

Evernote OAuth / Thrift API client library for Ruby
Ruby
74
star
19

zing

Translation server for continuous localization.
Python
57
star
20

android-intent

A simple to use library for Android which helps to connect to the main Android app with Intents.
Java
42
star
21

evernote-sdk-as3

Evernote SDK for ActionScript
ActionScript
22
star
22

evernote-sdk-perl

Evernote SDK for Perl
Perl
19
star
23

Aquaman

TypeScript
18
star
24

serge-website

Source code for https://serge.io/ β€” documentation site for Serge
PHP
5
star
25

eslint-plugin-evernote

Evernote custom eslint plugin
JavaScript
5
star
26

eslint-config-evernote

eslint config rules for Evernote projects.
JavaScript
2
star