Package: embedpy
Embed Python LibraryThe Embed Python library provides an easy access to the Embed Investment API byCowrywise. Embed is an investment-as-a-service API that allows you to integrate investment features in your products and offer financial services to your customers at scale. With Embed, developers can create investment accounts for their customers and expose them to a wide variety of investment products!DocumentationSee theEmbed API docs.InstallationInstall the package directly via gitpipinstallgit+https://github.com/cowrywise/embedpy.gitYou could also install the library via pypi using the pip package manager.$pipinstall-UembedpyRequirementsPython3+UsageTo get started, sign up for your developer credentials on theEmbed Dashboard. Once you have signed up, you can retrieve yourclient_idandclient_secretkeys from the developer dashboard. Set your credentials in the environment variables before creating an instance of the Embed Client.# Set environment variablesCLIENT_ID=CWRY-substitute-yours-hereCLIENT_SECRET=CWRY-SECRET-substitute-yours-here# Create an instance of the Embed Clientfromembed.clientimportClientclient=Client()Alternatively, you can use your credentials to instantiate the Embed Client. During this instantiation, you can specify a base URL. This is an optional parameter that defaults to the sandbox base URL.fromembed.clientimportClientclient=Client(client_id='****',client_secret='****',base_url="https://***.cowrywise.com")Embed API REST MethodsRest MethodEndpointcreate_account(first_name=None, last_name=None, email=None)POST /accountsget_account(account_id)GET /accounts/:idupdate_next_of_kin(account_id=None, email=None, first_name=None,/last_name=None, phone_number=None, relationship=None, gender=None)POST /accounts/:id/nokget_portfolio(account_id)GET /accounts/:id/portfolioget_asset(asset_id)GET /assets/:id/list_assets(country=None, asset_type=None)GET /assets?country=None&asset_type=Noneget_index(index_id)GET /indexes/:idcreate_custom_index(account_id=None, name=None, description=None, allocations=None)POST /indexesmodify_custom_index(account_id=None, index_id=None, allocations=None)PUT /indexes/:index_idget_investment(investment_id)GET /investments/:idcreate_investment(account_id=None, asset_code=None)POST /investmentsliquidate_investment(investment_id=None, units=None)POST /investments/:idget_price_history(asset_id=None, from_date=None, to_date=None)GET /prices?asset_id=None&from_date=None&to_date=Nonecreate_savings(account_id=None, days=None, interest_enabled=None, currency_code=None)POST /savingsbuy_stock(account_id=None, symbol=None, amount=None, side=None, the_type=None, time_in_force=None)POST /stocks/buysell_stock(account_id=None, symbol=None, amount=None, side=None, the_type=None, time_in_force=None)POST /stocks/selllist_transfers(account_id=None, email=None, from_date=None, to_date=None)GET /transfers/:id?email=None&from_date=None&to_date=Noneget_deposit(deposit_id)GET /deposits/:idcreate_wallet(account_id=None, currency_code=None)POST /walletstransfer(wallet_id=None, product_code=None, amount=None)POST /wallets/:wallet_id/transferget_wallet(wallet_id)GET /wallets/:wallet_idCheck theAPI referencedocument for all resources and their respective endpoints.ContributionsWe welcome contributions from everyone. Before submitting a pull request, kindly ensure:Necessary tests for the code changes requested are addedCode is formatted according to PEP8There is clear commit messages