# 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/da/7a/0ed98a8cf133cbcac1e300d504233cad2ba6b9d816e822c2bf68703f32df/fyle_integrations_platform_connector-1.39.3.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.39.3",
"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": "d63f1f389ad55fbbde829a52d2515f7a90b2b5a0e9d99af0d7b846809523b25d",
"md5": "495d4f0dc92a6800c29435f97b139d16",
"sha256": "8d7419106207c1c50fb541bd76c11f260ee2786fa0da0b45424fc4e541ddcc3f"
},
"downloads": -1,
"filename": "fyle_integrations_platform_connector-1.39.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "495d4f0dc92a6800c29435f97b139d16",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 19375,
"upload_time": "2024-11-18T08:24:59",
"upload_time_iso_8601": "2024-11-18T08:24:59.822023Z",
"url": "https://files.pythonhosted.org/packages/d6/3f/1f389ad55fbbde829a52d2515f7a90b2b5a0e9d99af0d7b846809523b25d/fyle_integrations_platform_connector-1.39.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "da7a0ed98a8cf133cbcac1e300d504233cad2ba6b9d816e822c2bf68703f32df",
"md5": "1f584dc249631c88eea54bfd95400de8",
"sha256": "9ddfc660ba181693f794e49d35189abde6666d07243c9acf7617c3f8c87d1e03"
},
"downloads": -1,
"filename": "fyle_integrations_platform_connector-1.39.3.tar.gz",
"has_sig": false,
"md5_digest": "1f584dc249631c88eea54bfd95400de8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 12294,
"upload_time": "2024-11-18T08:25:01",
"upload_time_iso_8601": "2024-11-18T08:25:01.463637Z",
"url": "https://files.pythonhosted.org/packages/da/7a/0ed98a8cf133cbcac1e300d504233cad2ba6b9d816e822c2bf68703f32df/fyle_integrations_platform_connector-1.39.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-18 08:25:01",
"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"
}