Extract¶
extract
¶
extract_package(package, **kwargs)
¶
Extract data from all resources in a datapackage based on their configured mode.
api
¶
email
¶
email_connection(resource, **kwargs)
¶
Connect to an e-mail server, search for the most recent e-mail matching the given criteria and save its attachments to the resource path.
extract_email(mailbox, resource, **kwargs)
¶
Extract the most recent e-mail matching a subject and save its attachments to the given resource path.
command
¶
sql
¶
extract_sql(resource, **kwargs)
¶
Run a query on a database and save the result to resource.path.
The connection is a SQLAlchemy URL read from the environment variable
DATABASE_URL. The query is query, or SELECT * FROM <table> when
table is given, or else the content of the file in query_file
(relative to the descriptor, defaults to sql/<resource name>.sql).
write_file(table, path, config)
¶
Save a PETL table to path. CSV files use encoding (defaults to utf-8)
and delimiter (defaults to ,).