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).
-
Download this project and use it (copy it in your project, etc).
-
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
- Install pytest package using pip as follows:
pip install pytest
- 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
- Apply secrets and Run integration tests as follows:
source test_credentials.sh && python -m pytest test/integration
- 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 Releasebutton. - 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.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fyle-1.4.2.tar.gz | 25.4 kB | Without provenance | Details for fyle-1.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fyle-1.4.2-py3-none-any.whl | Python 3 | none | any | Details for fyle-1.4.2-py3-none-any.whl |
Total release size: 75.4 kB
Release files / fyle-1.4.2.tar.gz
| Download URL | fyle-1.4.2.tar.gz |
|---|---|
| Size | 25.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a7747cf12a3f9b9b00720ef25fde39107418ff320ff03ae4e9e0be0e626da52
|
|
BLAKE2b-256 checksum How to use checksums |
b955982e9763aad97b0cc6f216c33cb33956950ddfb9f1ab37aee44774215570
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Release files / fyle-1.4.2-py3-none-any.whl
| Download URL | fyle-1.4.2-py3-none-any.whl |
|---|---|
| Size | 50.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f71c44d9cc21bd3b36ec60699cfc37342868fe0bc838f2379bb1a7114f976e24
|
|
BLAKE2b-256 checksum How to use checksums |
d3ed407bfb3a4290b959fdc0e49daffb6745d3691d73a0711587c7d2371ec3d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.15.2
|
Security for fyle 1.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.