Python client for downloading data from the MoSPI Microdata Portal (https://microdata.gov.in)
Project description
MoSPI Unit Data Client
A Python client for downloading microdata from the MoSPI Microdata Portal. This package provides a convenient interface to browse and download datasets from the Government of India's National Statistical Office (NSO).
About
This package is used to download the data from the MoSPI Microdata Portal. Specifically, you can browse available datasets interactively and download them by calling the provided methods with your API key.
Installation
You can install the package directly from PyPI:
pip install mospi-unitdata
Getting an API Key
To use this package, you need an API key from the MoSPI Microdata Portal:
- Visit the MoSPI Microdata Portal.
- Create an account or sign in if you already have one.
- Verify your email address (check your inbox for a confirmation link).
- Login to your account.
- Navigate to your Profile section.
- Click on Generate API Key (or view your existing key).
Usage
To download datasets, use the getDatasets method. This method takes two mandatory parameters:
- First parameter (
folderPath): The location/folder on your computer where you want to save the downloaded data. - Second parameter (
apiKey): Your API key generated from the MicroData Portal Profile Section.
from MospiUnitdata import getDatasets
# Provide the save location and your API Key
getDatasets("path/to/save/data", "YOUR_API_KEY")
The function provides an interactive prompt to browse through the available datasets:
277:Annual Survey of Industries 2019-20
275:Annual Survey of Industries 2020-21
256:Annual Survey of Industries 2023-24
...
Total pages:13,Page:1 of 13,
Enter Survey index number(put n to Navigate to Next Page):
Type the numeric index to download the associated dataset, or n to view the next page.
Requirements
- Python 3.9+
requests>= 2.31.0
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mospi_unitdata-0.1.0.tar.gz.
File metadata
- Download URL: mospi_unitdata-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
949fa5dd5dde27d6b97966bb064e3ff91a546618c1bb6d47dc4512ef9fd630ec
|
|
| MD5 |
30f7bcd75730514401c0f8f596572c8d
|
|
| BLAKE2b-256 |
83e091e5feb4ff88d5e36900c6336f41aab6dea535e941cf5804df1c9c68c317
|
File details
Details for the file mospi_unitdata-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mospi_unitdata-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33fc8ce2b1b66e55879de2324db76d029b270030abb593339d29c6347a40bd3f
|
|
| MD5 |
4af6db3938bc208c90394ceb3d61e046
|
|
| BLAKE2b-256 |
b781d3e2397844e4bf3aa9ff89a925696fa2690b13929a58ac8370e2de702046
|