@@ -592,44 +592,76 @@ def to_file(self, path: Union[Path, str]) -> "FileBento":
592592
593593 return bento
594594
595- def to_csv (self , path : Union [Path , str ]) -> None :
595+ def to_csv (
596+ self ,
597+ path : Union [Path , str ],
598+ pretty_ts : bool = True ,
599+ pretty_px : bool = True ,
600+ map_symbols : bool = True ,
601+ ) -> None :
596602 """
597603 Write the data to a file in CSV format.
598604
599605 Parameters
600606 ----------
601607 path : Path or str
602608 The file path to write to.
609+ pretty_ts : bool, default True
610+ If all timestamp columns should be converted from UNIX nanosecond
611+ `int` to `pd.Timestamp` tz-aware (UTC).
612+ pretty_px : bool, default True
613+ If all price columns should be converted from `int` to `float` at
614+ the correct scale (using the fixed precision scalar 1e-9).
615+ map_symbols : bool, default True
616+ If symbology mappings from the metadata should be used to create
617+ a 'symbol' column, mapping the product ID to its native symbol for
618+ every record.
603619
604620 Notes
605621 -----
606622 Requires all the data to be brought up into memory to then be written.
607623
608624 """
609625 self .to_df (
610- pretty_ts = False ,
611- pretty_px = False ,
612- map_symbols = False ,
626+ pretty_ts = pretty_ts ,
627+ pretty_px = pretty_px ,
628+ map_symbols = map_symbols ,
613629 ).to_csv (path )
614630
615- def to_json (self , path : Union [Path , str ]) -> None :
631+ def to_json (
632+ self ,
633+ path : Union [Path , str ],
634+ pretty_ts : bool = True ,
635+ pretty_px : bool = True ,
636+ map_symbols : bool = True ,
637+ ) -> None :
616638 """
617639 Write the data to a file in JSON format.
618640
619641 Parameters
620642 ----------
621643 path : Path or str
622644 The file path to write to.
645+ pretty_ts : bool, default True
646+ If all timestamp columns should be converted from UNIX nanosecond
647+ `int` to `pd.Timestamp` tz-aware (UTC).
648+ pretty_px : bool, default True
649+ If all price columns should be converted from `int` to `float` at
650+ the correct scale (using the fixed precision scalar 1e-9).
651+ map_symbols : bool, default True
652+ If symbology mappings from the metadata should be used to create
653+ a 'symbol' column, mapping the product ID to its native symbol for
654+ every record.
623655
624656 Notes
625657 -----
626658 Requires all the data to be brought up into memory to then be written.
627659
628660 """
629661 self .to_df (
630- pretty_ts = False ,
631- pretty_px = False ,
632- map_symbols = False ,
662+ pretty_ts = pretty_ts ,
663+ pretty_px = pretty_px ,
664+ map_symbols = map_symbols ,
633665 ).to_json (path , orient = "records" , lines = True )
634666
635667 def request_symbology (self , client : "Historical" ) -> Dict [str , Any ]:
0 commit comments