Skip to main content

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 V1 version of the APIs as follows:
"""
USAGE: <Platform INSTANCE>.<VERSION: eg. v1>.<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.v1.admin.expenses.list_all(query_params=query_params)

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

Integration Tests

  1. Install pytest package using pip as follows:
pip install pytest
  1. Add the following environment variables to test_credentials.sh file
    export SERVER_URL=<FYLE SERVER URL>
    export TOKEN_URL=<FYLE TOKEN URL>
    export REFRESH_TOKEN=<FYLE REFRESH TOKEN>
    export CLIENT_ID=<FYLE CLIENT ID>
    export CLIENT_SECRET=<FYLE CLIENT SECRET>
NOTE: The credentials used should have required roles assigned to them
  1. Apply secrets and Run integration tests as follows:
source test_credentials.sh  && python -m pytest test/integration
  1. To get the code coverage execute the following:
pytest test/ --cov

Currently the code coverage is at 95%

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

Metadata

Release files for fyle 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fyle 1.4.0
File Size Uploaded
fyle-1.4.0.tar.gz 24.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fyle 1.4.0
File Interpreter ABI Platform
fyle-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 74.2 kB

Release files / fyle-1.4.0.tar.gz

Download URL fyle-1.4.0.tar.gz
Size 24.5 kB
Tags Source
SHA-256 checksum
How to use checksums
04db6e5308642f7aa93cc7b2bc88f847681a8b78748ecb5a5c3209106e418a1e
BLAKE2b-256 checksum
How to use checksums
c7d8baa5a474a9289c8ffd6e49e4339701d74a08fbeac5551f63aeec860f402b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / fyle-1.4.0-py3-none-any.whl

Download URL fyle-1.4.0-py3-none-any.whl
Size 49.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c907d9b91c546a9be9343262bd1ebd1f01716ebf07c8afbff11e48b25e56be43
BLAKE2b-256 checksum
How to use checksums
12f5fb1671c713678fd79aa5dad94ccc215fe250ab270e593a21679a9a41f8de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.37.2

2 release files

0.37.0

2 release files

0.36.1

2 release files

0.36.0

2 release files

0.35.0

2 release files

0.34.0

2 release files

0.31.0

2 release files

0.30.0

2 release files

0.29.0

2 release files

0.27.0

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.24.0

2 release files

0.21.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.18.0

2 release files

0.16.0

2 release files

0.15.0

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page