Tab Import is a Python utility to ease imports of tabular data from CSV, ODF, XLS or XLSX files.
Some formats require an external Python library:
ODF: ooolib
XLS/XLSX: xlrd
This library is meant to be used inside a Django project context.
Usage:
#!/usr/bin/env python
import tabimport
smart_file = tabimport.FileFactory(file_path)
for data_line in smart_file:
do_something_with(data_line['header'])
Import helper
To use the Django import helper in your Django project, follow the steps below.
Add ‘tabimport’ into your INSTALLED_APPS setting.
Include the urls of tabimport into your urls:
path('data-import/', include('tabimport.urls')),In any of your models for which you’d like to enable data import, set a class variable like this: support_tabimport = True.
You can then link to the tabimport utility from one of your templates by reversing a url with tabimport:
<a href="{% url 'tabimport' %}">Import utility</a>
Alternatively, your models can include a class method which will receive the imported data as a dictionary just before they are used to create a new instance. This allows you to handle special cases in imported data:
@classmethod
def prepare_import(cls, values):
return values
Metadata
Release files for TabImport 0.5.1
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 |
|---|---|---|---|---|
| TabImport-0.5.1.tar.gz | 9.0 kB | Without provenance | Details for TabImport-0.5.1.tar.gz |
Release files / TabImport-0.5.1.tar.gz
| Download URL | TabImport-0.5.1.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a3e7e1003a937e21b19881e42f2d5548bdcf81937f2dbc4d3b9e0868d20db23
|
|
BLAKE2b-256 checksum How to use checksums |
d3cc531b87b9d940e7a60add055c6e6001c433c1e8e9e993c2f602e2802c4472
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2
|
Security for TabImport 0.5.1
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.