fyle-db-connector


Namefyle-db-connector JSON
Version 0.14.0 PyPI version JSON
download
home_pagehttps://github.com/fylein/fyle-db-connector
SummaryConnects Fyle to a database connector to transfer information to and fro.
upload_time2021-06-07 11:46:28
maintainer
docs_urlNone
authorShwetabh Kumar
requires_python
licenseMIT
keywords fyle db python sdk sqlite postgres
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Fyle Database Connector
Connects Fyle to a database to transfer information to and fro. [Fyle](https://www.fylehq.com/) is an expense management system.

## Installation

This project requires [Python 3+](https://www.python.org/downloads/).

1. Download this project and use it (copy it in your project, etc).
2. Install it from [pip](https://pypi.org).

        $ pip install fyle-db-connector

## Usage

To use this connector you'll need these Fyle credentials used for OAuth2 authentication: **client ID**, **client secret** and **refresh token**.

This connector is very easy to use.
1. First you'll need to create a connection using the main class FyleSDK.
```python
import sqlite3

from fylesdk import FyleSDK
from fyle_db_connector import FyleExtractConnector


dbconn = sqlite3.connect('/tmp/temp.db')

connection = FyleSDK(
    base_url='<BASE_URL>',
    client_id="<CLIENT_ID>",
    client_secret='<CLIENT_SECRET>',
    refresh_token='<REFRESH_TOKEN>'
)

fyle_extract = FyleExtractConnector(
    fyle_sdk_connection=connection,
    dbconn=dbconn
)
```
2. After that you'll be able to extract data from fyle and store it in the db
```python
# Create the tables to for all objects
fyle_extract.create_tables()

fyle_extract.extract_expenses(state=['PAYMENT_PROCESSING'])
fyle_extract.extract_settlements()
fyle_extract.extract_employees()
fyle_extract.extract_reimbursements()
fyle_extract.extract_advances()
fyle_extract.extract_advance_requests(state=['PAID'])
fyle_extract.extract_projects()
fyle_extract.extract_cost_centers()
fyle_extract.extract_categories()
```

## Contribute

To contribute to this project follow the steps

* Fork and clone the repository.
* Run `pip install -r requirements.txt`
* Setup pylint precommit hook
    * Create a file `.git/hooks/pre-commit`
    * Copy and paste the following lines in the file - 
        ```bash
        #!/usr/bin/env bash 
        git-pylint-commit-hook
        ```
     * Run `chmod +x .git/hooks/pre-commit`
## 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-db-connector",
    "name": "fyle-db-connector",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "fyle,db,python,sdk,sqlite,postgres",
    "author": "Shwetabh Kumar",
    "author_email": "shwetabh.kumar@fyle.in",
    "download_url": "https://files.pythonhosted.org/packages/c9/0c/d6ad0a588d4a02915512bb55e9c1953e83bb6dbab168e25e19b017a59d12/fyle-db-connector-0.14.0.tar.gz",
    "platform": "",
    "description": "# Fyle Database Connector\nConnects Fyle to a database to transfer information to and fro. [Fyle](https://www.fylehq.com/) is an expense management system.\n\n## Installation\n\nThis project requires [Python 3+](https://www.python.org/downloads/).\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-db-connector\n\n## Usage\n\nTo use this connector you'll need these Fyle credentials used for OAuth2 authentication: **client ID**, **client secret** and **refresh token**.\n\nThis connector is very easy to use.\n1. First you'll need to create a connection using the main class FyleSDK.\n```python\nimport sqlite3\n\nfrom fylesdk import FyleSDK\nfrom fyle_db_connector import FyleExtractConnector\n\n\ndbconn = sqlite3.connect('/tmp/temp.db')\n\nconnection = FyleSDK(\n    base_url='<BASE_URL>',\n    client_id=\"<CLIENT_ID>\",\n    client_secret='<CLIENT_SECRET>',\n    refresh_token='<REFRESH_TOKEN>'\n)\n\nfyle_extract = FyleExtractConnector(\n    fyle_sdk_connection=connection,\n    dbconn=dbconn\n)\n```\n2. After that you'll be able to extract data from fyle and store it in the db\n```python\n# Create the tables to for all objects\nfyle_extract.create_tables()\n\nfyle_extract.extract_expenses(state=['PAYMENT_PROCESSING'])\nfyle_extract.extract_settlements()\nfyle_extract.extract_employees()\nfyle_extract.extract_reimbursements()\nfyle_extract.extract_advances()\nfyle_extract.extract_advance_requests(state=['PAID'])\nfyle_extract.extract_projects()\nfyle_extract.extract_cost_centers()\nfyle_extract.extract_categories()\n```\n\n## Contribute\n\nTo contribute to this project follow the steps\n\n* Fork and clone the repository.\n* Run `pip install -r requirements.txt`\n* Setup pylint precommit hook\n    * Create a file `.git/hooks/pre-commit`\n    * Copy and paste the following lines in the file - \n        ```bash\n        #!/usr/bin/env bash \n        git-pylint-commit-hook\n        ```\n     * Run `chmod +x .git/hooks/pre-commit`\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Connects Fyle to a database connector to transfer information to and fro.",
    "version": "0.14.0",
    "split_keywords": [
        "fyle",
        "db",
        "python",
        "sdk",
        "sqlite",
        "postgres"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "271ef01837fe2cfdf51666eaa143bd24",
                "sha256": "9f996f20b6850b1e4e7d93db57c20776725b46a756c1af4e50b7d986e40290f2"
            },
            "downloads": -1,
            "filename": "fyle_db_connector-0.14.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "271ef01837fe2cfdf51666eaa143bd24",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 17216,
            "upload_time": "2021-06-07T11:46:27",
            "upload_time_iso_8601": "2021-06-07T11:46:27.125206Z",
            "url": "https://files.pythonhosted.org/packages/da/84/730c023be604bf3af8d592454bc3bdb4e1856592e8a9e492bb0f8afea1d4/fyle_db_connector-0.14.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "ddfe3d33b4dd56ffb30aaa2684ae4cf9",
                "sha256": "a77349353d7ab6dee732ac2c35cc0175913dcc992fc785c32c789d582ef05410"
            },
            "downloads": -1,
            "filename": "fyle-db-connector-0.14.0.tar.gz",
            "has_sig": false,
            "md5_digest": "ddfe3d33b4dd56ffb30aaa2684ae4cf9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 14335,
            "upload_time": "2021-06-07T11:46:28",
            "upload_time_iso_8601": "2021-06-07T11:46:28.466372Z",
            "url": "https://files.pythonhosted.org/packages/c9/0c/d6ad0a588d4a02915512bb55e9c1953e83bb6dbab168e25e19b017a59d12/fyle-db-connector-0.14.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-06-07 11:46:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "fylein",
    "error": "Could not fetch GitHub repository",
    "lcname": "fyle-db-connector"
}
        
Elapsed time: 0.35908s