civis.io.json_to_file¶
-
civis.io.
json_to_file
(obj, name='file.json', expires_at='DEFAULT', client=None, **json_kwargs)[source]¶ Store a JSON-serializable object in a Civis File
Parameters: - obj
The object to be JSON-serialized and stored in a Civis File
- name : str, optional
The name of the Civis File
- expires_at : str, optional
The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null. If provided, this must be either None or a valid RFC3339 date/Time string.
- client :
civis.APIClient
, optional If not provided, an
civis.APIClient
object will be created from theCIVIS_API_KEY
.- **json_kwargs
Additional keyword arguments will be passed directly to
json.dump()
.
Returns: - file_id : int
The integer ID of the new Civis File object
See also