civis.io.civis_to_file

civis.io.civis_to_file(file_id, buf, api_key=None)

Download a file from Civis.

Parameters:

file_id : int

The Civis file ID.

buf : file-like object

The file or other buffer to write the contents of the Civis file into.

api_key : str, optional

Your Civis API key. If not given, the CIVIS_API_KEY environment variable will be used.

Returns:

None

Examples

>>> file_id = 100
>>> with open("my_file.txt", "w") as f:
...    civis_to_file(file_id, f)