> For the complete documentation index, see [llms.txt](https://docs.digit.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digit.org/mgramseva/introducing-mgramseva/enablement-toolkits/setting-up-services/updating-master-rate-for-mgramseva.md).

# Updating Master Rate for Mgramseva

## Overview

This page outlines the step-by-step process for using a Python script to change master rates for mGramSeva in bulk. The script reads data from an Excel file, updates the master rates, and generates a new CSV file containing the modified information. Once the script is successfully executed, changes can be pushed to the local MDMS repository on GitHub.

## **Pre-requisites**

* Python script
* MDMS repository cloned on the local system
* Excel file with tenant names, old master rates, and new master rates

## **Steps**

**1. Prepare Excel File:**

* Ensure the Excel file contains three columns: Tenant Name (in lowercase), Old Master Rate, and New Master Rate.
* If the columns are not present, add them to the Excel file.

**2. Clone and Create Branch:**

* Clone the MDMS repository to your local system.
* Create a new branch from the branch where you intend to make changes.

**3. Update Python Script:**

* Open the Python script and locate the variables:
  * `updatedfile`: Provide the path to your Excel sheet.
  * `localFilePath`: Specify the path where your MDMS repository is cloned.
  * Identify the columns in the Excel file where the Tenant Name, Old Master Rate, and New Master Rate are stored. Update the script accordingly:

```
uniqueVillageName = row[2].value
oldMasterRate = row[7].value
newMasterRate = row[8].value
```

* Run the script.

**4. Script Execution:**

* Do not open the Excel file during script execution.
* The script will generate a new file named `new_updated_file4.csv` containing information about whether rates were updated or not.

**5. Verification:**

* Check `new_updated_file4.csv` to verify if all rates were updated successfully.

**6. Push Changes to Git:**

* If all rates are updated, the local changes will affect the MDMS repository.
* Raise a pull request and merge changes from the Git repository.

**Note:**

* It is crucial not to open the Excel file while the script is running to avoid data inconsistencies.
* Ensure that the Python environment and dependencies are properly set up.

By following the steps above, you can efficiently update master rates for mGramSeva in bulk, ensuring accurate and streamlined changes to the MDMS repository.

{% file src="/files/qZSIzKFGuV8GFF9ZaBKI" %}

{% file src="/files/5Io5R8qcVPrqOjIDMsOM" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.digit.org/mgramseva/introducing-mgramseva/enablement-toolkits/setting-up-services/updating-master-rate-for-mgramseva.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
