Name | soxai-data JSON |
Version |
0.0.2
JSON |
| download |
home_page | None |
Summary | SOXAI Data Science Library |
upload_time | 2024-07-11 05:14:01 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License Copyright (c) [2024] [SOXAI Inc.] 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. |
keywords |
data
science
soxai
soxai-data
soxai_data
|
VCS |
|
bugtrack_url |
|
requirements |
pandas
httpx
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# soxai_data Python Package
This package provides a data loader for SOXAI ring users to access and analyze their data.
## Installation
Install the package using pip:
```bash
pip install soxai_data
```
## Usage
First, obtain your token by logging into the [SOXAI Platform](https://soxai-web-api-tiufu2wgva-df.a.run.app/). After logging in, generate your token and use it to load the data.
### Initialize DataLoader
```python
from soxai_data import DataLoader
# Initialize the DataLoader with your token
sx_data = DataLoader(token='your_token')
```
### Get Daily Data
You can retrieve daily data and plot it as follows:
```python
# Retrieve daily data
df = sx_data.getDailyData()
# Plot the data
df.plot()
```
### Get Account Information
To get your account information:
```python
# Retrieve account information
my_info = sx_data.getMyInfo()
print(my_info)
```
### Get Organization Users
If you have an organization ID, you can get the users associated with it:
```python
# Retrieve organization users
my_org_id = my_info['myOrg']['orgId']
org_df = sx_data.getMyOrgUsers(my_org_id)
print(org_df)
```
### Merge DataFrames
You can merge the data with organization user information based on a common field:
```python
# Merge daily data with organization user data
merged_df = df.merge(org_df, on='uid', how='left')
print(merged_df)
```
### Get Detail Data
To retrieve detailed data within a specified date range:
```python
# Retrieve detailed data
detail_df = sx_data.getDetailData(start_date='2023-01-01', end_date='2023-01-31')
print(detail_df)
```
### Complete Example
Here's a complete example that includes retrieving and merging data:
```python
from soxai_data import DataLoader
# Initialize the DataLoader
sx_data = DataLoader(token='your_token')
# Get daily data
df = sx_data.getDailyData()
# Get account information
my_info = sx_data.getMyInfo()
my_org_id = my_info['myOrg']['orgId']
# Get organization users
org_df = sx_data.getMyOrgUsers(my_org_id)
# Merge data
merged_df = df.merge(org_df, on='uid', how='left')
# Display the merged DataFrame
print(merged_df)
```
## Methods
### `DataLoader.getMyInfo()`
Retrieves the account information.
**Returns:**
`dict`: My personal information.
### `DataLoader.getMyOrgUsers(org_id=None)`
Retrieves the users associated with the specified organization.
**Parameters:**
- `org_id` (str, optional): The ID of the organization. If not provided, the method will use the default organization ID.
**Returns:**
`pandas.DataFrame`: The DataFrame containing the users associated with the specified organization.
### `DataLoader.getDailyData(start_date=None, end_date=None, convert_to_local_time=True)`
Retrieves daily data from the SOXAI database within the specified date range.
**Parameters:**
- `start_date` (str, optional): The start date of the data range. Defaults to '-7d'.
- `end_date` (str, optional): The end date of the data range. Defaults to 'now()'.
- `convert_to_local_time` (bool, optional): Whether to convert the time to local time. Defaults to True.
**Returns:**
`pandas.DataFrame`: A DataFrame containing the retrieved data.
### `DataLoader.getDetailData(start_date=None, end_date=None, convert_to_local_time=True)`
Retrieves detailed data from the SOXAI database within the specified date range.
**Parameters:**
- `start_date` (str, optional): The start date of the data range. Defaults to '-1d'.
- `end_date` (str, optional): The end date of the data range. Defaults to 'now()'.
- `convert_to_local_time` (bool, optional): Whether to convert the time to local time. Defaults to True.
**Returns:**
`pandas.DataFrame`: A DataFrame containing the retrieved data.
## Additional Notes
- Ensure your token is valid and has not expired.
- Handle exceptions and errors gracefully while making API calls.
- Utilize Pandas' powerful data manipulation capabilities to analyze and visualize your data efficiently.
By following this guide, you should be able to effectively use the `soxai_data` package to retrieve, analyze, and visualize data from the SOXAI platform.
Raw data
{
"_id": null,
"home_page": null,
"name": "soxai-data",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Shuang Liu <shuang.liu@soxai.co.jp>",
"keywords": "data, science, soxai, soxai-data, soxai_data",
"author": null,
"author_email": "Shuang Liu <shuang.liu@soxai.co.jp>",
"download_url": "https://files.pythonhosted.org/packages/54/80/91fdcf042a282bdd3d82b043f6023f4e931e6a3da6dc90eccd224e747a9c/soxai_data-0.0.2.tar.gz",
"platform": null,
"description": "# soxai_data Python Package\n\nThis package provides a data loader for SOXAI ring users to access and analyze their data.\n\n## Installation\n\nInstall the package using pip:\n\n```bash\npip install soxai_data\n```\n\n## Usage\n\nFirst, obtain your token by logging into the [SOXAI Platform](https://soxai-web-api-tiufu2wgva-df.a.run.app/). After logging in, generate your token and use it to load the data.\n\n### Initialize DataLoader\n\n```python\nfrom soxai_data import DataLoader\n\n# Initialize the DataLoader with your token\nsx_data = DataLoader(token='your_token')\n```\n\n### Get Daily Data\n\nYou can retrieve daily data and plot it as follows:\n\n```python\n# Retrieve daily data\ndf = sx_data.getDailyData()\n# Plot the data\ndf.plot()\n```\n\n### Get Account Information\n\nTo get your account information:\n\n```python\n# Retrieve account information\nmy_info = sx_data.getMyInfo()\nprint(my_info)\n```\n\n### Get Organization Users\n\nIf you have an organization ID, you can get the users associated with it:\n\n```python\n# Retrieve organization users\nmy_org_id = my_info['myOrg']['orgId']\norg_df = sx_data.getMyOrgUsers(my_org_id)\nprint(org_df)\n```\n\n### Merge DataFrames\n\nYou can merge the data with organization user information based on a common field:\n\n```python\n# Merge daily data with organization user data\nmerged_df = df.merge(org_df, on='uid', how='left')\nprint(merged_df)\n```\n\n### Get Detail Data\n\nTo retrieve detailed data within a specified date range:\n\n```python\n# Retrieve detailed data\ndetail_df = sx_data.getDetailData(start_date='2023-01-01', end_date='2023-01-31')\nprint(detail_df)\n```\n\n### Complete Example\n\nHere's a complete example that includes retrieving and merging data:\n\n```python\nfrom soxai_data import DataLoader\n\n# Initialize the DataLoader\nsx_data = DataLoader(token='your_token')\n\n# Get daily data\ndf = sx_data.getDailyData()\n\n# Get account information\nmy_info = sx_data.getMyInfo()\nmy_org_id = my_info['myOrg']['orgId']\n\n# Get organization users\norg_df = sx_data.getMyOrgUsers(my_org_id)\n\n# Merge data\nmerged_df = df.merge(org_df, on='uid', how='left')\n\n# Display the merged DataFrame\nprint(merged_df)\n```\n\n## Methods\n\n### `DataLoader.getMyInfo()`\n\nRetrieves the account information.\n\n**Returns:** \n`dict`: My personal information.\n\n### `DataLoader.getMyOrgUsers(org_id=None)`\n\nRetrieves the users associated with the specified organization.\n\n**Parameters:** \n- `org_id` (str, optional): The ID of the organization. If not provided, the method will use the default organization ID.\n\n**Returns:** \n`pandas.DataFrame`: The DataFrame containing the users associated with the specified organization.\n\n### `DataLoader.getDailyData(start_date=None, end_date=None, convert_to_local_time=True)`\n\nRetrieves daily data from the SOXAI database within the specified date range.\n\n**Parameters:** \n- `start_date` (str, optional): The start date of the data range. Defaults to '-7d'.\n- `end_date` (str, optional): The end date of the data range. Defaults to 'now()'.\n- `convert_to_local_time` (bool, optional): Whether to convert the time to local time. Defaults to True.\n\n**Returns:** \n`pandas.DataFrame`: A DataFrame containing the retrieved data.\n\n### `DataLoader.getDetailData(start_date=None, end_date=None, convert_to_local_time=True)`\n\nRetrieves detailed data from the SOXAI database within the specified date range.\n\n**Parameters:** \n- `start_date` (str, optional): The start date of the data range. Defaults to '-1d'.\n- `end_date` (str, optional): The end date of the data range. Defaults to 'now()'.\n- `convert_to_local_time` (bool, optional): Whether to convert the time to local time. Defaults to True.\n\n**Returns:** \n`pandas.DataFrame`: A DataFrame containing the retrieved data.\n\n## Additional Notes\n\n- Ensure your token is valid and has not expired.\n- Handle exceptions and errors gracefully while making API calls.\n- Utilize Pandas' powerful data manipulation capabilities to analyze and visualize your data efficiently.\n\nBy following this guide, you should be able to effectively use the `soxai_data` package to retrieve, analyze, and visualize data from the SOXAI platform.",
"bugtrack_url": null,
"license": "MIT License Copyright (c) [2024] [SOXAI Inc.] 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.",
"summary": "SOXAI Data Science Library",
"version": "0.0.2",
"project_urls": {
"Bug Tracker": "https://github.com/soxaidev/soxai_data/issues",
"Changelog": "https://github.com/soxaidev/soxai_data/blob/master/CHANGELOG.md",
"Documentation": "https://soxai.co.jp/docs",
"Homepage": "https://soxai.co.jp",
"Repository": "https://github.com/soxaidev/soxai_data"
},
"split_keywords": [
"data",
" science",
" soxai",
" soxai-data",
" soxai_data"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "612136a9e23a7cffe1c7cf1e3c88b8f91c67c5688e56ed47a29c4c26c34a15c3",
"md5": "f1a3655e4c454cd3047ee75dc191ec44",
"sha256": "ff7d035ae8ec9601a68e21bd9d058f89ef760edfea9d711c5c509080ad0991ac"
},
"downloads": -1,
"filename": "soxai_data-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f1a3655e4c454cd3047ee75dc191ec44",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 5889,
"upload_time": "2024-07-11T05:13:59",
"upload_time_iso_8601": "2024-07-11T05:13:59.693931Z",
"url": "https://files.pythonhosted.org/packages/61/21/36a9e23a7cffe1c7cf1e3c88b8f91c67c5688e56ed47a29c4c26c34a15c3/soxai_data-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "548091fdcf042a282bdd3d82b043f6023f4e931e6a3da6dc90eccd224e747a9c",
"md5": "1dd9ae0ca5028f4df7c7aa914ce080da",
"sha256": "1723cf3b2b2ea576e3fbefe6a304802861f482f6a81f3f14e8f357a41b1864c0"
},
"downloads": -1,
"filename": "soxai_data-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "1dd9ae0ca5028f4df7c7aa914ce080da",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 6425,
"upload_time": "2024-07-11T05:14:01",
"upload_time_iso_8601": "2024-07-11T05:14:01.378327Z",
"url": "https://files.pythonhosted.org/packages/54/80/91fdcf042a282bdd3d82b043f6023f4e931e6a3da6dc90eccd224e747a9c/soxai_data-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-11 05:14:01",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "soxaidev",
"github_project": "soxai_data",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "pandas",
"specs": []
},
{
"name": "httpx",
"specs": []
}
],
"lcname": "soxai-data"
}