Metadata-Version: 2.1
Name: Ibp2py
Version: 1.0.4
Summary: SAP Data Retrieval and Processing Library for IBP
Home-page: https://github.com/pedrorastha/ibp2py
Author: Pedro Rastha
Author-email: pedrorastha@gmail.com
Keywords: SAP IBP API ODATA
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests (>=2.28.1)
Requires-Dist: pandas (>=1.5.2)

# Ibp2py - Python library for SAP IBP

This is a Python library designed to make it easier to interact with the SAP Integrated Business Planning (IBP) API.

## Installation

You can install ibpy using pip:

```bash
`pip install ibpy
```
## Usage

To use ibpy, first create an instance of the `ibpy` class using your SAP IBP username and password:

```python
from ibpy import ibpy  
username = "YOUR_IBP_USERNAME" 
password = "YOUR_IBP_PASSWORD" 
host = 'YOUR_HOST_URL' 
connection = Ibp2py(username, password, host)
```

### Extracting Master Data

Here is an example of how to extract master data:

```python
PlanningAreaID = 'SAP01' 
VersionID = "BASE" 
MasterDataTypeID = "M3LOCATION" 
PlanningAreaDescr = "Planning" 
VersionName = "Base Line" 
select = '*' 
data = connection.masterdata(MasterDataTypeID, select=select, PlanningAreaID=PlanningAreaID, VersionID=VersionID, PlanningAreaDescr=PlanningAreaDescr, VersionName=VersionName)
```

### Extracting Telemetry Data

Here is an example of how to extract telemetry data:

```python
data = connection.telemetry('PlanningView')
```
### Extracting Key Figure Data

Here is an example of how to extract key figure data:

```python
filters="(PERIODID0_TSTAMP ge datetime'2023-04-01T00:00:00' and PERIODID0_TSTAMP lt datetime'2023-07-02T00:00:00')"+ " and CONSENSUSDEMAND gt 0" 
PlanningAreaID = 'SAP01' 
MasterData = 'PRDID,CUSTID' 
KeyFigures = 'CONSENSUSDEMAND' 
data = connection.keyfigure(PlanningAreaID, MasterData, KeyFigures,filters=filters)
```
## Contact Information

For any issues or queries related to ibpy, feel free to reach out:

- Author: Pedro Rastha
- Email: [pedrorastha@gmail.com](mailto:pedrorastha@gmail.com)
- LinkedIn: [@pedrorastha](https://www.linkedin.com/in/pedrorastha)


## Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

## License

[Apache License 2.0](https://choosealicense.com/licenses/apache-2.0/)

**Note:** This library is open source and is not sponsored or supported by SAP.
