TikTok Channel Domain layer for the Keble unified e-commerce data platform.
Project description
keble-tiktok
TikTok provider package for the Keble raw-data API. It owns FastMoss and EchoTik native clients, DTOs, channel-domain mappings, framework-free service classes, and explicit provider manifests.
FastMossServices and EchoTikServices accept data-infra contract requests
and return normalized contract models. They do not construct FastAPI routers.
keble-data-infra-api imports their manifests and owns all HTTP paths,
exception handlers, settings, and lifecycle wiring.
Install the current public provider line with
pip install "keble-tiktok>=0.5.0,<1". Version 0.5.0 requires the released
data-infra contract and keble-db>=1.9.0; provider credentials remain runtime
configuration and are never included in the distribution.
Provider-native detail models stay inside this package. Public results expose
only normalized fields; shared monetary values use keble_helpers.Money.
Production docstrings follow the split keble_data_infra_contract plus concrete
FastMossServices/EchoTikServices composition; retired monolith and
ApplicationService terminology remains only in explicitly historical records.
uv lock --check
uv run pytest -q -m "not live and not slow and not eval and not local_stack and not db_stack and not container"
uv run npx --yes pyright .
uv build
HTTP transports and environment-proxy behavior are constructor-injected.
Direct clients default to trust_env=False for deterministic library tests;
the service builders explicitly enable production environment proxies. The
runtime dependency includes HTTPX's SOCKS transport so a configured SOCKS4/5
proxy is supported rather than failing during client construction.
Durable provider cache and batches
The API may inject one ProviderOperationCache into each service builder. The
cache stores validated contract JSON in an API-owned Mongo collection keyed by
provider, operation, contract version, and the hash of the complete canonical
request. Empty successful responses use a shorter TTL. Redis owner-token leases
ensure concurrent identical misses call upstream once, then all contenders
recheck Mongo before provider I/O.
ProviderResponseCacheRepository.ensure_indexes() must run during API startup.
It creates the exact unique compound read index plus expires_at TTL index;
drop_obsolete_indexes() removes indexes whose query shapes no longer exist.
FastMoss search and EchoTik video services expose service-only aload_many_*
methods. They deduplicate exact requests, bound concurrency where no native
batch exists, and reconstruct the caller's original order. No HTTP batch route
is generated.
When the API initializes Sentry, exact cache reads, Redis lease acquisition, real provider work, and service-only batches emit nested spans. Span data is limited to stable provider/operation/outcome/count metadata; request keywords, response payloads, and credentials are never attached.
Real cache tests require isolated Mongo/Redis and use:
KEBLE_BACKEND_ENV_FILE=/path/to/keble.backend/.env \
RUN_INTEGRATION=1 RUN_REAL_DB=1 RUN_LOCAL_STACK=1 RUN_DB_STACK=1 \
uv run pytest -q -m "not live and not container"
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file keble_tiktok-0.5.0.tar.gz.
File metadata
- Download URL: keble_tiktok-0.5.0.tar.gz
- Upload date:
- Size: 378.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bcf8c08fae8ab23d4bd18ecc639c5ba9c3f8b01593cdbaae4825daae4ab40dc4
|
|
| MD5 |
565d4cdd4c576ff161c88e4af080e812
|
|
| BLAKE2b-256 |
2644a37c40bafeb59e7bc94d0c6c50ca1e2e2514fd7eaea5a5911ab3235f79f2
|
File details
Details for the file keble_tiktok-0.5.0-py3-none-any.whl.
File metadata
- Download URL: keble_tiktok-0.5.0-py3-none-any.whl
- Upload date:
- Size: 113.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43b9d293282575313afe8b208db9fc68ad78ed6438c2678a8764cc4c528eda11
|
|
| MD5 |
7480c226dda059bfc457050a4970808e
|
|
| BLAKE2b-256 |
17a220fd887d34e3c91e007843a8918b3b643c0d69df272cd1c28779d1ce5fa2
|