Exemple #1
0
def import_book(stream):
	"""Return dataset of given stream."""
	(format) = detect(stream)

	try:
		databook = Databook()
		format.import_book(databook, stream)
		return databook

	except AttributeError:
		return None
Exemple #2
0
def import_set(stream):
	"""Return dataset of given stream."""
	(format) = detect(stream)

	try:
		data = Dataset()
		format.import_set(data, stream)
		return data

	except AttributeError:
		return None