# Primavera EPPM Web Services programming
Primavera allows to use REST API.
---
### Plans to implement:
#### CRUD operations:
- [x] Read objects
- [x] Create objects
- [x] Update objects
- [x] Delete object
#### Import/Export
- [x] Activities
- [x] Activity Codes
- [x] Activity Code Assignments
- [x] Resources
- [x] Resource Assignments
- [x] WBS
- [ ] Relationships
- [ ] Risks
- [x] Role
---
### System requirements:
- Primavera EPPM v22
- Access to P6WebServices
---
RestAPI documentation: [REST API Documentation](https://docs.oracle.com/cd/F37125_01/English/Integration_Documentation/rest_api/D100079.html)
---
### How to use:
1. Create Python virtual enviroment
```
python -m venv venv
```
2. Install the package
```
pip install Primavera-REST-Api
```
3. Example code
```
from Primavera_REST_Api import Primavera
EPPM_LOGIN = "testuser"
EPPM_PASSWORD = "testuser1903"
EPPM_DATABASE = "EPPM"
EPPM_PREFIX = "http://10.1.10.203:8206/p6ws/restapi"
PROJECT_SHORT_CODE = "testproj"
EXPORT_TABLES_TO_CSV = True # Export Tables to CSV file
app = Primavera(rest_api_prefix=EPPM_PREFIX,
database_name=EPPM_DATABASE,
login=EPPM_LOGIN,
password=EPPM_PASSWORD)
app.select_project(projectId=PROJECT_SHORT_CODE)
if EXPORT_TABLES_TO_CSV:
# Export tables to CSV files
directory = 'csv'
app.project.export_to_CSV(directory=directory, fields=['Id', 'Name'])
app.wbs.export_to_CSV(fields=['ParentObjectId', 'ObjectId', 'Name', 'Code'], directory=directory)
app.activity.export_to_CSV(fields=['ObjectId', 'Id', 'Name', 'PlannedDuration',
'StartDate', 'FinishDate', 'ActualDuration'], directory=directory)
app.resource.export_to_CSV(fields=['ObjectId', 'Id', 'Name'], directory=directory)
app.resourceAssignment.export_to_CSV(
fields=['ActivityObjectId', 'ResourceObjectId', 'PlannedUnits', 'ActivityId', 'ResourceId'], directory=directory)
app.resourceRole.export_to_CSV(directory=directory)
app.role.export_to_CSV(directory=directory)
# app.activity.import_CSV_to_EPPM(directory='csv', filename='import - activity.csv', delimiter=',')
```
Raw data
{
"_id": null,
"home_page": "https://github.com/EnverMT/Primavera_REST_API",
"name": "Primavera-REST-Api",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "primavera,rest,api",
"author": "EnverMT",
"author_email": "anvarmtg@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/86/be/2f7c186989be6a576d325c6cf4647a990d6a4cea102fcb06baff13a9b9b9/Primavera_REST_Api-0.1.0.tar.gz",
"platform": null,
"description": "# Primavera EPPM Web Services programming\n\nPrimavera allows to use REST API. \n---\n\n### Plans to implement:\n#### CRUD operations:\n- [x] Read objects\n- [x] Create objects\n- [x] Update objects\n- [x] Delete object\n\n#### Import/Export\n- [x] Activities\n- [x] Activity Codes\n- [x] Activity Code Assignments\n- [x] Resources\n- [x] Resource Assignments\n- [x] WBS\n- [ ] Relationships\n- [ ] Risks\n- [x] Role\n\n---\n\n### System requirements:\n- Primavera EPPM v22\n- Access to P6WebServices\n\n---\n\nRestAPI documentation: [REST API Documentation](https://docs.oracle.com/cd/F37125_01/English/Integration_Documentation/rest_api/D100079.html)\n\n---\n\n### How to use:\n1. Create Python virtual enviroment\n```\npython -m venv venv\n```\n2. Install the package \n```\npip install Primavera-REST-Api\n```\n3. Example code\n```\nfrom Primavera_REST_Api import Primavera\n\nEPPM_LOGIN = \"testuser\"\nEPPM_PASSWORD = \"testuser1903\"\nEPPM_DATABASE = \"EPPM\"\nEPPM_PREFIX = \"http://10.1.10.203:8206/p6ws/restapi\"\n\n\nPROJECT_SHORT_CODE = \"testproj\"\nEXPORT_TABLES_TO_CSV = True # Export Tables to CSV file\n\n\napp = Primavera(rest_api_prefix=EPPM_PREFIX,\n database_name=EPPM_DATABASE,\n login=EPPM_LOGIN,\n password=EPPM_PASSWORD)\n\n\napp.select_project(projectId=PROJECT_SHORT_CODE)\n\nif EXPORT_TABLES_TO_CSV:\n # Export tables to CSV files\n directory = 'csv'\n\n app.project.export_to_CSV(directory=directory, fields=['Id', 'Name'])\n app.wbs.export_to_CSV(fields=['ParentObjectId', 'ObjectId', 'Name', 'Code'], directory=directory)\n app.activity.export_to_CSV(fields=['ObjectId', 'Id', 'Name', 'PlannedDuration',\n 'StartDate', 'FinishDate', 'ActualDuration'], directory=directory)\n app.resource.export_to_CSV(fields=['ObjectId', 'Id', 'Name'], directory=directory)\n app.resourceAssignment.export_to_CSV(\n fields=['ActivityObjectId', 'ResourceObjectId', 'PlannedUnits', 'ActivityId', 'ResourceId'], directory=directory)\n app.resourceRole.export_to_CSV(directory=directory)\n app.role.export_to_CSV(directory=directory)\n\n# app.activity.import_CSV_to_EPPM(directory='csv', filename='import - activity.csv', delimiter=',')\n\n\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Primavera EPPM REST API client",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/EnverMT/Primavera_REST_API"
},
"split_keywords": [
"primavera",
"rest",
"api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "dd14f6998270993c59f2b5e0ed31652c0bf856b90f5d3262dbb4017bc8e57eba",
"md5": "3bdee21686dc07c52f7a9933540015e7",
"sha256": "5410c89bea60ac1979d156a252ecaba4d83fa835c1a64e2ce9b5e9b8a7249b2e"
},
"downloads": -1,
"filename": "Primavera_REST_Api-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3bdee21686dc07c52f7a9933540015e7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 7114,
"upload_time": "2023-08-08T11:28:01",
"upload_time_iso_8601": "2023-08-08T11:28:01.894398Z",
"url": "https://files.pythonhosted.org/packages/dd/14/f6998270993c59f2b5e0ed31652c0bf856b90f5d3262dbb4017bc8e57eba/Primavera_REST_Api-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "86be2f7c186989be6a576d325c6cf4647a990d6a4cea102fcb06baff13a9b9b9",
"md5": "fff58a718685db9ea5958ca141e57089",
"sha256": "1a1eb4f7074afc1403e22556f306de269b2eef8b1d2a46ff0fab35560976d001"
},
"downloads": -1,
"filename": "Primavera_REST_Api-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "fff58a718685db9ea5958ca141e57089",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5754,
"upload_time": "2023-08-08T11:28:03",
"upload_time_iso_8601": "2023-08-08T11:28:03.253243Z",
"url": "https://files.pythonhosted.org/packages/86/be/2f7c186989be6a576d325c6cf4647a990d6a4cea102fcb06baff13a9b9b9/Primavera_REST_Api-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-08 11:28:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "EnverMT",
"github_project": "Primavera_REST_API",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "primavera-rest-api"
}