echemdb / unitpackage

A Python library to interact with a collection of frictionless datapackages
https://echemdb.github.io/unitpackage/
GNU General Public License v3.0
4 stars 3 forks source link

Simplify loading collection and entries #22

Closed DunklesArchipel closed 8 months ago

DunklesArchipel commented 1 year ago

Currently, a collection or entry can only be created from a package, which is created with collect_datapackages

from unitpackage.local import collect_datapackages
from unitpackage.collection import Collection()
db = Collection(data_packages=collect_datapackages('./files_folder'))

#or
from unitpackage.entry import Entry
entry = Entry(package=collect_datapackages('./files_folder')[0])

I think it would be more convenient if Collection would accept Packages, filenamess and a folder and Entry accepts a Package or a filename.

One would extract the package generation from collect_datapackages and add it to a method create_package within `unitpackage.local

DunklesArchipel commented 8 months ago

fixed in version 0.8.0