Skip to content

Commit fdc934c

Browse files
move more things
1 parent 760e154 commit fdc934c

275 files changed

Lines changed: 1547 additions & 1533 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bin/MindeeCLICommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
use Mindee\Input\PageOptions;
88
use Mindee\Input\PathInput;
99
use Mindee\Input\URLInputSource;
10-
use Mindee\Parsing\Common\AsyncPredictResponse;
11-
use Mindee\Parsing\Common\PredictResponse;
1210
use Mindee\V1\Client;
1311
use Mindee\V1\ClientOptions\PredictMethodOptions;
1412
use Mindee\V1\ClientOptions\PredictOptions;
13+
use Mindee\V1\Parsing\Common\AsyncPredictResponse;
14+
use Mindee\V1\Parsing\Common\PredictResponse;
1515
use Symfony\Component\Console\Command\Command;
1616
use Symfony\Component\Console\Input\InputArgument;
1717
use Symfony\Component\Console\Input\InputInterface;

bin/MindeeCLIDocuments.php

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,157 +16,157 @@ public static function getSpecs(): array
1616
return [
1717
"generated" => new DocumentCommandConfig(
1818
"Custom document type from docTI",
19-
\Mindee\Product\Generated\GeneratedV1::class,
19+
\Mindee\V1\Product\Generated\GeneratedV1::class,
2020
false,
2121
true
2222
),
2323
"barcode-reader" => new DocumentCommandConfig(
2424
"Barcode Reader",
25-
\Mindee\Product\BarcodeReader\BarcodeReaderV1::class,
25+
\Mindee\V1\Product\BarcodeReader\BarcodeReaderV1::class,
2626
true,
2727
false
2828
),
2929
"bill-of-lading" => new DocumentCommandConfig(
3030
"Bill of Lading",
31-
\Mindee\Product\BillOfLading\BillOfLadingV1::class,
31+
\Mindee\V1\Product\BillOfLading\BillOfLadingV1::class,
3232
false,
3333
true
3434
),
3535
"business-card" => new DocumentCommandConfig(
3636
"Business Card",
37-
\Mindee\Product\BusinessCard\BusinessCardV1::class,
37+
\Mindee\V1\Product\BusinessCard\BusinessCardV1::class,
3838
false,
3939
true
4040
),
4141
"cropper" => new DocumentCommandConfig(
4242
"Cropper",
43-
\Mindee\Product\Cropper\CropperV1::class,
43+
\Mindee\V1\Product\Cropper\CropperV1::class,
4444
true,
4545
false
4646
),
4747
"delivery-note" => new DocumentCommandConfig(
4848
"Delivery note",
49-
\Mindee\Product\DeliveryNote\DeliveryNoteV1::class,
49+
\Mindee\V1\Product\DeliveryNote\DeliveryNoteV1::class,
5050
false,
5151
true
5252
),
5353
"driver-license" => new DocumentCommandConfig(
5454
"Driver License",
55-
\Mindee\Product\DriverLicense\DriverLicenseV1::class,
55+
\Mindee\V1\Product\DriverLicense\DriverLicenseV1::class,
5656
false,
5757
true
5858
),
5959
"financial-document" => new DocumentCommandConfig(
6060
"Financial Document",
61-
\Mindee\Product\FinancialDocument\FinancialDocumentV1::class,
61+
\Mindee\V1\Product\FinancialDocument\FinancialDocumentV1::class,
6262
true,
6363
true
6464
),
6565
"fr-bank-account-details" => new DocumentCommandConfig(
6666
"FR Bank Account Details",
67-
\Mindee\Product\Fr\BankAccountDetails\BankAccountDetailsV2::class,
67+
\Mindee\V1\Product\Fr\BankAccountDetails\BankAccountDetailsV2::class,
6868
true,
6969
false
7070
),
7171
"fr-carte-grise" => new DocumentCommandConfig(
7272
"FR Carte Grise",
73-
\Mindee\Product\Fr\CarteGrise\CarteGriseV1::class,
73+
\Mindee\V1\Product\Fr\CarteGrise\CarteGriseV1::class,
7474
true,
7575
false
7676
),
7777
"fr-energy-bill" => new DocumentCommandConfig(
7878
"FR Energy Bill",
79-
\Mindee\Product\Fr\EnergyBill\EnergyBillV1::class,
79+
\Mindee\V1\Product\Fr\EnergyBill\EnergyBillV1::class,
8080
false,
8181
true
8282
),
8383
"fr-health-card" => new DocumentCommandConfig(
8484
"FR Health Card",
85-
\Mindee\Product\Fr\HealthCard\HealthCardV1::class,
85+
\Mindee\V1\Product\Fr\HealthCard\HealthCardV1::class,
8686
false,
8787
true
8888
),
8989
"fr-carte-nationale-d-identite" => new DocumentCommandConfig(
9090
"FR Carte Nationale d'Identité",
91-
\Mindee\Product\Fr\IdCard\IdCardV2::class,
91+
\Mindee\V1\Product\Fr\IdCard\IdCardV2::class,
9292
true,
9393
false
9494
),
9595
"fr-payslip" => new DocumentCommandConfig(
9696
"FR Payslip",
97-
\Mindee\Product\Fr\Payslip\PayslipV3::class,
97+
\Mindee\V1\Product\Fr\Payslip\PayslipV3::class,
9898
false,
9999
true
100100
),
101101
"ind-passport-india" => new DocumentCommandConfig(
102102
"IND Passport - India",
103-
\Mindee\Product\Ind\IndianPassport\IndianPassportV1::class,
103+
\Mindee\V1\Product\Ind\IndianPassport\IndianPassportV1::class,
104104
false,
105105
true
106106
),
107107
"international-id" => new DocumentCommandConfig(
108108
"International ID",
109-
\Mindee\Product\InternationalId\InternationalIdV2::class,
109+
\Mindee\V1\Product\InternationalId\InternationalIdV2::class,
110110
false,
111111
true
112112
),
113113
"invoice" => new DocumentCommandConfig(
114114
"Invoice",
115-
\Mindee\Product\Invoice\InvoiceV4::class,
115+
\Mindee\V1\Product\Invoice\InvoiceV4::class,
116116
true,
117117
true
118118
),
119119
"invoice-splitter" => new DocumentCommandConfig(
120120
"Invoice Splitter",
121-
\Mindee\Product\InvoiceSplitter\InvoiceSplitterV1::class,
121+
\Mindee\V1\Product\InvoiceSplitter\InvoiceSplitterV1::class,
122122
false,
123123
true
124124
),
125125
"multi-receipts-detector" => new DocumentCommandConfig(
126126
"Multi Receipts Detector",
127-
\Mindee\Product\MultiReceiptsDetector\MultiReceiptsDetectorV1::class,
127+
\Mindee\V1\Product\MultiReceiptsDetector\MultiReceiptsDetectorV1::class,
128128
true,
129129
false
130130
),
131131
"nutrition-facts-label" => new DocumentCommandConfig(
132132
"Nutrition Facts Label",
133-
\Mindee\Product\NutritionFactsLabel\NutritionFactsLabelV1::class,
133+
\Mindee\V1\Product\NutritionFactsLabel\NutritionFactsLabelV1::class,
134134
false,
135135
true
136136
),
137137
"passport" => new DocumentCommandConfig(
138138
"Passport",
139-
\Mindee\Product\Passport\PassportV1::class,
139+
\Mindee\V1\Product\Passport\PassportV1::class,
140140
true,
141141
false
142142
),
143143
"receipt" => new DocumentCommandConfig(
144144
"Receipt",
145-
\Mindee\Product\Receipt\ReceiptV5::class,
145+
\Mindee\V1\Product\Receipt\ReceiptV5::class,
146146
true,
147147
true
148148
),
149149
"resume" => new DocumentCommandConfig(
150150
"Resume",
151-
\Mindee\Product\Resume\ResumeV1::class,
151+
\Mindee\V1\Product\Resume\ResumeV1::class,
152152
false,
153153
true
154154
),
155155
"us-bank-check" => new DocumentCommandConfig(
156156
"US Bank Check",
157-
\Mindee\Product\Us\BankCheck\BankCheckV1::class,
157+
\Mindee\V1\Product\Us\BankCheck\BankCheckV1::class,
158158
true,
159159
false
160160
),
161161
"us-healthcare-card" => new DocumentCommandConfig(
162162
"US Healthcare Card",
163-
\Mindee\Product\Us\HealthcareCard\HealthcareCardV1::class,
163+
\Mindee\V1\Product\Us\HealthcareCard\HealthcareCardV1::class,
164164
false,
165165
true
166166
),
167167
"us-us-mail" => new DocumentCommandConfig(
168168
"US US Mail",
169-
\Mindee\Product\Us\UsMail\UsMailV3::class,
169+
\Mindee\V1\Product\Us\UsMail\UsMailV3::class,
170170
false,
171171
true
172172
),

examples/InvoiceSplitterAutoExtractionExample.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
use Mindee\Extraction\PdfExtractor;
3+
use Mindee\Extraction\PDFExtractor;
44
use Mindee\Input\PathInput;
5-
use Mindee\Product\Invoice\InvoiceV4;
6-
use Mindee\Product\InvoiceSplitter\InvoiceSplitterV1;
75
use Mindee\V1\Client;
6+
use Mindee\V1\Product\Invoice\InvoiceV4;
7+
use Mindee\V1\Product\InvoiceSplitter\InvoiceSplitterV1;
88

99
function parseInvoice(string $filePath, Client $mindeeClient)
1010
{
@@ -26,7 +26,7 @@ function parseSinglePage(PathInput $inputSource, Client $mindeeClient)
2626
function parseMultiPage(PathInput $inputSource, Client $mindeeClient)
2727
{
2828
global $mindeeClient;
29-
$pdfExtractor = new PdfExtractor($inputSource);
29+
$pdfExtractor = new PDFExtractor($inputSource);
3030
$invoiceSplitterResponse = $mindeeClient->enqueueAndParse(
3131
InvoiceSplitterV1::class,
3232
$inputSource

examples/MultiReceiptsAutoExtractionExample.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

33
use Mindee\Input\PathInput;
4-
use Mindee\Product\MultiReceiptsDetector\MultiReceiptsDetectorV1;
5-
use Mindee\Product\Receipt\ReceiptV5;
64
use Mindee\V1\Client;
75
use Mindee\V1\Image\ImageExtractor;
6+
use Mindee\V1\Product\MultiReceiptsDetector\MultiReceiptsDetectorV1;
7+
use Mindee\V1\Product\Receipt\ReceiptV5;
88

99
$mindeeClient = new Client("my-api-key-here");
1010
// $mindeeClient = new Client(); // Optionally, use an environment variable.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Mindee\Parsing;
3+
namespace Mindee\Dependency;
44

55
use Exception;
66
use Mindee\Error\ErrorCode;

src/Extraction/ExtractedImage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace Mindee\Extraction;
44

5+
use Mindee\Dependency\DependencyChecker;
56
use Mindee\Error\MindeeUnhandledException;
67
use Mindee\Input\BytesInput;
7-
use Mindee\Parsing\DependencyChecker;
88

99
/**
1010
* An extracted sub-image.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22

33
namespace Mindee\Extraction;
44

5+
use Mindee\Dependency\DependencyChecker;
56
use Mindee\Error\ErrorCode;
67
use Mindee\Error\MindeePDFException;
78
use Mindee\Error\MindeeUnhandledException;
89
use Mindee\Input\BytesInput;
9-
use Mindee\Parsing\DependencyChecker;
1010
use setasign\Fpdi\Fpdi;
1111
use setasign\Fpdi\PdfParser\PdfParserException;
1212

1313
/**
1414
* An extracted sub-Pdf.
1515
*/
16-
class ExtractedPdf
16+
class ExtractedPDF
1717
{
1818
/**
1919
* @var string name of the original file
@@ -99,7 +99,7 @@ public function asInputSource(): BytesInput
9999
/**
100100
* @return string the pdf bytes
101101
*/
102-
public function getPdfBytes(): string
102+
public function getPDFBytes(): string
103103
{
104104
return $this->pdfBytes;
105105
}

src/Extraction/ImageExtractor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Mindee\Extraction;
44

5+
use Mindee\Dependency\DependencyChecker;
56
use Mindee\Error\ErrorCode;
67
use Mindee\Error\MindeeGeometryException;
78
use Mindee\Error\MindeeImageException;
@@ -10,8 +11,7 @@
1011
use Mindee\Geometry\BBoxUtils;
1112
use Mindee\Geometry\Polygon;
1213
use Mindee\Input\LocalInputSource;
13-
use Mindee\Parsing\DependencyChecker;
14-
use Mindee\Parsing\Standard\BaseField;
14+
use Mindee\V1\Parsing\Standard\BaseField;
1515

1616
/**
1717
* Extract sub-images from an image.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace Mindee\Extraction;
44

5+
use Mindee\Dependency\DependencyChecker;
56
use Mindee\Error\MindeePDFException;
67
use Mindee\Input\LocalInputSource;
7-
use Mindee\Parsing\DependencyChecker;
8-
use Mindee\Product\InvoiceSplitter\InvoiceSplitterV1InvoicePageGroups;
8+
use Mindee\V1\Product\InvoiceSplitter\InvoiceSplitterV1InvoicePageGroups;
99
use setasign\Fpdi\Fpdi;
1010
use setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException;
1111
use setasign\Fpdi\PdfParser\Filter\FilterException;
@@ -15,7 +15,7 @@
1515
/**
1616
* PDF extraction class.
1717
*/
18-
class PdfExtractor
18+
class PDFExtractor
1919
{
2020
/**
2121
* @var string bytes representation of a file
@@ -79,7 +79,7 @@ public function getPageCount(): int
7979
*
8080
* @param array|InvoiceSplitterV1InvoicePageGroups $pageIndexes List of sub-lists of pages to keep.
8181
*
82-
* @return ExtractedPdf[] list of extracted documents
82+
* @return ExtractedPDF[] list of extracted documents
8383
*
8484
* @throws MindeePDFException Throws if FDPF/FPDI wasn't able to handle the pdf during the extraction.
8585
* @throws \InvalidArgumentException Throws if invalid indexes are provided.
@@ -123,7 +123,7 @@ public function extractSubDocuments(mixed $pageIndexes): array
123123
) {
124124
throw new MindeePDFException("PDF file couldn't be processed during extraction.", 0, $e);
125125
}
126-
$extractedPdfs[] = new ExtractedPdf($mergedPdfBytes, $fieldFilename);
126+
$extractedPdfs[] = new ExtractedPDF($mergedPdfBytes, $fieldFilename);
127127
}
128128

129129
return $extractedPdfs;
@@ -135,7 +135,7 @@ public function extractSubDocuments(mixed $pageIndexes): array
135135
* @param array|InvoiceSplitterV1InvoicePageGroups $pageIndexes List of sub-lists of pages to keep.
136136
* @param boolean $strict Whether to trust confidence scores or not.
137137
*
138-
* @return ExtractedPdf[] a list of extracted invoices
138+
* @return ExtractedPDF[] a list of extracted invoices
139139
*/
140140
public function extractInvoices(mixed $pageIndexes, bool $strict = false): array
141141
{

src/Image/ImageCompressor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace Mindee\Image;
44

5+
use Mindee\Dependency\DependencyChecker;
6+
use Mindee\Error\ErrorCode;
57
use Mindee\Error\MindeeImageException;
68
use Mindee\Error\MindeeUnhandledException;
7-
use Mindee\Parsing\DependencyChecker;
8-
use Mindee\Error\ErrorCode;
99

1010
/**
1111
* Image compressor class to handle image compression.

0 commit comments

Comments
 (0)