Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
bd1f82b
Added Python example
sneakypete81 May 4, 2013
eb93b56
Added Python example to GetPhotoNextPrevious
sneakypete81 May 4, 2013
9c216ec
Add example Python response
sneakypete81 May 4, 2013
f470635
Add Python example to GetPhotos
sneakypete81 May 4, 2013
43771af
Added Python example
sneakypete81 May 14, 2013
602e8c2
created Extend page
sushimustwrite Mar 29, 2013
125d7c5
faq changes
sushimustwrite Apr 19, 2013
fd5301c
Updated docs contrib guide, corrected formatting
sushimustwrite Apr 21, 2013
c728863
added a short version at top
sushimustwrite Apr 21, 2013
db34d27
finally fixed that markdown formatting issue
sushimustwrite Apr 21, 2013
6883bd0
Corrected photo/delete API documentation - was incorrectly using acti…
sneakypete81 May 4, 2013
f85c035
added faqs on syncing to storage accounts
sushimustwrite May 6, 2013
f40dabe
added album cover faq
sushimustwrite May 6, 2013
faa6953
rearranged and added some questions on pro account faq
sushimustwrite May 6, 2013
8a43267
updated to include getting oauth and consumer keys
sushimustwrite May 10, 2013
cefdc2a
Merge branch 'master' into python_api_docs
May 14, 2013
31335d9
Added Python example to PostPhotoDelete
sneakypete81 May 14, 2013
957c053
Add Python example to PostPhotoUpdate
sneakypete81 May 14, 2013
18d9370
Added Python example to PostPhotoUpload
sneakypete81 May 14, 2013
c9e2337
Use Python3 print syntax
sneakypete81 May 14, 2013
456f53c
Use Python3-compatible print syntax
sneakypete81 May 14, 2013
2abef8e
Use Python3-compatible print syntax
sneakypete81 May 14, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/api/GetPhoto.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Get Photo
1. [Examples][examples]
* [Command line][example-cli]
* [PHP][example-php]
* [Python][example-python]
1. [Response][response]
* [Sample][sample]

Expand Down Expand Up @@ -53,6 +54,16 @@ _Authentication: optional_
$client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
$response = $client->get("/photo/b/view.json");

<a name="example-python"></a>
#### Python (using [openphoto-python][openphoto-python])

client = openphoto.OpenPhoto()
photo = client.photos.list()[0] # Returns the first photo from the list
photo.view(returnSizes="20x20")
print(photo.path20x20)

http://current.openphoto.me/photo/c7/create/baad9/20x20.jpg

----------------------------------------

<a name="response"></a>
Expand Down Expand Up @@ -109,8 +120,10 @@ The response is in a standard [response envelope](http://theopenphotoproject.org
[examples]: #examples
[example-cli]: #example-cli
[example-php]: #example-php
[example-python]: #example-python
[response]: #response
[sample]: #sample
[photogeneration]: http://theopenphotoproject.org/documentation/faq/PhotoGeneration
[ReturnSizes]: http://theopenphotoproject.org/documentation/faq/ReturnSizes
[openphoto-php]: https://github.com/photo/openphoto-php
[openphoto-python]: https://github.com/photo/openphoto-python
12 changes: 12 additions & 0 deletions docs/api/GetPhotoNextPrevious.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Get Next/Previous Photo
1. [Examples][examples]
* [Command line][example-cli]
* [PHP][example-php]
* [Python][example-python]
1. [Response][response]
* [Sample][sample]

Expand Down Expand Up @@ -53,6 +54,15 @@ _Authentication: optional_
$client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
$response = $client->get("/photo/b/nextprevious.json");

<a name="example-python"></a>
#### Python (using [openphoto-python][openphoto-python])

client = openphoto.OpenPhoto()
photo = client.photos.list()[1] # Returns the second photo in the list
print(photo.next_previous())

{'previous': [<openphoto.objects.Photo id='1eo'>], 'next': [<openphoto.objects.Photo id='1eq'>]}

----------------------------------------

<a name="response"></a>
Expand Down Expand Up @@ -152,8 +162,10 @@ The response is in a standard [response envelope](http://theopenphotoproject.org
[examples]: #examples
[example-cli]: #example-cli
[example-php]: #example-php
[example-python]: #example-python
[response]: #response
[sample]: #sample
[photogeneration]: http://theopenphotoproject.org/documentation/faq/PhotoGeneration
[ReturnSizes]: http://theopenphotoproject.org/documentation/faq/ReturnSizes
[openphoto-php]: https://github.com/photo/openphoto-php
[openphoto-python]: https://github.com/photo/openphoto-python
10 changes: 10 additions & 0 deletions docs/api/GetPhotos.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Get Photos
1. [Examples][examples]
* [Command line][example-cli]
* [PHP][example-php]
* [Python][example-python]
1. [Response][response]
* [Sample][sample]

Expand Down Expand Up @@ -56,6 +57,13 @@ _Authentication: optional_
$client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
$response = $client->get("/photos/list.json", array('tags' => 'sunnyvale'));

<a name="example-python"></a>
#### Python (using [openphoto-python][openphoto-python])

client = openphoto.OpenPhoto()
print client.photos.list(tags="sunnyvale")

[<openphoto.objects.Photo id='hl'>, <openphoto.objects.Photo id='ob'>]
----------------------------------------

<a name="response"></a>
Expand Down Expand Up @@ -142,8 +150,10 @@ The response is in a standard [response envelope](http://theopenphotoproject.org
[examples]: #examples
[example-cli]: #example-cli
[example-php]: #example-php
[example-python]: #example-python
[response]: #response
[sample]: #sample
[photogeneration]: http://theopenphotoproject.org/documentation/faq/PhotoGeneration
[ReturnSizes]: http://theopenphotoproject.org/documentation/faq/ReturnSizes
[openphoto-php]: https://github.com/photo/openphoto-php
[openphoto-python]: https://github.com/photo/openphoto-python
11 changes: 11 additions & 0 deletions docs/api/GetTags.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Get Tags
1. [Examples][examples]
* [Command line][example-cli]
* [PHP][example-php]
* [Python][example-python]
1. [Response][response]
* [Sample][sample]

Expand Down Expand Up @@ -50,6 +51,14 @@ _None_
$client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
$response = $client->get("/tags/list.json");

<a name="example-python"></a>
#### Python (using [openphoto-python][openphoto-python])

client = openphoto.OpenPhoto()
print(client.tags.list())

[<openphoto.objects.Tag id='australia'>, <openphoto.objects.Tag id='Boracay Philippines'>, ...]

----------------------------------------

<a name="response"></a>
Expand Down Expand Up @@ -102,6 +111,8 @@ The response is in a standard [response envelope](http://theopenphotoproject.org
[examples]: #examples
[example-cli]: #example-cli
[example-php]: #example-php
[example-python]: #example-python
[response]: #response
[sample]: #sample
[openphoto-php]: https://github.com/photo/openphoto-php
[openphoto-python]: https://github.com/photo/openphoto-python
10 changes: 10 additions & 0 deletions docs/api/PostPhotoDelete.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Delete Photo
1. [Examples][examples]
* [Command line][example-cli]
* [PHP][example-php]
* [Python][example-python]
1. [Response][response]
* [Sample][sample]

Expand Down Expand Up @@ -50,6 +51,13 @@ _None_
$client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
$response = $client->post("/photo/a/delete.json");

<a name="example-python"></a>
#### Python (using [openphoto-python][openphoto-python])

client = openphoto.OpenPhoto()
photo = client.photos.list()[0] # Returns the first photo in the list
photo.delete()

----------------------------------------

<a name="response"></a>
Expand Down Expand Up @@ -77,6 +85,8 @@ The response is in a standard [response envelope](http://theopenphotoproject.org
[examples]: #examples
[example-cli]: #example-cli
[example-php]: #example-php
[example-python]: #example-python
[response]: #response
[sample]: #sample
[openphoto-php]: https://github.com/photo/openphoto-php
[openphoto-python]: https://github.com/photo/openphoto-python
10 changes: 10 additions & 0 deletions docs/api/PostPhotoUpdate.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Update Photo
1. [Examples][examples]
* [Command line][example-cli]
* [PHP][example-php]
* [Python][example-python]
1. [Response][response]
* [Sample][sample]

Expand Down Expand Up @@ -61,6 +62,13 @@ _Authentication: required_
$client = new OpenPhotoOAuth($host, $consumerKey, $consumerSecret, $oauthToken, $oauthTokenSecret);
$response = $client->post("/photo/a/update.json", array('title' => 'My Photo Title', 'tags' => 'sunnyvale,downtown'));

<a name="example-python"></a>
#### Python (using [openphoto-python][openphoto-python])

client = openphoto.OpenPhoto()
photo = client.photos.list()[0] # Returns the first photo in the list
photo.update(title="My Photo Title", tags=["sunnyvale", "downtown"])

----------------------------------------

<a name="response"></a>
Expand Down Expand Up @@ -120,6 +128,8 @@ The response is in a standard [response envelope](http://theopenphotoproject.org
[examples]: #examples
[example-cli]: #example-cli
[example-php]: #example-php
[example-python]: #example-python
[response]: #response
[sample]: #sample
[openphoto-php]: https://github.com/photo/openphoto-php
[openphoto-python]: https://github.com/photo/openphoto-python
13 changes: 13 additions & 0 deletions docs/api/PostPhotoUpload.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Upload Photo
1. [Examples][examples]
* [Command line][example-cli]
* [PHP][example-php]
* [Python][example-python]
1. [Response][response]
* [Sample][sample]

Expand Down Expand Up @@ -75,6 +76,16 @@ _Authentication: required_
$photoBase64Encoded = base64_encode(file_get_contents('/path/to/photo.jpg'));
$response = $client->post("/photo/upload.json", array('photo' => $photoBase64Encoded, 'tags' => 'sunnyvale,downtown'));

<a name="example-python"></a>
#### Python (using [openphoto-python][openphoto-python])

# multipart
client = openphoto.OpenPhoto()
client.photo.upload("path/to/photo.jpg", tags=["sunnyvale", "downtown"])

# base64 encoded
client.photo.upload_encoded("path/to/photo.jpg", tags=["sunnyvale", "downtown"])

----------------------------------------

<a name="response"></a>
Expand Down Expand Up @@ -134,6 +145,8 @@ The response is in a standard [response envelope](http://theopenphotoproject.org
[examples]: #examples
[example-cli]: #example-cli
[example-php]: #example-php
[example-python]: #example-python
[response]: #response
[sample]: #sample
[openphoto-php]: https://github.com/photo/openphoto-php
[openphoto-python]: https://github.com/photo/openphoto-python