# Fyle Integrations Platform Connector
## Installation and Usage
A common platform connector for all the Fyle Integrations to interact with Fyle's Platform APIs
`pip install fyle-integrations-platform-connector`
##### In Django `settings.py`
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
# Installed Apps
'rest_framework',
'corsheaders',
'fyle_rest_auth', # already existing reusable django app for authentication
'fyle_accounting_mappings', # already existing mapping infra app,
'fyle_integrations_platform_connector', # new platform connector
# User Created Apps
'apps.users',
'apps.workspaces',
'apps.mappings',
'apps.fyle',
'apps.quickbooks_online',
'apps.tasks'
]
##### Usage
```
from fyle_integrations_platform_connector import PlatformConnector
connector = PlatformConnector(fyle_credential=fyle_credential)
# Get Expenses
expenses = connector.expenses.get(
source_account_type=['PERSONAL_CASH_ACCOUNT', 'PERSONAL_CORPORATE_CREDIT_CARD_ACCOUNT'],
state='PAID',
last_synced_at='2021-08-22T00:00:000.000Z',
filter_credit_expenses=True
)
# Import Fyle dimensions
connector.import_fyle_dimensions()
# Import specific Fyle dimensions
connector.employees.sync()
connector.projects.sync()
```
## Local Development
### Setup
Setup virtual environment and install dependencies -
```
python3 -m venv venv && source venv/bin/activate && pip install -r requirements.txt
```
Copy sample secrets file and add secret environment variables -
```
cp sample_secrets.sh secrets.sh
```
Copy sample script file -
```
cp script.py raw_script.py
```
##### Run a raw python script [(script.py)](https://github.com/fylein/fyle-integrations-platform-connector/blob/master/script.py)
```
bash run.sh
```
##### Open SQLITE db and check data
```
sqlite3 db.sqlite3
-- Example query
select attribute_type, count(*) from expense_attributes group by attribute_type;
```
Raw data
{
"_id": null,
"home_page": "https://github.com/fylein/fyle-integrations-platform-connector",
"name": "fyle-integrations-platform-connector",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "fyle, api, python, integration, platform, connector",
"author": "Shwetabh Kumar",
"author_email": "shwetabh.kumar@fyle.in",
"download_url": "https://files.pythonhosted.org/packages/71/71/30c05d626efa299b44241caab959b99d1305608d9f57717c0c2fb41a27e2/fyle_integrations_platform_connector-1.37.2.tar.gz",
"platform": null,
"description": "# Fyle Integrations Platform Connector\n\n## Installation and Usage\n\nA common platform connector for all the Fyle Integrations to interact with Fyle's Platform APIs\n\n`pip install fyle-integrations-platform-connector`\n\n##### In Django `settings.py`\n\n INSTALLED_APPS = [\n 'django.contrib.admin',\n 'django.contrib.auth',\n 'django.contrib.contenttypes',\n 'django.contrib.sessions',\n 'django.contrib.messages',\n 'django.contrib.staticfiles',\n \n # Installed Apps\n 'rest_framework',\n 'corsheaders',\n 'fyle_rest_auth', # already existing reusable django app for authentication\n 'fyle_accounting_mappings', # already existing mapping infra app,\n 'fyle_integrations_platform_connector', # new platform connector\n \n # User Created Apps\n 'apps.users',\n 'apps.workspaces',\n 'apps.mappings',\n 'apps.fyle',\n 'apps.quickbooks_online',\n 'apps.tasks'\n ]\n\n\n##### Usage\n\n```\nfrom fyle_integrations_platform_connector import PlatformConnector\n\nconnector = PlatformConnector(fyle_credential=fyle_credential)\n\n# Get Expenses\nexpenses = connector.expenses.get(\n source_account_type=['PERSONAL_CASH_ACCOUNT', 'PERSONAL_CORPORATE_CREDIT_CARD_ACCOUNT'],\n state='PAID',\n last_synced_at='2021-08-22T00:00:000.000Z',\n filter_credit_expenses=True\n)\n\n# Import Fyle dimensions\nconnector.import_fyle_dimensions()\n\n# Import specific Fyle dimensions\nconnector.employees.sync()\nconnector.projects.sync()\n```\n\n## Local Development\n### Setup\n\nSetup virtual environment and install dependencies -\n```\npython3 -m venv venv && source venv/bin/activate && pip install -r requirements.txt\n```\n\nCopy sample secrets file and add secret environment variables -\n```\ncp sample_secrets.sh secrets.sh\n```\n\nCopy sample script file -\n```\ncp script.py raw_script.py\n```\n\n\n##### Run a raw python script [(script.py)](https://github.com/fylein/fyle-integrations-platform-connector/blob/master/script.py)\n```\nbash run.sh\n```\n\n##### Open SQLITE db and check data\n```\nsqlite3 db.sqlite3\n\n-- Example query\nselect attribute_type, count(*) from expense_attributes group by attribute_type;\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A common platform connector for all the Fyle Integrations to interact with Fyle Platform APIs",
"version": "1.37.2",
"project_urls": {
"Homepage": "https://github.com/fylein/fyle-integrations-platform-connector"
},
"split_keywords": [
"fyle",
" api",
" python",
" integration",
" platform",
" connector"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d524cb822640b93f0bb425203463b9ebb68c3c6e4d998d2a5e8ff144d734b031",
"md5": "0805ce0b463d8258e7005488bc33b75d",
"sha256": "746b060a7be9cd291c9ba0735a0f8a1514fb216aad07b9d689f6e553f6b3bf41"
},
"downloads": -1,
"filename": "fyle_integrations_platform_connector-1.37.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0805ce0b463d8258e7005488bc33b75d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 18749,
"upload_time": "2024-05-03T07:53:57",
"upload_time_iso_8601": "2024-05-03T07:53:57.155228Z",
"url": "https://files.pythonhosted.org/packages/d5/24/cb822640b93f0bb425203463b9ebb68c3c6e4d998d2a5e8ff144d734b031/fyle_integrations_platform_connector-1.37.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "717130c05d626efa299b44241caab959b99d1305608d9f57717c0c2fb41a27e2",
"md5": "6b34d2aa9572dab9d504b14f3cc5bae1",
"sha256": "bcf781f138faa6da6ecc57bffd925d3030dc0b6d8a2049a5dae36a53886812f7"
},
"downloads": -1,
"filename": "fyle_integrations_platform_connector-1.37.2.tar.gz",
"has_sig": false,
"md5_digest": "6b34d2aa9572dab9d504b14f3cc5bae1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12001,
"upload_time": "2024-05-03T07:53:59",
"upload_time_iso_8601": "2024-05-03T07:53:59.240308Z",
"url": "https://files.pythonhosted.org/packages/71/71/30c05d626efa299b44241caab959b99d1305608d9f57717c0c2fb41a27e2/fyle_integrations_platform_connector-1.37.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-03 07:53:59",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "fylein",
"github_project": "fyle-integrations-platform-connector",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "fyle-integrations-platform-connector"
}