
[](https://www.python.org/)
## Midas API: Revolutionizing Engineering 🚀
Welcome to the future of engineering with Midas API! 🌟 This cutting-edge repository is designed to transcend traditional engineering methodologies. A goldmine of innovation, Midas API eagerly awaits your contributions. Let's push the boundaries of possibility together! 😊
## Table of Contents
- [Introduction](#introduction)
- [Getting Started](#getting-started)
- [Coding Conventions](#coding-conventions)
- [Rules](#rules)
- [Usage](#usage)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)
## Introduction
Midas API is a state-of-the-art tool designed to revolutionize the field of engineering. By providing robust, scalable, and efficient solutions, Midas API empowers engineers to tackle complex challenges with ease. Whether you're a seasoned professional or a newcomer, Midas API is here to support your engineering journey.
## Getting Started
### Prerequisites
1. **Install VSCode**: Download and install Visual Studio Code from the [official Visual Studio Code website](https://code.visualstudio.com/download).
2. **Install Python**: Download and install Python 3.12.1 from the [official Python website](https://www.python.org/downloads/release/python-3121/). Ensure Python is added to your PATH during installation.
3. **Install Pipenv**: Use pip to install Pipenv, a tool that helps manage dependencies.
```bash
pip install pipenv
```
- Documentation: [Pipenv: Python Dev Workflow for Humans](https://pipenv.pypa.io/en/latest/)
4. **Install Project Dependencies**: Navigate to your project directory and install the necessary modules using Pipenv.
- For running environment:
```bash
pipenv install
```
- For development environment:
```bash
pipenv install --dev
```
5. **Prepare to Use Midas API**: Visit the [Midas API Documentation](https://midas-support.atlassian.net/wiki/spaces/MAW/overview) for more details.
## Coding Conventions
### Project Structure
- **project/**: Develop each plugin within this folder.
- **base/**: Contains shared utility functions and base modules like MidasAPI. Use this folder for any calculation base functions.
- **tests/**: Contains test files for regression testing.
- **rod/**: Extract JSON schema from this repository.
- **docs/**: Sphinx document folder.
### Style Guide
Adhere to the [Google Python Style Guide](https://yosseulsin-job.github.io/styleguide/pyguide.html) for comprehensive coding conventions.
- **Using Flake8**: Install `flake8` to automatically check and enforce coding conventions during development.
```bash
pip install flake8
```

- **Development Environment**: Configure your development environment to use `flake8`. Ensure any issues flagged by `flake8` are corrected promptly.
### Documentation Guide
Proper documentation is key to maintainability. Ensure that all functions, especially those in the `base` module, are well-documented.
- **Using autoDocstring**: Install `autoDocstring` to assist with writing docstrings. (ctrl + shift + 2)

- **Docstrings**: Use Google-style docstrings. Install the necessary extensions to assist with writing docstrings.
- **Example**: Data class with docstring:
```python
from dataclasses import dataclass, field as dataclass_field
@dataclass
class Person:
"""
Person details.
"""
name: str = dataclass_field(default="", metadata={"description": "The person's full name."})
age: int = dataclass_field(default=0, metadata={"description": "The person's age."})
email: str = dataclass_field(default='', metadata={"description": "The person's email address."})
```
- **Example**: Pydantic model with docstring:
```python
from pydantic import BaseModel, Field
from typing import List, Dict, Union
class Contact(BaseModel):
"""
Contact details.
"""
phone: str = Field(default="", description="The contact's phone number.")
address: str = Field(default='', description="The contact's address.")
def my_function(person: Person, contacts: List[Contact], settings: Dict[str, Union[int, str]] = {}) -> bool:
"""
Processes person and their contacts with given settings.
Args:
person: The person details.
contacts: List of contact details.
settings: Miscellaneous settings.
Returns:
bool: True if successful, False otherwise.
"""
return True
```
### Testing
Ensure the reliability of new code by writing comprehensive tests.
- **Regression Tests**: For any additions to the `base` module, add corresponding regression tests using `pytest`.
- **Test Files**: Save test files in the `tests` folder with the `test_*.py` naming convention.
- **Example Test**:
```python
import json
import pytest
import project.baseplate_KDS41_30_2022.baseplate_KDS41_30_2022_calc
def test_baseplate_KDS41_30_2022_calc():
input = {
'B' : 240, 'H' : 240, 'Fc' : 24, 'Fy' : 400,
'Ec' : 25811.006260943130, 'Es' : 210000,
'bolt' : [
{ 'X' : 90, 'Y' : 0, 'Area' : 314.15926535897933 },
{ 'X' : -90, 'Y' : 0, 'Area' : 314.15926535897933 } ],
'P' : -3349.9999999999964, 'Mx' : 0, 'My' : 51009999.999999985
}
JsonData = json.dumps(input)
result = project.baseplate_KDS41_30_2022.baseplate_KDS41_30_2022_calc.calc_ground_pressure(JsonData)
assert pytest.approx(result['bolt'][0]['Load']) == 0.0
assert pytest.approx(result['bolt'][1]['Load']) == -269182.84245616524
```
### Summary
- **Coding Conventions**: Follow the Google Python Style Guide and use `flake8` for enforcement.
- **Documentation**: Write and maintain proper docstrings for all functions.
- **Testing**: Develop test cases for new functions to enable regression testing.
By adhering to these rules and conventions, we can ensure our codebase remains high-quality, consistent, and reliable.
Raw data
{
"_id": null,
"home_page": "https://github.com/MIDASIT-Co-Ltd/engineers-api-python",
"name": "mapieng",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "bschoi",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/b9/13/d7fcb08384ae2aa689b2ec6e25d8e95507eec354a8f1a78ef8545c8eaaa0/mapieng-0.2.5.tar.gz",
"platform": null,
"description": "\r\n\r\n\r\n[](https://www.python.org/)\r\n\r\n## Midas API: Revolutionizing Engineering \ud83d\ude80\r\nWelcome to the future of engineering with Midas API! \ud83c\udf1f This cutting-edge repository is designed to transcend traditional engineering methodologies. A goldmine of innovation, Midas API eagerly awaits your contributions. Let's push the boundaries of possibility together! \ud83d\ude0a\r\n\r\n## Table of Contents\r\n- [Introduction](#introduction)\r\n- [Getting Started](#getting-started)\r\n- [Coding Conventions](#coding-conventions)\r\n- [Rules](#rules)\r\n- [Usage](#usage)\r\n- [Contributing](#contributing)\r\n- [License](#license)\r\n- [Contact](#contact)\r\n\r\n## Introduction\r\nMidas API is a state-of-the-art tool designed to revolutionize the field of engineering. By providing robust, scalable, and efficient solutions, Midas API empowers engineers to tackle complex challenges with ease. Whether you're a seasoned professional or a newcomer, Midas API is here to support your engineering journey.\r\n\r\n## Getting Started\r\n### Prerequisites\r\n1. **Install VSCode**: Download and install Visual Studio Code from the [official Visual Studio Code website](https://code.visualstudio.com/download).\r\n2. **Install Python**: Download and install Python 3.12.1 from the [official Python website](https://www.python.org/downloads/release/python-3121/). Ensure Python is added to your PATH during installation.\r\n3. **Install Pipenv**: Use pip to install Pipenv, a tool that helps manage dependencies.\r\n ```bash\r\n pip install pipenv\r\n ```\r\n - Documentation: [Pipenv: Python Dev Workflow for Humans](https://pipenv.pypa.io/en/latest/)\r\n4. **Install Project Dependencies**: Navigate to your project directory and install the necessary modules using Pipenv.\r\n - For running environment:\r\n ```bash\r\n pipenv install\r\n ```\r\n - For development environment:\r\n ```bash\r\n pipenv install --dev\r\n ```\r\n5. **Prepare to Use Midas API**: Visit the [Midas API Documentation](https://midas-support.atlassian.net/wiki/spaces/MAW/overview) for more details.\r\n\r\n## Coding Conventions\r\n### Project Structure\r\n- **project/**: Develop each plugin within this folder.\r\n- **base/**: Contains shared utility functions and base modules like MidasAPI. Use this folder for any calculation base functions.\r\n- **tests/**: Contains test files for regression testing.\r\n- **rod/**: Extract JSON schema from this repository.\r\n- **docs/**: Sphinx document folder.\r\n\r\n### Style Guide\r\nAdhere to the [Google Python Style Guide](https://yosseulsin-job.github.io/styleguide/pyguide.html) for comprehensive coding conventions.\r\n\r\n- **Using Flake8**: Install `flake8` to automatically check and enforce coding conventions during development.\r\n ```bash\r\n pip install flake8\r\n ```\r\n \r\n- **Development Environment**: Configure your development environment to use `flake8`. Ensure any issues flagged by `flake8` are corrected promptly.\r\n\r\n### Documentation Guide\r\nProper documentation is key to maintainability. Ensure that all functions, especially those in the `base` module, are well-documented.\r\n\r\n- **Using autoDocstring**: Install `autoDocstring` to assist with writing docstrings. (ctrl + shift + 2)\r\n \r\n- **Docstrings**: Use Google-style docstrings. Install the necessary extensions to assist with writing docstrings.\r\n - **Example**: Data class with docstring:\r\n ```python\r\n from dataclasses import dataclass, field as dataclass_field\r\n\r\n @dataclass\r\n class Person:\r\n \"\"\"\r\n Person details.\r\n \"\"\"\r\n name: str = dataclass_field(default=\"\", metadata={\"description\": \"The person's full name.\"})\r\n age: int = dataclass_field(default=0, metadata={\"description\": \"The person's age.\"})\r\n email: str = dataclass_field(default='', metadata={\"description\": \"The person's email address.\"})\r\n ```\r\n\r\n - **Example**: Pydantic model with docstring:\r\n ```python\r\n from pydantic import BaseModel, Field\r\n from typing import List, Dict, Union\r\n\r\n class Contact(BaseModel):\r\n \"\"\"\r\n Contact details.\r\n \"\"\"\r\n phone: str = Field(default=\"\", description=\"The contact's phone number.\")\r\n address: str = Field(default='', description=\"The contact's address.\")\r\n\r\n def my_function(person: Person, contacts: List[Contact], settings: Dict[str, Union[int, str]] = {}) -> bool:\r\n \"\"\"\r\n Processes person and their contacts with given settings.\r\n\r\n Args:\r\n person: The person details.\r\n contacts: List of contact details.\r\n settings: Miscellaneous settings.\r\n\r\n Returns:\r\n bool: True if successful, False otherwise.\r\n \"\"\"\r\n return True\r\n ```\r\n\r\n### Testing\r\nEnsure the reliability of new code by writing comprehensive tests.\r\n\r\n- **Regression Tests**: For any additions to the `base` module, add corresponding regression tests using `pytest`.\r\n- **Test Files**: Save test files in the `tests` folder with the `test_*.py` naming convention.\r\n \r\n - **Example Test**:\r\n ```python\r\n import json\r\n import pytest\r\n import project.baseplate_KDS41_30_2022.baseplate_KDS41_30_2022_calc\r\n\r\n def test_baseplate_KDS41_30_2022_calc():\r\n input = { \r\n 'B' : 240, 'H' : 240, 'Fc' : 24, 'Fy' : 400, \r\n 'Ec' : 25811.006260943130, 'Es' : 210000, \r\n 'bolt' : [ \r\n { 'X' : 90, 'Y' : 0, 'Area' : 314.15926535897933 }, \r\n { 'X' : -90, 'Y' : 0, 'Area' : 314.15926535897933 } ], \r\n 'P' : -3349.9999999999964, 'Mx' : 0, 'My' : 51009999.999999985 \r\n }\r\n\r\n JsonData = json.dumps(input)\r\n result = project.baseplate_KDS41_30_2022.baseplate_KDS41_30_2022_calc.calc_ground_pressure(JsonData)\r\n \r\n assert pytest.approx(result['bolt'][0]['Load']) == 0.0\r\n assert pytest.approx(result['bolt'][1]['Load']) == -269182.84245616524\r\n ```\r\n\r\n### Summary\r\n- **Coding Conventions**: Follow the Google Python Style Guide and use `flake8` for enforcement.\r\n- **Documentation**: Write and maintain proper docstrings for all functions.\r\n- **Testing**: Develop test cases for new functions to enable regression testing.\r\n\r\nBy adhering to these rules and conventions, we can ensure our codebase remains high-quality, consistent, and reliable.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "mapi engineers",
"version": "0.2.5",
"project_urls": {
"Homepage": "https://github.com/MIDASIT-Co-Ltd/engineers-api-python"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "29632f41e284f7e8c6c77d98238e0dfc32c236b06b4b2c7e7fa6cbbcc52877fe",
"md5": "bd30274eff4c2d41e40ef1cf1234a4f2",
"sha256": "c32e6c1b50a2f4d44d5a2b1d4aa9e08a2a69dd9ba0813411df5944b4d46ecccc"
},
"downloads": -1,
"filename": "mapieng-0.2.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bd30274eff4c2d41e40ef1cf1234a4f2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 46090,
"upload_time": "2024-05-27T08:39:13",
"upload_time_iso_8601": "2024-05-27T08:39:13.125578Z",
"url": "https://files.pythonhosted.org/packages/29/63/2f41e284f7e8c6c77d98238e0dfc32c236b06b4b2c7e7fa6cbbcc52877fe/mapieng-0.2.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b913d7fcb08384ae2aa689b2ec6e25d8e95507eec354a8f1a78ef8545c8eaaa0",
"md5": "be5953a945d8da30c75336cc49eb5d5c",
"sha256": "b7349a739afab878d4b33412e400e8f385604779c8e9b9bde14dcf681f0d1cca"
},
"downloads": -1,
"filename": "mapieng-0.2.5.tar.gz",
"has_sig": false,
"md5_digest": "be5953a945d8da30c75336cc49eb5d5c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 40201,
"upload_time": "2024-05-27T08:39:21",
"upload_time_iso_8601": "2024-05-27T08:39:21.572912Z",
"url": "https://files.pythonhosted.org/packages/b9/13/d7fcb08384ae2aa689b2ec6e25d8e95507eec354a8f1a78ef8545c8eaaa0/mapieng-0.2.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-27 08:39:21",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "MIDASIT-Co-Ltd",
"github_project": "engineers-api-python",
"github_not_found": true,
"lcname": "mapieng"
}