Skip to content

getphyllo/phyllo-python-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Python Sample by Phyllo

Phyllo backend implementation sample/boilerplate in Python
Explore the docs »

View Demo · Report Bug · Request Feature

(insert badges here)

Table of Contents

About the Project

This app is a sample implementation of a basic client for our APIs. In its current form, this is just a pass-through - meaning all the requests you send to it are sent to our APIs without any modifications, and all the responses received from our APIs are sent to you without any modifications. This demonstrates an ideal technical integration with Phyllo. You can use this to see how things work, to help you with your local dev work, or even as a starting boilerplate to customize by adding your business logic.

Built With

Getting Started

Clone or fork this repo and follow the instructions.

Dependencies

  • Python 3 or above (check your OS-specific instructions at https://www.python.org/downloads/)

  • pip

    python -m ensurepip --upgrade
    
  • Your Phyllo API credentials should be populated in the .env file in the root directory, take reference from the .env.example file.

Installing

  1. Clone the repo.

  2. Install pipenv package to make a virtual environment for the project.

    pip install pipenv
  3. Setup and enter the virtual environment.

    pipenv install
    pipenv shell

Usage

Run project locally

  • Run the main app to start the project.

    uvicorn app.main:app --port 9000 --forwarded-allow-ips="*"
  • The project should be up and running on port 9000.

You can make requests to any API endpoints by using the same path as described in our API documentation with the base URL as your localhost:9000. For example, to create a user, you could send a POST request to localhost:9000/v1/users, and it would behave the same as our API does.

Run webhooks locally

  • Create a public URL for port 9003 using ngrok (or a similar tunneling tool).

    ngrok http 9003
  • Use the above-generated tunnel URL and the desired webhook events in the .env file in the root directory to register the webhook in the sandbox.

  • Run the webhook app to start listening for webhooks.

    uvicorn app.webhook.webhook_main:app --port 9003 --forwarded-allow-ips="*"
  • The webhook server should be up and running on port 9003.

  • To test webhooks to check if everything works as expected:

Run tests

  • Run the main file inside the unit_tests directory to run the unit tests.

    python unit_tests/main.py
    

Help

See the open issues for a list of proposed features (and known issues).

To get any help regarding this app, please join our Discord community using this invite link.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Version history

See CHANGELOG.

Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. Sincere thanks to all our contributors!

You are requested to follow the contribution guidelines specified in CONTRIBUTING.md 😄

Support

Contributions, issues, and feature requests are welcome! Give a ⭐️ if you like this project!

If you like what we do here at Phyllo, help us spread the word through a tweet or a post.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

This repo is inspired by:

About Authors

phyllo-python-sample is created & maintained by Phyllo, Inc. You can find us on Twitter - @getphyllo or join our Discord community using this invite link.

The names and logos for Phyllo are trademarks of Phyllo, Inc.

We ❤️ open-source software! See our other projects and check out our products.

About

Back end sample app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •