Skip to main content

Python client for downloading data from the MoSPI Microdata Portal (https://microdata.gov.in)

Project description

MoSPI Unit Data Client

PyPI version License: MIT

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:

  1. Visit the MoSPI Microdata Portal.
  2. Create an account or sign in if you already have one.
  3. Verify your email address (check your inbox for a confirmation link).
  4. Login to your account.
  5. Navigate to your Profile section.
  6. Click on Generate API Key (or view your existing key).

Usage

To download datasets, use the getDatasets method. This method takes two mandatory parameters:

  1. First parameter (folderPath): The location/folder on your computer where you want to save the downloaded data.
  2. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mospi_unitdata-0.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mospi_unitdata-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

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

Hashes for mospi_unitdata-0.1.0.tar.gz
Algorithm Hash digest
SHA256 949fa5dd5dde27d6b97966bb064e3ff91a546618c1bb6d47dc4512ef9fd630ec
MD5 30f7bcd75730514401c0f8f596572c8d
BLAKE2b-256 83e091e5feb4ff88d5e36900c6336f41aab6dea535e941cf5804df1c9c68c317

See more details on using hashes here.

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

Hashes for mospi_unitdata-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33fc8ce2b1b66e55879de2324db76d029b270030abb593339d29c6347a40bd3f
MD5 4af6db3938bc208c90394ceb3d61e046
BLAKE2b-256 b781d3e2397844e4bf3aa9ff89a925696fa2690b13929a58ac8370e2de702046

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page