Skip to main content

Python SDK for accessing Fyle Platform APIs

Project description

Fyle

Python SDK for accessing Fyle Platform APIs. Fyle is an expense management system.

Installation

This project requires Python 3+ and Requests library (pip install requests).

  1. Download this project and use it (copy it in your project, etc).

  2. Install it from pip.

     $ pip install fyle
    

Usage

To use this SDK you'll need these Fyle credentials used for OAuth2 authentication: client ID, client secret and refresh token. You can follow the steps on this Article or reach out to support@fylehq.com.

This SDK is very easy to use.

  • First you'll need to create a connection using the main class Platform.
from fyle.platform import Platform

fyle = Platform(
    server_url='FYLE SERVER URL',
    token_url='FYLE TOKEN URL',
    refresh_token='FYLE REFRESH TOKEN',
    client_id='FYLE CLIENT ID',
    client_secret='FYLE CLIENT SECRET'
)
  • You can access the V1beta version of the APIs as follows:
"""
USAGE: <Platform INSTANCE>.<VERSION: eg. v1beta>.<FYLE ROLE: eg. admin>.<API_NAME: eg. expenses>.<API_METHOD: eg. get>(<PARAMETERS>)
"""

# Get a list of all Expenses in a paginated manner and add to a list
expenses = []

query_params = {
    'order': 'created_at.desc'
}

expenses_generator = fyle.v1beta.admin.expenses.list_all(query_params=query_params)

for response in expenses_generator:
    if response.get('data'):
        expenses.extend(response['data'])

Release latest version to PyPi

  • Open the releases section on GitHub and Draft a new release.
  • Check the version in setup.py, make sure you update that version along with your changes.
  • Add the version and description and click ok Publish Release button.
  • This will trigger the github action and automatically push the SDK to PyPi

License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fyle-0.23.0.tar.gz (20.9 kB view hashes)

Uploaded Source

Built Distribution

fyle-0.23.0-py3-none-any.whl (43.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page