You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

ector

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ector

Extract from a given long text input, eCommerce products and price budget.

0.1.2
pipPyPI
Maintainers
1

ECTOR

Extract from a given long text input, eCommerce products and price budget.

DISCLAIMER

This is not an "OpenAI wrapper", it use NLP(Natural Language Processing) and tokens manipulations to 'understand the given input' then extract product key name + budget.

Therefore, this is not 100% optimized at all and was not tested on extreme edge-cases. However it's quite fast and does the job for my use case at the moment.

REQUIREMENTS

  • python3 (>=3.10)
  • scapy

HOW TO INSTALL

pip install ector

HOW TO USE

$ python
Python 3.12.9 (main, Feb  5 2025, 08:49:01) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> import asyncio
>>> from ector import extract
>>>
>>> text = "Hello, do you have some apple juice at 9 eur ? i also want bananas, but i only have 15 eur"
>>> print(json.dumps(asyncio.run(extract(text)), indent=2))
{
  "products": [
    {
      "product": "Apple juice",
      "price": 9.0,
      "currency": "eur"
    },
    {
      "product": "Bananas"
    }
  ],
  "budget": {
    "price": 15.0,
    "currency": "eur"
  }
}
>>>

AUTHOR

  • Sanix-Darker

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts