Download the PHP package nystronsolar/electric-bill-extractor without Composer

On this page you can find all versions of the php package nystronsolar/electric-bill-extractor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package electric-bill-extractor

Electric Bill Extractor

NystronSolarBadge PHPUnitBadge PHPBadge PsalmBadge SemanticReleaseBadge

Electric Bill Extractor

Logo made with Canva

Getting Started

First, instal the package with composer:

Next, extract the data from an electric bill:

How the library works?

The Extractors

Each type of bill needs to have a custom extractor. Each extractor extends the Extractor Abstract Class, which when instantiating, you need to provide the parsed content of an bill. After it, you can extract its content by using the extract() method, that it will returns a bill object or false in case of error.

List of all Extractors

Name Class Example
Extractor V2 RGE NystronSolar\ElectricBillExtractor\Extractor\ExtractorV2RGE From Official RGE Website
Extractor V3 RGE NystronSolar\ElectricBillExtractor\Extractor\ExtractorV3RGE From Official RGE Website

The Extractor Factory

NystronSolar\ElectricBillExtractor\ExtractorFactory

The Extractor Factory is a class that helps creating extractors

With the Extractor Factory, you can:

Tests

The tests for the Electric Bill Extractor are pretty!

Content

To test an File Extractor library, we need to have many files to extract and check the results. And that's because, in the Electric Bill Extractor, under the tests/Content/bills/ folder, you can find many .txt files that represents many fake bills, following the pattern for each extractor.

And to compare the results by the extractor and the actual bills, you can find .json files in tests/Content/expected/ that when the tests run, it will compare the expected (json) with the actual bills (txt)

Why not use PDF files?

In most real-cases, projects will extract the data from an PDF file. In that approach, the Electric Bill Extractor Factory will parse the PDF file into text, using the https://github.com/smalot/pdfparser.

After the parsing, the library will use the text returned from the Parser and extract all the data for the bill.

But in tests, we can skip all the parsing. And that's because we use .txt instead of .pdf

The Test Case

Since the extractor have this "strange" way to assert the classes, we built the Extractor Test Case, which is a Custom PHPUnit Test Case. This test case have an assertByContentFolder method, which you need to provide the folder name and the extractor class.

Uploading a new Test Bill

The bills under tests/Content/bills are usually real bills, but with some values changed. If you found an error with your bill and wan't to upload it to the repository, it's extremely important to change some values, such as real name, CPF, installation code, etc, since this project is Open Source, so anyone can see the bills.

You can use the command composer upload-bill to help you adding a new bill, but you still have to remove all the secrets and fill the JSON expected file.

Here you can see all the values that must have to be changed in all bills.

RGE V3

Values are named in Portuguese, in order.

RGE V2

Values are named in Portuguese, in order.


All versions of electric-bill-extractor with dependencies

PHP Build Version
Package Version
Requires smalot/pdfparser Version ^2.3
thedevick/precise-money Version ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package nystronsolar/electric-bill-extractor contains the following files

Loading the files please wait ....