banpagi / trading212import
Import csv files from trading 212
v0.0.3
2024-10-03 17:26 UTC
Requires
- php: >=8.3
- doctrine/collections: ^2.2
- symfony/uid: ^6.0 |7.0
- symfony/yaml: ^6.0|^7.0
Requires (Dev)
- phpstan/phpstan: ^1.12
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: ^11.0
- squizlabs/php_codesniffer: ^3.10
- symfony/console: ^6.0|^7.0
- symfony/phpunit-bridge: ^7.0
- symfony/runtime: ^6.0|^7.0
- symfony/templating: ^6.4.0
- symfony/var-dumper: ^6.0|^7.0
- thecodingmachine/phpstan-strict-rules: ^1.0
README
Make sure Composer is installed globally, as explained in the installation chapter of the Composer documentation.
Open a command console, enter your project directory and execute:
composer require banpagi/trading212import
To use, export a file from Trading212
<?php
use Banpagi\Trading212\CvsTransformer;
use Banpagi\Trading212\CsvReader;
$reader = new CsvReader($filename);
$reader->setFieldDelimiter(',');
$rows = $reader->getRows();
$worker = new CvsTransformer();
$data = $worker->process($filename, $rows);
This will give you a Collection for futher processing.