pandect
Simple wrappers to load and convert common data file types
Features
Uses file extension as heuristic to determine input format
Provides metadata using pyreadstat objects when appropriate
Supports: csv, tsv, xlsx, sav, dta (unreliable), sqlite3
Loads data into pandas.DataFrame
Provides command line utilities: sav2dta, pandect
Examples
Load a data file into a pandas.DataFrame object:
>>> import pandect
>>> data, meta = pandect.load(input_file_name)
Save a pandas.DataFrame object as a data file:
>>> import pandas
>>> import pandect
>>> data = pandas.DataFrame([{'a': 1, 'b': 2}, {'a': 3, 'b': 4}])
>>> pandect.save(data=data, output='out.sav')
>>>
Save a pandas.DataFrame object as a data file with metadata:
>>> import pandas
>>> import pandect
>>> import pyreadstat
>>> data = pandas.DataFrame([{'a': 1, 'b': 2}, {'a': 3, 'b': 4}])
>>> meta = pyreadstat.metadata_container()
>>> meta.column_names_to_labels = {'a': 'A Label', 'b': 'B Label'}
>>> pandect.save(data=data, output='out.sav', meta=meta)
>>>
Convert a data file at the command line:
$ pandect input.csv output.dta
Convert sav data file to dta data file:
$ sav2dta some_file.sav
Derives output file name from input file name (here: some_file.dta)
This is a convenience utility for a common task
It is basically a special case of the pandect utility
Limitations
Loading dta files is unreliable (bug in pyreadstat, might segfault)
License
Free software: MIT license
Documentation
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
Metadata
Release files for pandect 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pandect-0.4.0.tar.gz | 28.7 kB | Without provenance | Details for pandect-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pandect-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for pandect-0.4.0-py3-none-any.whl |
Total release size: 34.8 kB
Release files / pandect-0.4.0.tar.gz
| Download URL | pandect-0.4.0.tar.gz |
|---|---|
| Size | 28.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac2a315d196edff03b174da4550b1a6ee68a820a681cb9e175704af451858561
|
|
BLAKE2b-256 checksum How to use checksums |
bf86b546b933e182fdfc01ee326fb955e4c2ce7af09736fcd803510f3a47dd04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.25.1
|
Release files / pandect-0.4.0-py3-none-any.whl
| Download URL | pandect-0.4.0-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f03e577543b22123bf4b31794ddc54d5e7074adb0ef1f5d5fd965962f3736a4
|
|
BLAKE2b-256 checksum How to use checksums |
dd7aefd8bf662a6f8b81a14c29d97f0d41249db586bd9543553d81645eb8ff34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.25.1
|
Security for pandect 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.