Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write AEI to file path #39

Open
Trimatix opened this issue Mar 24, 2024 · 0 comments
Open

write AEI to file path #39

Trimatix opened this issue Mar 24, 2024 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@Trimatix
Copy link
Owner

The AEI.write interface currently requires the use of BinaryIO. A convenience method where we only need to pass a file path string/pathlike would be very nice.

This method shouldn't return anything, since the 'output' of the method is a file on disk; the following doesn't make sense:

out = aei.write("myfile.aei")
out.close()

with aei.write("myfile.aei"):
  pass

A new method seems to make the most sense:

def writeToFile(path: Union[str, bytes, os.PathLike, format: Optional[CompressionFormat] = None, quality: Optional[CompressionQuality] = None) -> int:
  ...

The return value can be the number of bytes written. Internally, this method can just wrap AEI.write in a with BytesIO(path).

@Trimatix Trimatix added the enhancement New feature or request label Mar 24, 2024
@Trimatix Trimatix added this to the Beyond 1.0 milestone Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Todo
Development

No branches or pull requests

1 participant