Skip to main content

FXiaoke CRM CLI - Sync leads from JSON/CSV files

Project description

CRM CLI

A minimal CLI that reads leads from JSON/CSV files and syncs them to FXiaoke CRM (纷享销客).

Installation

Requires UV (fast Python package manager).

# Install UV (if not already installed)
brew install uv

# Clone and sync dependencies
git clone https://github.com/thaddeus-git/crm-cli.git
cd crm-cli
uv sync

Quick Start

# Sync leads from JSON file
uv run crm sync leads.json

# Preview without creating (dry run)
uv run crm sync leads.csv --dry-run

# Assign to specific owner
uv run crm sync leads.json --owner FSUID_xxx

# Override lead pool
uv run crm sync leads.json --pool 643d87b17be47e0a000190a715

Input Format

JSON

[
  {
    "company": "Acme Corp",
    "email": "contact@acme.com",
    "phone": "+44 123 456 7890",
    "country": "GB",
    "source_id": "optional-external-id"
  }
]

CSV

company,email,phone,country,source_id
Acme Corp,contact@acme.com,+44 123 456 7890,GB,optional-external-id

Fields

Field Required Description
company Yes Company name
email No Email address
phone No Phone number (any format, cleaned automatically)
country No ISO 2-letter code (GB, DE, CN, etc.) for region/pool routing
source_id No External reference ID for logging

Configuration

Set environment variables:

export CRM_APP_ID="FSAID_xxx"
export CRM_APP_SECRET="xxx"
export CRM_PERMANENT_CODE="xxx"
export CRM_USER_MOBILE="19957895939"  # Optional, for user ID lookup

Behavior

  • Duplicates: Skip with warning, continue with remaining leads
  • Output: Stdout only - progress and summary printed to terminal
  • Region routing: Automatic based on country code
    • Europe (GB, DE, FR, etc.) → 欧洲线索公海池
    • Asia (CN, JP, KR, etc.) → 亚洲线索公海池

Development

# Run tests
uv run python -m unittest discover tests/

# Run CLI
uv run crm sync --help

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crm_cli-0.1.1.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crm_cli-0.1.1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file crm_cli-0.1.1.tar.gz.

File metadata

  • Download URL: crm_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 29.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for crm_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c3a8db2615ef169368e6de89ffa85cc599cd7943760d710f410059b1c41b4dfc
MD5 86de5f170b05b4f59828d34b1254003d
BLAKE2b-256 c683f56ee7d939032214ee829f54a8482ca4dbc87de2a86bb63f59f2d4bf4ca2

See more details on using hashes here.

File details

Details for the file crm_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: crm_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for crm_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2089a2c9271220612082ec763e49f85eb2ceb197ac1c195a115617f7e0c8b438
MD5 671ff8cc270dae4b5d0a94235d75228f
BLAKE2b-256 d831f97c1e78bac9cdc3784ced4d781f8992245d9b2ee0d1266d7d01aaf52ddb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page