Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcuswhybrow/api-wrappers-python
Python wrapper classes around the miiCard API
https://github.com/marcuswhybrow/api-wrappers-python
Last synced: 27 days ago
JSON representation
Python wrapper classes around the miiCard API
- Host: GitHub
- URL: https://github.com/marcuswhybrow/api-wrappers-python
- Owner: marcuswhybrow
- License: other
- Created: 2013-05-16T16:11:26.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-05-16T16:23:44.000Z (over 11 years ago)
- Last Synced: 2024-05-02T00:10:20.788Z (8 months ago)
- Language: Python
- Size: 106 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.txt
- License: LICENSE.txt
Awesome Lists containing this project
README
api-wrappers-python
===================Python wrapper classes around the miiCard API.
This repository houses the source for the latest version of the miiCard Consumers library available on PyPI.
See http://www.miicard.com/developers for more information.
##What is miiCard
miiCard lets anybody prove their identity to the same level of traceability as using a passport, driver's licence or photo ID. We then allow external web applications to ask miiCard users to share a portion of their identity information with the application through a web-accessible API.##What is the library for?
miiCard's API is an OAuth-protected web service supporting SOAP, POX and JSON - [documentation](http://www.miicard.com/developers) is available. The library wraps the JSON endpoint of the API, making it easier to make the required OAuth signed requests.You can obtain a consumer key and secret from miiCard by contacting us on our support form, including the details listed on the developer site.
Pull the library into your own application by downloading the latest released version from PyPI
##Usage
You'll need to implement your own OAuth exchange with miiCard.com's OAuth endpoint to obtain an access token and secret for a user. Once you've got your consumer key and secret, access token and access token secret you can instantiate an API wrapper:
api = MiiCardOAuthClaimsService("consumer_key", "consumer_secret", "access_token", "access_token_secret")
Then make calls against it simply:
user_profile_response = api.get_claims().data
user_first_name = user_profile_response.data.first_name##Mapping from API data types
The following list is provided as a convenient cheat-sheet, and maps the API's methods and data types to their equivalents in the Python wrapper library classes.###Methods
API methodPython equivalent (given `api` instance of MiiCardOAuthClaimsService)
AssuranceImageapi.assurance_image(type)
GetClaimsapi.get_claims()
GetIdentitySnapshotapi.get_identity_snapshot(snapshot_id)
GetIdentitySnapshotDetailsapi.get_identity_snapshot_details()
Or, for a specific snapshot:
api.get_identity_snapshot_details(snapshot_id)
IsSocialAccountAssuredapi.is_social_account_assured(social_account_id, social_account_type)
IsUserAssuredapi.is_user_assured()###Data types
####EmailAddress
API data-type propertyPython equivalent (given `email` instance of EmailAddress)
DisplayNameemail.display_name
Addressemail.address
IsPrimaryemail.is_primary
Verifiedemail.verified####Identity
API data-type propertyPython equivalent (given `identity` instance of Identity)
Sourceidentity.source
UserIdidentity.user_id
ProfileUrlidentity.profile_url
Verifiedidentity.verified####IdentitySnapshot
API data-type propertyPython equivalent (given `snapshot` instance of IdentitySnapshot)
Detailssnapshot.details
Snapshotsnapshot.snapshot####IdentitySnapshotDetails
API data-type propertyPython equivalent (given `snapshot_details` instance of IdentitySnapshotDetails)
SnapshotIdsnapshot_details.snapshot_id
Usernamesnapshot_details.username
TimestampUtcsnapshot_details.timestamp_utc
WasTestUsersnapshot_details.was_test_user####MiiApiCallStatus enumeration type
API data-type propertyPython equivalent
SuccessMiiApiCallStatus.SUCCESS
FailureMiiApiCallStatus.FAILURE####MiiApiErrorCode enumeration type
API data-type propertyPython equivalent
SuccessMiiApiCallStatus.SUCCESS
AccessRevokedMiiApiCallStatus.ACCESS_REVOKED
UserSubscriptionLapsedMiiApiCallStatus.USER_SUBSCRIPTION_LAPSED
TransactionalSupportDisabledMiiApiCallStatus.TRANSATIONAL_SUPPORT_DISABLED
DevelopmentTransactionalSupportOnlyMiiApiCallStatus.DEVELOPMENT_TRANSACTIONAL_SUPPORT_ONLY
InvalidSnapshotIdMiiApiCallStatus.INVALID_SNAPSHOT_ID
BlacklistedMiiApiCallStatus.BLACKLISTED
ProductDisabledMiiApiCallStatus.PRODUCT_DISABLED
ProductDeletedMiiApiCallStatus.PRODUCT_DELETED
ExceptionMiiApiCallStatus.EXCEPTION####MiiApiResponse
API data-type propertyPython equivalent (given `response` instance of MiiApiResponse)
Statusresponse.status
ErrorCoderesponse.error_code
ErrorMessageresponse.error_message
Dataresponse.data
IsTestUserresponse.is_test_user####MiiUserProfile
API data-type propertyPython equivalent (given `profile` instance of MiiUserProfile)
Salutationprofile.salutation
FirstNameprofile.first_name
MiddleNameprofile.middle_name
LastNameprofile.last_name
DateOfBirthprofile.date_of_birth
PreviousFirstNameprofile.previous_first_name
PreviousMiddleNameprofile.previous_middle_name
PreviousLastNameprofile.previous_last_name
LastVerifiedprofile.last_verified
ProfileUrlprofile.profile_url
ProfileShortUrlprofile.profile_short_url
CardImageUrlprofile.card_image_url
EmailAddressesprofile.email_addresses
Identitiesprofile.identities
PhoneNumbersprofile.phone_numbers
PostalAddressesprofile.postal_addresses
WebPropertiesprofile.web_properties
IdentityAssuredprofile.identity_assured
HasPublicProfileprofile.has_public_profile
PublicProfileprofile.public_profile####PhoneNumber
API data-type propertyPython equivalent (given `phone` instance of PhoneNumber)
DisplayNamephone.display_name
CountryCodephone.country_code
NationalNumberphone.national_number
IsMobilephone.is_mobile
IsPrimaryphone.is_primary
Verifiedphone.verified####PostalAddress
API data-type propertyPython equivalent (given `address` instance of PostalAddress)
Houseaddress.house
Line1address.line1
Line2address.line2
Cityaddress.city
Regionaddress.region
Codeaddress.code
Countryaddress.country
IsPrimaryaddress.is_primary
Verifiedaddress.verified####WebProperty
API data-type propertyPython equivalent (given `property` instance of WebProperty)
DisplayNameproperty.display_name
Identifierproperty.identifier
Typeproperty.type
Verifiedproperty.verified####WebPropertyType enumeration type
API data-type propertyPython equivalent
DomainWebPropertyType.DOMAIN
WebsiteWebPropertyType.WEBSITE##Dependencies
The library takes a dependency on simplegeo-oauth2, but uses a patched version of it to correct a few issues.##Contributing
* Use GitHub issue tracking to report bugs in the library
* If you're going to submit a patch, please base it off the development branch - the master reflects the latest version published to PyPI but may not necessarily be bleeding-edge
* Join the [miiCard.com developer forums](http://devforum.miicard.com) to keep up to date with the latest releases and planned changes##Licence
Copyright (c) 2012, miiCard Limited All rights reserved.http://opensource.org/licenses/BSD-3-Clause
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of miiCard Limited nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.