Skip to main content

Utility for parsing Stata dictionary files for usage with Pandas.

Project description

statadict

pipeline Documentation Status

Small package that allows reading Stata dictionary files (usually .dct extension).

Extracted information can be used with Pandas when calling read_fwf() function.

Setup

To install package locally:

python3 -m pip install statadict --user

Or directly from repository:

make all
python3 -m pip install . --user 

Usage

Having Stata dictionary file and related fixed width field csv file without headers, you can now use Pandas to read data:

import pandas as pd
from statadict import parse_stata_dict

stata_dict = parse_stata_dict(file="dictionary-file.dct")
data = pd.read_fwf("related-fwf-file.dat", names=stata_dict.names, colspecs=stata_dict.colspecs)

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

statadict-1.1.0.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

statadict-1.1.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file statadict-1.1.0.tar.gz.

File metadata

  • Download URL: statadict-1.1.0.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0

File hashes

Hashes for statadict-1.1.0.tar.gz
Algorithm Hash digest
SHA256 6b804811b77c0acff213d5fc27484e75bb79ed492fd3a2a958ecb04b2d2592f3
MD5 530b53c9ba14b4d1909cf6376bb34b98
BLAKE2b-256 528be504b3d97916e661f4eb681047a4f921123bc3688c3930b7f9c4e162eb8b

See more details on using hashes here.

File details

Details for the file statadict-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: statadict-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0

File hashes

Hashes for statadict-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 67d739f46cc9495c200126d59259243d11bdde35eba9b57b69ac85eeb8a7578f
MD5 5ba964aa8f22855b587ebcbd82b50127
BLAKE2b-256 5103eb50a0bafb5afabcae3efb57e0fdd477ff1016dddc6953727e46b34d6637

See more details on using hashes here.

Supported by

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