# easycloudapi
The `easycloudapi` is a simple uitility to provide ease of developing experience for any Python Applications.
## Functionality Availaible:
1. Generate Date Dimension
2. Generate Bigquery Schema from Json
## Code Samples:
### Generate Bigquery Schema-
1. You can directly pass json/dict object to the `generate_bq_schema` method
```python
from easycloudapi.gcp.bigquery.bigquery_schema import BigquerySchema
sample_json = {
"name": "Danilo",
"age": 32,
"date_joined": "2020-11-05",
"location": {"country": "United Kingdom", "city": "London"},
"years_active": [2020, 2021, 2022],
"favourite_movies": [
{"name": "Momento", "year": "2000"},
{"name": "Se7en", "year": "1995"},
{"name": "Momento", "year": "2000"}
]
}
bq_schema_obj = BigquerySchema()
out_generate_bq_schema = bq_schema_obj.generate_bq_schema(data=sample_json)
print(f"out_generate_bq_schema:\n{out_generate_bq_schema}")
```
2. You can also convert the json file into json/dict object and pass to the `generate_bq_schema` method
```python
import json
from easycloudapi.gcp.bigquery.bigquery_schema import BigquerySchema
bq_schema_obj = BigquerySchema()
with open("tests//test_data//sample_json_01.json") as json_file:
sample_dict = json.load(json_file)
out_generate_bq_schema = bq_schema_obj.generate_bq_schema(data=sample_dict)
print(out_generate_bq_schema)
```
### Date Functionality-
1. Generate Date Dimension
```python
from easycloudapi.generic.datetime.generate_date_dimention import generate_date_dimension
out1 = generate_date_dimension(start_date="2023\\08\\01", end_date="2023\\08\\03")
print(f"out1: {out1}")
out2 = generate_date_dimension(start_date="2023/08/01", end_date="2023/08/03")
print(f"out2: {out2}")
out3 = generate_date_dimension(start_date="2023-08-01", end_date="2023-08-03")
print(f"out3: {out3}")
```
## How to Contribute
1. Refer to [Developer Guide](developer.md)
## MIT License
Copyright (c) 2023 easycloudapi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Raw data
{
"_id": null,
"home_page": "https://github.com/easycloudapi/python_utility",
"name": "easycloudapi",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "utility,gcp",
"author": "Indranil Pal",
"author_email": "info.easycloudapi@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/18/62/412252433569680280c937cf4ca732803de38acba8925d31418ea0145efd/easycloudapi-0.0.3.tar.gz",
"platform": null,
"description": "# easycloudapi\r\nThe `easycloudapi` is a simple uitility to provide ease of developing experience for any Python Applications.\r\n\r\n\r\n## Functionality Availaible:\r\n1. Generate Date Dimension\r\n2. Generate Bigquery Schema from Json\r\n\r\n## Code Samples:\r\n\r\n### Generate Bigquery Schema-\r\n1. You can directly pass json/dict object to the `generate_bq_schema` method\r\n ```python\r\n from easycloudapi.gcp.bigquery.bigquery_schema import BigquerySchema\r\n\r\n sample_json = {\r\n \"name\": \"Danilo\",\r\n \"age\": 32,\r\n \"date_joined\": \"2020-11-05\",\r\n \"location\": {\"country\": \"United Kingdom\", \"city\": \"London\"},\r\n \"years_active\": [2020, 2021, 2022],\r\n \"favourite_movies\": [\r\n {\"name\": \"Momento\", \"year\": \"2000\"},\r\n {\"name\": \"Se7en\", \"year\": \"1995\"},\r\n {\"name\": \"Momento\", \"year\": \"2000\"}\r\n ]\r\n }\r\n\r\n bq_schema_obj = BigquerySchema()\r\n out_generate_bq_schema = bq_schema_obj.generate_bq_schema(data=sample_json)\r\n\r\n print(f\"out_generate_bq_schema:\\n{out_generate_bq_schema}\")\r\n ```\r\n\r\n2. You can also convert the json file into json/dict object and pass to the `generate_bq_schema` method\r\n ```python\r\n import json\r\n from easycloudapi.gcp.bigquery.bigquery_schema import BigquerySchema\r\n\r\n\r\n bq_schema_obj = BigquerySchema()\r\n with open(\"tests//test_data//sample_json_01.json\") as json_file:\r\n sample_dict = json.load(json_file)\r\n\r\n out_generate_bq_schema = bq_schema_obj.generate_bq_schema(data=sample_dict)\r\n print(out_generate_bq_schema)\r\n ```\r\n\r\n### Date Functionality-\r\n1. Generate Date Dimension\r\n ```python\r\n from easycloudapi.generic.datetime.generate_date_dimention import generate_date_dimension\r\n\r\n out1 = generate_date_dimension(start_date=\"2023\\\\08\\\\01\", end_date=\"2023\\\\08\\\\03\")\r\n print(f\"out1: {out1}\")\r\n out2 = generate_date_dimension(start_date=\"2023/08/01\", end_date=\"2023/08/03\")\r\n print(f\"out2: {out2}\")\r\n out3 = generate_date_dimension(start_date=\"2023-08-01\", end_date=\"2023-08-03\")\r\n print(f\"out3: {out3}\")\r\n ```\r\n\r\n## How to Contribute\r\n1. Refer to [Developer Guide](developer.md)\r\n\r\n\r\n\r\n## MIT License\r\n\r\nCopyright (c) 2023 easycloudapi\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Providing utility functions to help other python developers",
"version": "0.0.3",
"project_urls": {
"Bug Tracker": "https://github.com/easycloudapi/python_utility/issues",
"Homepage": "https://github.com/easycloudapi/python_utility",
"repository": "https://github.com/easycloudapi/python_utility"
},
"split_keywords": [
"utility",
"gcp"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "997466cd4e170544640baf17214da71b4e5afd96a93be7e112508786a57e270c",
"md5": "62c971c942f9f780541ad5b394866fde",
"sha256": "da9d7ace95a8cb6e653b0cb9af24f9879430702ef0e0c175389fb6661d096ec4"
},
"downloads": -1,
"filename": "easycloudapi-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "62c971c942f9f780541ad5b394866fde",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 6282,
"upload_time": "2023-08-03T21:18:35",
"upload_time_iso_8601": "2023-08-03T21:18:35.879726Z",
"url": "https://files.pythonhosted.org/packages/99/74/66cd4e170544640baf17214da71b4e5afd96a93be7e112508786a57e270c/easycloudapi-0.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1862412252433569680280c937cf4ca732803de38acba8925d31418ea0145efd",
"md5": "b999e2991f3967f86a169c5a87cc2bca",
"sha256": "8978e9689038da5728a8f6802b72b972f5c0fd0c011cbe22354cc28bd50d6689"
},
"downloads": -1,
"filename": "easycloudapi-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "b999e2991f3967f86a169c5a87cc2bca",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 6254,
"upload_time": "2023-08-03T21:18:37",
"upload_time_iso_8601": "2023-08-03T21:18:37.496973Z",
"url": "https://files.pythonhosted.org/packages/18/62/412252433569680280c937cf4ca732803de38acba8925d31418ea0145efd/easycloudapi-0.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-03 21:18:37",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "easycloudapi",
"github_project": "python_utility",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "easycloudapi"
}