Provide package API to use programmatically #20

Open
opened 2022-12-27 07:43:54 +00:00 by Barbagus · 3 comments
Collaborator

So far this package only provides a CLI access, I suggest providing a API access (through functions importable from __init__) so this package can be used by other programs.

So far this package only provides a CLI access, I suggest providing a API access (through functions importable from `__init__`) so this package can be used by other programs.
Author
Collaborator

After fad48ff661 The muxing (FFMPEG) still prints to stdout, this should be hidden for a clean API access.

Also, errors should be exposed in __init__

After fad48ff661 The muxing (FFMPEG) still prints to `stdout`, this should be hidden for a clean API access. Also, errors should be exposed in `__init__`
Barbagus added the
enhancement
label 2022-12-30 07:54:52 +00:00
Barbagus referenced this issue from a commit 2023-01-08 19:12:36 +00:00
Barbagus referenced this issue from a commit 2023-01-09 18:48:46 +00:00
Barbagus reopened this issue 2023-01-09 18:49:59 +00:00
Author
Collaborator

The muxing (FFMPEG) still prints to stdout, this should be hidden for a clean API access.

The muxing (FFMPEG) still prints to `stdout`, this should be hidden for a clean API access.
Author
Collaborator

One could argue that in order for the API to be as flexible/useful as possible, its scope should be on the actual ArteTV business... for example: the fetch/download (and its dependency on requests) and the actual muxing could/should be externalized.

For the muxing, we could imagine the API to only provide the command line to run FFMPEG but not running it.

For the fetch/download, two strategies come to mind:

  1. Feed the function with pre-fetched data and/or path to file were downloaded data is stored.
  2. Provide callback functions to the API call so users can implement it the way they want.

While 2. provides better flexibility (in the API should ever do multiple or conditional fetches), 1. is somehow "cleaner" and less of a machinery.

Opinions ?

Note: the difference I am making between fetch and download is whether it is done in memory or on disk.

One could argue that in order for the API to be as flexible/useful as possible, its scope should be on the actual ArteTV business... for example: the fetch/download (and its dependency on `requests`) and the actual muxing could/should be externalized. For the muxing, we could imagine the API to only provide the command line to run FFMPEG but not running it. For the fetch/download, two strategies come to mind: 1. Feed the function with pre-fetched data and/or path to file were downloaded data is stored. 2. Provide callback functions to the API call so users can implement it the way they want. While 2. provides better flexibility (in the API should ever do multiple or conditional fetches), 1. is somehow "cleaner" and less of a machinery. Opinions ? Note: the difference I am making between fetch and download is whether it is done in memory or on disk.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: fcode/delarte#20
No description provided.