NAME

App::idxdb - Import data from IDX and perform queries on them

VERSION

This document describes version 0.001 of App::idxdb (from Perl distribution App-idxdb), released on 2021-01-19.

SYNOPSIS

See the included CLI script idxdb.

DESCRIPTION

FUNCTIONS

graph_ownership

Usage:

graph_ownership(%args) -> [status, msg, payload, meta]

Show ownership of some stock(s) through time.

This function is not exported.

Arguments ('*' denotes required arguments):

  • date_end => date

  • date_start => date

  • field => str (default: "ForeignTotal")

  • stocks* => array[idx::listed_stock_code]

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (payload) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

graph_ownership_composition

Usage:

graph_ownership_composition(%args) -> [status, msg, payload, meta]

Show ownership composition of some stock through time.

This function is not exported.

Arguments ('*' denotes required arguments):

  • date_end => date

  • date_start => date

  • stock* => idx::listed_stock_code

  • subset => str (default: "foreign")

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (payload) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

legend_ownership

Usage:

legend_ownership() -> [status, msg, payload, meta]

Show ownership legend (e.g. ForeignIB = foreign bank).

This function is not exported.

No arguments.

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (payload) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

table_ownership

Usage:

table_ownership(%args) -> [status, msg, payload, meta]

Show ownership of some stock through time.

This function is not exported.

Arguments ('*' denotes required arguments):

  • date_end => date

  • date_start => date

  • fields => array[str] (default: ["LocalTotal","ForeignTotal"])

  • stock* => idx::listed_stock_code

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (payload) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

update

Usage:

update(%args) -> [status, msg, payload, meta]

Update data.

Currently this routine imports from text files in the gudangdata repository on the local filesystem. Functionality to import from server directly using Finance::SE::IDX and Finance::ID::KSEI will be added in the future.

This function is not exported.

Arguments ('*' denotes required arguments):

  • dbpath => str

    Path for SQLite database.

    If not specified, will default to ~/idxdb.db.

  • gudangdata_path* => dirname

Returns an enveloped result (an array).

First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (payload) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.

Return value: (any)

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/App-idxdb.

SOURCE

Source repository is at https://github.com/perlancar/perl-App-idxdb.

BUGS

Please report any bugs or feature requests on the bugtracker website https://github.com/perlancar/perl-App-idxdb/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SEE ALSO

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2021 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.