Skip to main content

Binder DOI

unitpackage

A Python library to create, interact with, and store collections of frictionless Data Packages whose tabular resources carry unit-aware field metadata. Each data package pairs a CSV file with a JSON descriptor containing schema information (column names, types, units) and arbitrary nested metadata.

Key features

  • Unit-aware fields — columns carry unit metadata (e.g. V, A / m2, s) and can be rescaled to compatible units.
  • Collections — load, filter, slice, and iterate over sets of data packages from local directories or remote sources.
  • Metadata access — nested metadata is accessible via attribute-style or dict-style access.
  • Plotting — built-in 2D plotting with plotly.
  • Domain extensions — subclass Collection and Entry for domain-specific features (e.g. electrochemistry via Echemdb).

Quick example

>>> from unitpackage.collection import Collection
>>> db = Collection.from_local('./doc/files')
>>> entry = db['demo_package_cv']
>>> entry.echemdb.description
'Sample data for the unitpackage module'

Access field units and rescale data:

>>> entry.field_unit('j')
'A / m2'
>>> entry.rescale({'E' : 'mV', 'j' : 'uA / m2'}).df
          t           E             j
0  0.000000 -196.961730  43008.842162
1  0.011368 -196.393321  51408.199892
...

Plot directly from an entry:

>>> entry.plot()

Rescale an entire collection at once:

>>> rescaled = db.rescale({'E': 'mV', 'j': 'uA / m2'})
>>> rescaled[0].field_unit('E')
'mV'

Detailed usage examples, including local collection creation and metadata handling, are provided in the documentation.

Installation

This package is available on PyPI and can be installed with pip:

pip install unitpackage

The package is also available on conda-forge and can be installed with conda

conda install -c conda-forge unitpackage

Please consult our documentation for more detailed installation instructions.

License

The contents of this repository are licensed under the GNU General Public License v3.0 or, at your option, any later version.

Release files for unitpackage 0.13.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unitpackage 0.13.4
File Size Uploaded
unitpackage-0.13.4.tar.gz 64.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for unitpackage 0.13.4
File Interpreter ABI Platform
unitpackage-0.13.4-py3-none-any.whl Python 3 none any Details

Total release size: 139.7 kB

Release files / unitpackage-0.13.4.tar.gz

Download URL unitpackage-0.13.4.tar.gz
Size 64.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d786d131aff92d8d42bdf79984c093ec1cccc20f3e840206f40cb874f0364d66
BLAKE2b-256 checksum
How to use checksums
b76a21399048514389451d573165ffd7797c4919186913da3d8893c592c7b3bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / unitpackage-0.13.4-py3-none-any.whl

Download URL unitpackage-0.13.4-py3-none-any.whl
Size 75.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e91e410c8741cad16247d261ddbf774be1ee303134dcbf68fca110aab458351b
BLAKE2b-256 checksum
How to use checksums
d1a49bb9ec6ee97fa2a543fd8dd61ae6ba3dee0fc6dec1b55210c2641cef0448
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.13.4 This release

2 release files

0.13.2

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.12.0

2 release files

0.11.2

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.1

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page