CLI
CLI ¶
The Trendify
CLI allows the code to be run from a commandline interface.
DataProductsFileName ¶
Defines arguments parsed from command line
add_argument
classmethod
¶
add_argument(parser: ArgumentParser)
Defines the argument parsing from command line
Source code in src/trendify/CLI.py
process_argument
staticmethod
¶
process_argument(arg: str) -> ProductGenerator
Processes input data from command line flag value
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arg
|
str
|
File name to be type-cast to string |
required |
Returns:
Type | Description |
---|---|
Callable
|
String (file name to be used for generated data products) |
Source code in src/trendify/CLI.py
FileManager
dataclass
¶
FileManager(output_dir: Path)
Determines the folder setup for trendify
directory
InputDirectories ¶
Parses the --input-directories
argument from CLI
process_argument
staticmethod
¶
Converts CLI input to list of directories over which user-specified data product generator method will be mapped.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arg
|
str
|
Directories or glob string from CLI |
required |
Returns:
Type | Description |
---|---|
List[Path]
|
List of directories over which to map the user-specified product generator |
Source code in src/trendify/CLI.py
NProcs ¶
Determines the number of processors to use in parallel for running trendify
commands
add_argument
classmethod
¶
add_argument(parser: ArgumentParser)
Defines the argument parsing from command line
Source code in src/trendify/CLI.py
process_argument
staticmethod
¶
process_argument(arg: str)
Type-casts input to int
and caps value at 5*os.cpu_count()
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arg
|
int
|
Desired number of processes |
required |
Returns;
(int): Number of processes capped to 5*os.cpu_count()
Source code in src/trendify/CLI.py
TrendifyDirectory ¶
Parses the --trendify-directory
argument from CLI
Source code in src/trendify/CLI.py
process_argument ¶
Converts CLI input to list of directories over which user-specified data product generator method will be mapped.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arg
|
str
|
Directories or glob string from CLI |
required |
Returns:
Type | Description |
---|---|
FileManager
|
List of directories over which to map the user-specified product generator |
Source code in src/trendify/CLI.py
UserMethod ¶
Defines arguments parsed from command line
add_argument
classmethod
¶
add_argument(parser: ArgumentParser)
Defines the argument parsing from command line
Source code in src/trendify/CLI.py
process_argument
staticmethod
¶
process_argument(arg: str) -> ProductGenerator
Imports python method based on user CLI input
Parameters:
Name | Type | Description | Default |
---|---|---|---|
arg
|
str
|
Method to be imported in the form |
required |
Returns:
Type | Description |
---|---|
Callable
|
User-specified method to be mapped over raw data directories. |
Source code in src/trendify/CLI.py
trendify ¶
Defines the command line interface script installed with python package.
Run the help via trendify -h
.
Source code in src/trendify/CLI.py
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 |
|