Package: prosper-api
Prosper API client for PythonPython trading library for Prosper.comInstallationWith Pippip install prosper-apiOptionalkeyringsupportpip install 'prosper-api[secure]'With Poetrypoetry add prosper-apiOptionalkeyringsupportpoetry add 'prosper-api[secure]'Setupℹ️ The library currently only supports personal use, where the client id and credentials are from the same account. Support
for multi-account mode isplanned.Config file locationLinux/Unix:$HOME/.config/prosper-api/config.tomlWindows:%HOMEDIR%%HOMEPATH\AppData\Local\prosper-api\prosper-api\config.tomlMacOs:$HOME/Library/Application Support/prosper-api/config.tomlDefaultCreate a config file with the following contents:[credentials]client-id="0123456789abcdef0123456789abcdef"client-secret="fedcba9876543210fedcba9876543210"username="PROBABLY_YOUR_EMAIL_ADDRESS"password="AWESOME_PASSWORD"More secureℹ️ You must have installedkeyringor used the '[secure]' mode when installing the library.Remove theclient-secretandpasswordportions of the config:[credentials]client-id="0123456789abcdef0123456789abcdef"username="PROBABLY_YOUR_EMAIL_ADDRESS"Run the following to store your credentials securely in your OS credentials storage, e.g. Keychain for MacOS, etc.
For each command, you will be prompted to enter the corresponding secret. For 'CLIENT_ID', enter the client secret. For
'USERNAME' enter the corresponding password.keyring set prosper-api '{CLIENT_ID}'
keyring set prosper-api '{USERNAME}'UseSeea sample botfor concrete usage.Get account detailsThe following will get the details of your account, including available cash and investment allocations.fromprosper_api.clientimportClientfromprosper_api.modelsimportAccountclient=Client()account:Account=client.get_account_info()Search listingsThe following will get all the current listings you haven't invested in.fromprosper_api.clientimportClientfromprosper_api.modelsimportListing,SearchListingsRequest,SearchListingsResponsefromtypingimportListPAGE_SIZE=25client=Client()listings:List[Listing]=[]offset=0whileTrue:result:SearchListingsResponse=client.search_listings(SearchListingsRequest(invested=False,biddable=True,limit=PAGE_SIZE,offset=offset))listings+=result.resultoffset+=PAGE_SIZEiflen(listings)>=result.total_countorlen(result.result)<PAGE_SIZE:breakℹ️ The full set of filters listed in theProsper API docsare availablePlace orderThe following will place an order, given a listing id.fromprosper_api.clientimportClientfromprosper_api.modelsimportOrderclient=Client()listing_id:int=12341234order_dollar_amount:float=25order_result:Order=client.order(listing_id,order_dollar_amount)List notesThe following will list all the notes in your account. The same pattern can be used to list orders, loans, and payments.fromprosper_api.clientimportClientfromprosper_api.modelsimportNote,ListNotesRequest,ListNotesResponsefromtypingimportListclient=Client()notes:List[Note]=[]PAGE_SIZE=25offset=0whileTrue:result:ListNotesResponse=client.list_notes(ListNotesRequest(limit=PAGE_SIZE,offset=offset,sort_by="age_in_months",sort_dir="asc"))notes+=result.resultoffset+=PAGE_SIZEiflen(notes)>=result.total_countorlen(result.result)<PAGE_SIZE:breakConfigurationAvailable config values:prosper-api.auth.token-cache:default:/home/graham/.cache/prosper-api/token-cachedescription:The filesystem location where the auth token will be cached.optional:falsetype:strprosper-api.credentials.client-id:constraint:^[a-f0-9]{32}$description:The client-id from Prosper.optional:falsetype:strprosper-api.credentials.client-secret:constraint:^[a-f0-9]{32}$description:The client-secret from Prosper; can be stored and accessed securely using the keyringlibrary.optional:truetype:strprosper-api.credentials.password:description:Your Prosper password; can be stored and accessed securely using the keyring library.optional:truetype:strprosper-api.credentials.username:description:Your Prosper usernameoptional:falsetype:strprosper-shared.serde.parse-dates:default:truedescription:Date values represented as strings should be parsed into `date` and `datetime` objects.Supports ISO-8601-compliant date strings.optional:falsetype:boolprosper-shared.serde.parse-enums:default:truedescription:Enum values represented as strings should be parsed into their respective types.optional:falsetype:boolprosper-shared.serde.use-decimals:default:truedescription:Floating point values should be parsed as decimals instead of floats.optional:falsetype:boolFeedbackThis project usesGitHub issuesfor feature requests and bug reports.ContributingThis project usesPoetryto manage dependencies and building. Follow the instructions
to install it. Then usepoetry install --all-extrasto install the project dependencies. Then runpoetry run autohooks activateto set up the pre-commit hooks. Please ensure the hooks pass before submitting a pull request.