TrueStock Connector Agent  (reference kit)
==========================================

What this is
------------
A small, self-contained agent that reads your live stock from an on-premise
accounting app (starting with Tally's XML gateway) and writes a clean file
(truestock_stock.csv) that you import into TrueStock -- so you don't have to
export by hand every time. Point it at your accounting PC, schedule it, done.

It is written in plain Python with NO external packages (uses only the standard
library), so it runs anywhere Python 3.8+ is installed.

  Accounting app  ->  TrueStock agent  ->  truestock_stock.csv  ->  Import into TrueStock

Supported today
---------------
  * Tally / TallyPrime  -- via the built-in XML gateway (Server mode, port 9000)

BUSY, Marg, Vyapar and MyBillBook use the same idea; their reference adapters are
provisioned per site -- contact us and we'll tailor this agent for them.

Requirements
------------
  1. Python 3.8 or newer on the PC that can reach your accounting software.
     - Windows: install from https://www.python.org/downloads/ (tick
       "Add Python to PATH" during install).
  2. For Tally: in TallyPrime press F1 -> Settings -> Connectivity and set
     "TallyPrime acts as: Both" or "Server" (default port 9000). Keep Tally open.

Setup
-----
  1. Copy config.example.ini to config.ini
  2. Open config.ini and set your Tally host/port and the output folder.
  3. Run it:
       - Windows: double-click run.bat   (or:  python truestock_agent.py)
       - Mac/Linux:  python3 truestock_agent.py
  4. It writes truestock_stock.csv in the output folder.
  5. In TrueStock go to  Items -> More -> Import  and upload that CSV.
     (Columns SKU, Name, Stock are matched automatically.)

Run it on a schedule (so stock stays fresh)
-------------------------------------------
  Windows (Task Scheduler):
    - Open "Task Scheduler" -> Create Basic Task
    - Trigger: Daily (or hourly) ; Action: Start a program
    - Program/script:  python
    - Add arguments:   "C:\TrueStockAgent\truestock_agent.py"
    - Start in:        C:\TrueStockAgent
  Mac/Linux (cron, every hour):
    0 * * * * cd /opt/truestock-agent && /usr/bin/python3 truestock_agent.py

Security
--------
  * The agent only READS stock data and writes a local CSV. It does not change
    anything in your accounting software.
  * Nothing leaves your network unless you choose to import the CSV into TrueStock.
  * Keep config.ini private (it holds your host/port and any API token).

Need help / want the managed agent?
-----------------------------------
  We can install and configure this for you, including BUSY/Marg/Vyapar/MyBillBook.
  Email  support@truestock.app   or   WhatsApp +91 8800567676
  Help centre: https://truestock.app/support/

(c) TrueStock - Powered by Tech Guru IT Solutions
