fyle


Namefyle JSON
Version 0.36.0 PyPI version JSON
download
home_pagehttps://github.com/fylein/fyle-platform-sdk-py
SummaryPython SDK for accessing Fyle Platform APIs
upload_time2023-10-27 09:49:02
maintainer
docs_urlNone
authorSiva Narayanan
requires_python
licenseMIT
keywords fyle api python sdk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # Fyle

Python SDK for accessing Fyle Platform APIs. [Fyle](https://www.fylehq.com/) is an expense management system.

## Installation

This project requires [Python 3+](https://www.python.org/downloads/) and [Requests](https://pypi.org/project/requests/) library (pip install requests).

1. Download this project and use it (copy it in your project, etc).
2. Install it from [pip](https://pypi.org).
        
        $ 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](https://help.fylehq.com/en/articles/3045578-integrating-with-fyle) 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.
```python
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:
```python
"""
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'])

```

## Integration Tests

1. Install [pytest](https://pypi.org/project/pytest/) package using pip as follows:

```
pip install pytest
```

2. 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

3. Apply secrets and Run integration tests as follows:

```
source test_credentials.sh  && python -m pytest test/integration
```
4. To get the code coverage execute the following:

```
pytest test/ --cov
```
Currently the code coverage is at 95%

## Release latest version to [PyPi](https://pypi.org/project/fyle/)

* Open the releases section on GitHub and [Draft a new release](https://github.com/fylein/fyle-platform-sdk-py/releases/new).
* 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](LICENSE) file for details

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fylein/fyle-platform-sdk-py",
    "name": "fyle",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "fyle,api,python,sdk",
    "author": "Siva Narayanan",
    "author_email": "siva@fyle.in",
    "download_url": "https://files.pythonhosted.org/packages/7a/c2/f7e594ba70f15284c6a6255db1205a2c32adc410073ba6f3f6384f70aca6/fyle-0.36.0.tar.gz",
    "platform": null,
    "description": "# Fyle\n\nPython SDK for accessing Fyle Platform APIs. [Fyle](https://www.fylehq.com/) is an expense management system.\n\n## Installation\n\nThis project requires [Python 3+](https://www.python.org/downloads/) and [Requests](https://pypi.org/project/requests/) library (pip install requests).\n\n1. Download this project and use it (copy it in your project, etc).\n2. Install it from [pip](https://pypi.org).\n        \n        $ pip install fyle\n\n## Usage\n\nTo 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](https://help.fylehq.com/en/articles/3045578-integrating-with-fyle) or reach out to support@fylehq.com.\n\nThis SDK is very easy to use.\n* First you'll need to create a connection using the main class Platform.\n```python\nfrom fyle.platform import Platform\n\nfyle = Platform(\n    server_url='FYLE SERVER URL',\n    token_url='FYLE TOKEN URL',\n    refresh_token='FYLE REFRESH TOKEN',\n    client_id='FYLE CLIENT ID',\n    client_secret='FYLE CLIENT SECRET'\n)\n```\n\n*  You can access the V1beta version of the APIs as follows:\n```python\n\"\"\"\nUSAGE: <Platform INSTANCE>.<VERSION: eg. v1beta>.<FYLE ROLE: eg. admin>.<API_NAME: eg. expenses>.<API_METHOD: eg. get>(<PARAMETERS>)\n\"\"\"\n\n# Get a list of all Expenses in a paginated manner and add to a list\nexpenses = []\n\nquery_params = {\n    'order': 'created_at.desc'\n}\n\nexpenses_generator = fyle.v1beta.admin.expenses.list_all(query_params=query_params)\n\nfor response in expenses_generator:\n    if response.get('data'):\n        expenses.extend(response['data'])\n\n```\n\n## Integration Tests\n\n1. Install [pytest](https://pypi.org/project/pytest/) package using pip as follows:\n\n```\npip install pytest\n```\n\n2. Add the following environment variables to test_credentials.sh file\n\n```\n    export SERVER_URL=<FYLE SERVER URL>\n    export TOKEN_URL=<FYLE TOKEN URL>\n    export REFRESH_TOKEN=<FYLE REFRESH TOKEN>\n    export CLIENT_ID=<FYLE CLIENT ID>\n    export CLIENT_SECRET=<FYLE CLIENT SECRET>\n```\n##### NOTE: The credentials used should have required roles assigned to them\n\n3. Apply secrets and Run integration tests as follows:\n\n```\nsource test_credentials.sh  && python -m pytest test/integration\n```\n4. To get the code coverage execute the following:\n\n```\npytest test/ --cov\n```\nCurrently the code coverage is at 95%\n\n## Release latest version to [PyPi](https://pypi.org/project/fyle/)\n\n* Open the releases section on GitHub and [Draft a new release](https://github.com/fylein/fyle-platform-sdk-py/releases/new).\n* Check the version in setup.py, make sure you update that version along with your changes.\n* Add the version and description and click ok `Publish Release` button.\n* This will trigger the github action and automatically push the SDK to PyPi\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python SDK for accessing Fyle Platform APIs",
    "version": "0.36.0",
    "project_urls": {
        "Homepage": "https://github.com/fylein/fyle-platform-sdk-py"
    },
    "split_keywords": [
        "fyle",
        "api",
        "python",
        "sdk"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "86dde9893ec37c64874e5662da173d357df446f9cb1e77b0db88daec35b378b7",
                "md5": "921c1da2abe37d190e5d38a0f448b95d",
                "sha256": "d5f487ba88729a04642b8dce6ccfeeefae2efe9da7bb95a48ed70a69b54b4cf5"
            },
            "downloads": -1,
            "filename": "fyle-0.36.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "921c1da2abe37d190e5d38a0f448b95d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 49343,
            "upload_time": "2023-10-27T09:49:00",
            "upload_time_iso_8601": "2023-10-27T09:49:00.175891Z",
            "url": "https://files.pythonhosted.org/packages/86/dd/e9893ec37c64874e5662da173d357df446f9cb1e77b0db88daec35b378b7/fyle-0.36.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7ac2f7e594ba70f15284c6a6255db1205a2c32adc410073ba6f3f6384f70aca6",
                "md5": "e528ff14258282f7f3d504ff7a518eaa",
                "sha256": "f38d4f31189cb7287dd520081da0027ead4b817759935a4293736e636b3cf8f9"
            },
            "downloads": -1,
            "filename": "fyle-0.36.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e528ff14258282f7f3d504ff7a518eaa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 23821,
            "upload_time": "2023-10-27T09:49:02",
            "upload_time_iso_8601": "2023-10-27T09:49:02.255672Z",
            "url": "https://files.pythonhosted.org/packages/7a/c2/f7e594ba70f15284c6a6255db1205a2c32adc410073ba6f3f6384f70aca6/fyle-0.36.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-27 09:49:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fylein",
    "github_project": "fyle-platform-sdk-py",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "fyle"
}
        
Elapsed time: 0.19376s