# 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/e8/6e/c86c52646cf6e75a72807f8f7956fe54ffe4e0f552c49429be8a394899aa/fyle_integrations_platform_connector-1.40.0.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.40.0",
"project_urls": {
"Homepage": "https://github.com/fylein/fyle-integrations-platform-connector"
},
"split_keywords": [
"fyle",
" api",
" python",
" integration",
" platform",
" connector"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e85ac82c99eceee2ad61055b52178903077e7b75e17905f57ff49d19eb2117b2",
"md5": "d98768d47eb750734c4d19455744d1c3",
"sha256": "9dc92d97792a65d919145b5cf1659d731fec956f49b4000c9dc65917e23ef6f0"
},
"downloads": -1,
"filename": "fyle_integrations_platform_connector-1.40.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d98768d47eb750734c4d19455744d1c3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 19535,
"upload_time": "2025-02-14T11:30:15",
"upload_time_iso_8601": "2025-02-14T11:30:15.454821Z",
"url": "https://files.pythonhosted.org/packages/e8/5a/c82c99eceee2ad61055b52178903077e7b75e17905f57ff49d19eb2117b2/fyle_integrations_platform_connector-1.40.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e86ec86c52646cf6e75a72807f8f7956fe54ffe4e0f552c49429be8a394899aa",
"md5": "c598ee35517210cae3fd1dff3f74b8f9",
"sha256": "f332eae12f81f11d5a0d74675305cbc41f01aafa86c9ecfac7ef50ec16f371c9"
},
"downloads": -1,
"filename": "fyle_integrations_platform_connector-1.40.0.tar.gz",
"has_sig": false,
"md5_digest": "c598ee35517210cae3fd1dff3f74b8f9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12505,
"upload_time": "2025-02-14T11:30:16",
"upload_time_iso_8601": "2025-02-14T11:30:16.685982Z",
"url": "https://files.pythonhosted.org/packages/e8/6e/c86c52646cf6e75a72807f8f7956fe54ffe4e0f552c49429be8a394899aa/fyle_integrations_platform_connector-1.40.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-14 11:30:16",
"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": [
{
"name": "fyle",
"specs": [
[
">=",
"v0.33.0"
]
]
},
{
"name": "fyle_accounting_mappings",
"specs": [
[
"==",
"1.32.3"
]
]
},
{
"name": "python-dateutil",
"specs": [
[
"==",
"2.8.1"
]
]
},
{
"name": "psycopg2-binary",
"specs": [
[
"==",
"2.8.4"
]
]
}
],
"lcname": "fyle-integrations-platform-connector"
}