or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

Files

docs

analysis-tools.mdcore-file-access.mddata-access.mdfile-information.mdindex.mdutilities.md

file-information.mddocs/

0

# File Information and Metadata

1

2

Functions and properties for accessing file metadata, header information, and generating various output formats. These provide detailed information about ABF file structure, recording parameters, and experimental conditions.

3

4

## Capabilities

5

6

### Header Information Access

7

8

Properties and methods for accessing and displaying comprehensive header information in various formats.

9

10

```python { .api }

11

@property

12

def headerText(self) -> str:

13

"""

14

Get header information as formatted text.

15

16

Returns:

17

Multi-line string containing detailed file header information

18

including acquisition parameters, channel settings, and protocol details

19

"""

20

21

@property

22

def headerMarkdown(self) -> str:

23

"""

24

Get header information formatted as markdown.

25

26

Returns:

27

Markdown-formatted string with header information

28

suitable for documentation or reports

29

"""

30

31

@property

32

def headerHTML(self) -> str:

33

"""

34

Get header information formatted as HTML.

35

36

Returns:

37

HTML-formatted string with header information

38

suitable for web display

39

"""

40

41

def headerLaunch(self) -> None:

42

"""

43

Launch header information in default web browser.

44

45

Creates a temporary HTML file with header information

46

and opens it in the system's default browser

47

"""

48

```

49

50

### File Identification

51

52

Properties for uniquely identifying and verifying files.

53

54

```python { .api }

55

@property

56

def fileGUID(self) -> str:

57

"""

58

File GUID (Globally Unique Identifier).

59

60

Returns:

61

String representation of the file's GUID

62

"""

63

64

@property

65

def md5(self) -> str:

66

"""

67

MD5 hash of the file.

68

69

Returns:

70

Hexadecimal string representing the file's MD5 checksum

71

Useful for verifying file integrity

72

"""

73

74

@property

75

def fileUUID(self) -> str:

76

"""

77

File UUID (Universally Unique Identifier).

78

79

Returns:

80

String representation of the file's UUID

81

"""

82

```

83

84

### File Export and Conversion

85

86

Methods for saving and converting ABF files to different formats.

87

88

```python { .api }

89

def saveABF1(self, filePath: Union[str, pathlib.Path]) -> None:

90

"""

91

Save current ABF data as ABF1 format file.

92

93

Parameters:

94

- filePath: Path where the ABF1 file should be saved

95

96

Note: Converts ABF2 files to ABF1 format for compatibility

97

with older software that requires ABF1 format

98

"""

99

100

def launchInClampFit(self) -> None:

101

"""

102

Launch the current ABF file in ClampFit software.

103

104

Attempts to open the file using the system's associated

105

application for ABF files (typically ClampFit)

106

107

Raises:

108

- Exception: If ClampFit is not installed or file cannot be opened

109

"""

110

```

111

112

### Recording Metadata

113

114

Attributes providing information about the recording session and experimental conditions.

115

116

```python { .api }

117

# Recording metadata attributes

118

abfDateTime: datetime

119

"""Date and time when the recording was made."""

120

121

abfDateTimeString: str

122

"""Human-readable date/time string for the recording."""

123

124

protocol: str

125

"""Name of the acquisition protocol used."""

126

127

abfFileComment: str

128

"""User comment associated with the recording."""

129

130

creator: str

131

"""Name of the software that created the file."""

132

133

creatorVersion: str

134

"""Version of the creator software."""

135

```

136

137

### File Format Details

138

139

Additional file format and version information.

140

141

```python { .api }

142

# File format attributes

143

abfVersion: str

144

"""ABF file format version (e.g., '1.83', '2.0')."""

145

146

dataPointCount: int

147

"""Total number of data points in the file."""

148

149

dataLengthSec: float

150

"""Total recording duration in seconds."""

151

152

dataLengthMin: float

153

"""Total recording duration in minutes."""

154

```

155

156

### Usage Examples

157

158

```python

159

import pyabf

160

from datetime import datetime

161

162

# Load ABF file

163

abf = pyabf.ABF("recording.abf")

164

165

# Basic file information

166

print(f"File GUID: {abf.fileGUID}")

167

print(f"MD5 hash: {abf.md5}")

168

print(f"Recording date: {abf.abfDateTimeString}")

169

print(f"Protocol: {abf.protocol}")

170

171

# Display header information (properties, not methods)

172

header_text = abf.headerText

173

print("=== Header Information ===")

174

print(header_text)

175

176

# Launch header in browser for detailed viewing

177

abf.headerLaunch()

178

179

# Get markdown formatted header for documentation

180

markdown_header = abf.headerMarkdown

181

with open("recording_info.md", "w") as f:

182

f.write(markdown_header)

183

184

# File verification using MD5

185

file_hash = abf.md5

186

print(f"File integrity hash: {file_hash}")

187

188

# Recording metadata

189

print(f"Created by: {abf.creator} v{abf.creatorVersion}")

190

print(f"Comment: {abf.abfFileComment}")

191

print(f"Protocol: {abf.protocol}")

192

193

# File format information

194

print(f"ABF version: {abf.abfVersion}")

195

print(f"Total data points: {abf.dataPointCount}")

196

print(f"Recording duration: {abf.dataLengthSec} seconds")

197

198

# Export to ABF1 format

199

abf.saveABF1("converted_recording.abf")

200

201

# Launch in ClampFit (if installed)

202

try:

203

abf.launchInClampFit()

204

except Exception as e:

205

print(f"Could not launch ClampFit: {e}")

206

```

207

208

## String Representations

209

210

```python { .api }

211

def __str__(self) -> str:

212

"""

213

String representation of the ABF object.

214

215

Returns:

216

Human-readable string with basic file information

217

"""

218

219

def __repr__(self) -> str:

220

"""

221

Developer representation of the ABF object.

222

223

Returns:

224

String suitable for debugging and development

225

"""

226

```

227

228