PySequence/
├── packages/
│ ├── pysequence-sdk/ # Core GraphQL SDK
│ ├── pysequence-api/ # FastAPI REST server
│ ├── pysequence-client/ # HTTP client for REST API
│ └── pysequence-bot/ # Telegram bot
├── docs/ # Documentation
├── Dockerfile # Multi-stage (prod, bot, dev)
├── compose.api.yaml # API server deployment
├── compose.bot.yaml # Bot deployment
├── compose.dev.yaml # Dev/test environment
├── bot-config.yaml # Bot configuration template
├── justfile # Task runner recipes
├── pyproject.toml # Root project config
└── poetry.lock
Dependency graph:
pysequence-client -> (HTTP) -> pysequence-api -> pysequence-sdk -> (GraphQL) -> Sequence.io
^
pysequence-bot -------/
# Install all dependencies (including dev)
just install
# Or manually:
poetry installThis installs all four packages in development mode for IDE support.
All tests run in Docker:
just test-unit # Unit tests
just test-integration # Integration tests (hit real API)
just test-all # All testsTest configuration:
- Tests are in
packages/*/tests/ - Integration tests are marked with
@pytest.mark.integration - Integration tests are excluded by default (need real credentials via environment variables)
- Integration tests run with
-x(stop on first failure) and 120s timeout
just fmt # Format with Blackjust release 0.3.0This recipe:
- Verifies clean working tree
- Verifies on
mainbranch - Verifies local main is up-to-date with origin
- Bumps version in all 5
pyproject.tomlfiles - Commits the version bump
- Creates a git tag
v0.3.0 - Pushes to origin (main + tag)
- CI publishes packages and Docker images
- Single SequenceClient per server -- All requests share one instance so rate limiting works correctly.
- Browser-compatible requests -- HTTP requests use curl_cffi with Chrome TLS fingerprinting.
- GraphQL queries match the webapp exactly -- Query strings, fragment names, field selections, and
__typenameinclusions must match. - Shared safeguards --
AuditLogandDailyLimitTrackerlive inpysequence_sdk.safeguardsand are used by both the API and bot. - Secrets vs config separation -- Secrets always come from env vars; non-secret bot config lives in
bot-config.yaml.
just # List all available recipes
just install # Install dependencies
just fmt # Format code with Black
just reauth # Delete cached tokens to force re-authentication
just build # Build all Docker images
just loc # Code statistics with cloc