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.0.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.0-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: crm_cli-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 74506eae700150232e4466efe1a0d6ca5391da22650a7b276923ffd7f206c55d
MD5 b09138e9cb9b079ba0bd3b741c0e1759
BLAKE2b-256 4afa6b7550be2deeb968e7b483a50c8579cb9b8b903ef2a3601c6c68ccb65ede

See more details on using hashes here.

File details

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

File metadata

  • Download URL: crm_cli-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c2a092a1b80c2a13138511b56bf54703163e6947a72478066f861c6c54c4ffc3
MD5 11afdbaac11ec23074148be0cdc829fe
BLAKE2b-256 7db71fdfaa1e84d116172b60b6daa488bd309f8767867454f5a70d1b1048f940

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