Name | pykolofinance JSON |
Version |
3.0.0
JSON |
| download |
home_page | None |
Summary | A utility package for kolomoni banking microservices |
upload_time | 2024-12-03 08:29:45 |
maintainer | None |
docs_url | None |
author | Daniel Ale |
requires_python | <4.0,>=3.11 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Shared Python Utilities
== Custom Auth Service
In order to use the Custom Auth Middleware, kindly set the following
[source,bash]
---
poetry add pykolofinance
---
[source,bash]
---
pip install pykolofinance
---
[source,bash]
---
AUTH_SERVICE_BASE_URL=
---
## Usage
1. Install the package
[source,bash]
---
poetry add pykolofinance
---
2. Add `pykolofinance` to installed apps in django
3. update `REST_FRAMEWORK` settings as showing below
[source,python]
---
REST_FRAMEWORK = {
...
# 'DATE_INPUT_FORMATS': ["%d/%m/%Y", ],
'DEFAULT_AUTHENTICATION_CLASSES': (
"pykolofinance.authentication.CustomJWTAuthentication",
'rest_framework.authentication.BasicAuthentication',
'rest_framework.authentication.SessionAuthentication',
),
...
}
---
=== Manage Migrations
Whenever you make changes to models, you need to generate migrations locally before pushing your code to the repo. In order to generate migrations, kindly run the following command in another terminal window while your main app is also running
== Logging
The service includes a middleware that logs both requests and responses to Elasticsearch (ELK). To enable logging, specify the `ELK_LOGGER_URL` in your environment variables.
=== Configuration
Ensure your `.env` file includes the following:
[source,bash]
----
ELK_LOGGER_URL=https://your-elasticsearch-url:9200
----
=== Middleware Integration
The logging middleware is already integrated into the application. It captures API interactions and stores them in Elasticsearch for monitoring and analysis.
=== Skip URL Name
You can skip logging for specific API endpoints by setting `API_LOGGER_SKIP_URL_NAME` in your `settings.py`. Example:
[source,python]
----
API_LOGGER_SKIP_URL_NAME = ['url_name1', 'url_name2']
----
=== Skip Namespace
Skip logging for entire apps by specifying their namespaces in `API_LOGGER_SKIP_NAMESPACE` in your `settings.py`. Example:
[source,python]
----
API_LOGGER_SKIP_NAMESPACE = ['APP_NAMESPACE1', 'APP_NAMESPACE2']
----
=== Exclude http request methods from being logged ?(Optional)
You can exclude selected https methods by specifying `API_LOGGER_EXCLUDE_HTTP_METHODS` in settings.py. By default all GET request are excluded from being logged
[source,python]
----
API_LOGGER_EXCLUDE_HTTP_METHODS = ['GET', 'PATCH']
----
=== Hide Sensitive Data From Logs
To prevent sensitive information from appearing in the logs, configure `API_LOGGER_EXCLUDE_KEYS` in your `settings.py` with a list of sensitive keys. By default, the following keys are excluded:
[source,python]
----
API_LOGGER_EXCLUDE_KEYS = ['password', 'token', 'access', 'refresh']
# Sensitive data will be replaced with "***FILTERED***".
----
= KYC
== 1. Verification
The service includes a KYC verification service. There are three verification types:
. BVN
. NIN
. BVN_SELFIE
We currently have two providers:
. MOCK
. DOJAH
By default, the provider is set to MOCK. To override the default value, set `PYKOLO_DEFAULT_IDENTITY_SERVICE` in your settings file to your preferred provider:
[source,python]
----
PYKOLO_DEFAULT_IDENTITY_SERVICE = "DOJAH"
----
Please note that when you switch the provider to DOJAH, you are required to set `DOJAH_API_URL`, `DOJAH_APP_ID`, and `DOJAH_API_KEY` in your settings.py file. Please note that the DOJAH API URL must be without a trailing slash `/`.
[source,python]
----
from pykolofinance.kyc.verifier import get_identity_data
identity_data = get_identity_data(identity_type, identity_number, image=None, user_id=None)
----
Note that an image is required while verifying BVN_SELFIE.
.Table Contributors
|===
|Name |Role |Email
|Daniel Ale |SA |d.ale@capitalsage.ng
|Isaiah Aimiton |BE |i.aimiton@capitalsage.ng
|===
[quote]
____
Happy Coding
____
Raw data
{
"_id": null,
"home_page": null,
"name": "pykolofinance",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.11",
"maintainer_email": null,
"keywords": null,
"author": "Daniel Ale",
"author_email": "danielale9291@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/5b/01/21d8554e99336eea9de37b10ce3a71a5e7d9bb3f415c1028ab36ad139b34/pykolofinance-3.0.0.tar.gz",
"platform": null,
"description": "# Shared Python Utilities\n\n== Custom Auth Service\n\nIn order to use the Custom Auth Middleware, kindly set the following\n\n[source,bash]\n---\npoetry add pykolofinance\n---\n\n[source,bash]\n---\npip install pykolofinance\n---\n[source,bash]\n---\nAUTH_SERVICE_BASE_URL=\n---\n\n\n## Usage\n1. Install the package \n\n[source,bash]\n---\npoetry add pykolofinance\n---\n\n2. Add `pykolofinance` to installed apps in django\n3. update `REST_FRAMEWORK` settings as showing below\n\n[source,python]\n---\nREST_FRAMEWORK = {\n ...\n # 'DATE_INPUT_FORMATS': [\"%d/%m/%Y\", ],\n 'DEFAULT_AUTHENTICATION_CLASSES': (\n \"pykolofinance.authentication.CustomJWTAuthentication\",\n 'rest_framework.authentication.BasicAuthentication',\n 'rest_framework.authentication.SessionAuthentication',\n ),\n ...\n}\n---\n\n=== Manage Migrations\nWhenever you make changes to models, you need to generate migrations locally before pushing your code to the repo. In order to generate migrations, kindly run the following command in another terminal window while your main app is also running\n\n\n== Logging\n\nThe service includes a middleware that logs both requests and responses to Elasticsearch (ELK). To enable logging, specify the `ELK_LOGGER_URL` in your environment variables.\n\n=== Configuration\n\nEnsure your `.env` file includes the following:\n\n[source,bash]\n----\nELK_LOGGER_URL=https://your-elasticsearch-url:9200\n----\n\n=== Middleware Integration\n\nThe logging middleware is already integrated into the application. It captures API interactions and stores them in Elasticsearch for monitoring and analysis.\n\n=== Skip URL Name\n\nYou can skip logging for specific API endpoints by setting `API_LOGGER_SKIP_URL_NAME` in your `settings.py`. Example:\n\n[source,python]\n----\nAPI_LOGGER_SKIP_URL_NAME = ['url_name1', 'url_name2']\n----\n\n=== Skip Namespace\n\nSkip logging for entire apps by specifying their namespaces in `API_LOGGER_SKIP_NAMESPACE` in your `settings.py`. Example:\n\n[source,python]\n----\nAPI_LOGGER_SKIP_NAMESPACE = ['APP_NAMESPACE1', 'APP_NAMESPACE2']\n----\n\n=== Exclude http request methods from being logged ?(Optional)\n\nYou can exclude selected https methods by specifying `API_LOGGER_EXCLUDE_HTTP_METHODS` in settings.py. By default all GET request are excluded from being logged\n[source,python]\n----\nAPI_LOGGER_EXCLUDE_HTTP_METHODS = ['GET', 'PATCH']\n----\n\n=== Hide Sensitive Data From Logs\n\nTo prevent sensitive information from appearing in the logs, configure `API_LOGGER_EXCLUDE_KEYS` in your `settings.py` with a list of sensitive keys. By default, the following keys are excluded:\n\n[source,python]\n----\nAPI_LOGGER_EXCLUDE_KEYS = ['password', 'token', 'access', 'refresh']\n# Sensitive data will be replaced with \"***FILTERED***\".\n----\n\n= KYC\n\n== 1. Verification\n\nThe service includes a KYC verification service. There are three verification types:\n\n. BVN\n. NIN\n. BVN_SELFIE\n\nWe currently have two providers:\n\n. MOCK\n. DOJAH\n\nBy default, the provider is set to MOCK. To override the default value, set `PYKOLO_DEFAULT_IDENTITY_SERVICE` in your settings file to your preferred provider:\n\n[source,python]\n----\nPYKOLO_DEFAULT_IDENTITY_SERVICE = \"DOJAH\"\n----\n\nPlease note that when you switch the provider to DOJAH, you are required to set `DOJAH_API_URL`, `DOJAH_APP_ID`, and `DOJAH_API_KEY` in your settings.py file. Please note that the DOJAH API URL must be without a trailing slash `/`.\n\n[source,python]\n----\nfrom pykolofinance.kyc.verifier import get_identity_data\n\nidentity_data = get_identity_data(identity_type, identity_number, image=None, user_id=None)\n----\n\nNote that an image is required while verifying BVN_SELFIE.\n\n\n\n\n\n.Table Contributors\n|===\n|Name |Role |Email\n|Daniel Ale |SA |d.ale@capitalsage.ng\n|Isaiah Aimiton |BE |i.aimiton@capitalsage.ng\n|===\n[quote]\n____\nHappy Coding\n____\n",
"bugtrack_url": null,
"license": null,
"summary": "A utility package for kolomoni banking microservices",
"version": "3.0.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "435f3682c5a62f17c5482c1c3cde13a8d81e9aa8b6c43ee0a311c17e39b59e4a",
"md5": "9bdf1769388f8715e42ec8543dea271a",
"sha256": "c640df6880d4fc6fd2fc4cb322e20a6e73e98149f13adce8eee6a78ae731a83c"
},
"downloads": -1,
"filename": "pykolofinance-3.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9bdf1769388f8715e42ec8543dea271a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 35011,
"upload_time": "2024-12-03T08:29:44",
"upload_time_iso_8601": "2024-12-03T08:29:44.340097Z",
"url": "https://files.pythonhosted.org/packages/43/5f/3682c5a62f17c5482c1c3cde13a8d81e9aa8b6c43ee0a311c17e39b59e4a/pykolofinance-3.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5b0121d8554e99336eea9de37b10ce3a71a5e7d9bb3f415c1028ab36ad139b34",
"md5": "6635d12103ef8ab1cd7f987eda538e18",
"sha256": "3740caa1a6e8f720e9b97079a9bde32c3bdf333b2797620f26b48654dc18ecd4"
},
"downloads": -1,
"filename": "pykolofinance-3.0.0.tar.gz",
"has_sig": false,
"md5_digest": "6635d12103ef8ab1cd7f987eda538e18",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 26457,
"upload_time": "2024-12-03T08:29:45",
"upload_time_iso_8601": "2024-12-03T08:29:45.835565Z",
"url": "https://files.pythonhosted.org/packages/5b/01/21d8554e99336eea9de37b10ce3a71a5e7d9bb3f415c1028ab36ad139b34/pykolofinance-3.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-03 08:29:45",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pykolofinance"
}