sdk for factweavers datacloud
Project description
FWSDK - FactWeavers Python SDK
FWSDK is a Python SDK that enables easy interaction with the FactWeavers platform. It supports operations like listing entities, creating silver and gold entities, deleting entities, and managing their schedules — all via Python.
📦 Installation
Install via pip (after publishing to PyPI):
pip install fdc_sdk
Or install locally for development:
pip install .
🚀 Quick Start
from fdc_sdk import FWClient
# Initialize the client
client = FWClient(
base_url="https://dev.factweavers.com",
org="1",
secret_key="your_secret_token_here"
)
# List all bronze entities
entities = client.list_all_entities(layer="bronze")
print(entities)
# Create a silver entity
client.create_silver_entity(
entity_name="Landmark_combined",
sql_query="""
SELECT a, b, c FROM Landmark_raw_nav
UNION
SELECT a, b, c FROM Landmark_raw_bc
"""
)
# Create a gold entity
client.create_gold_entity(
entity_name="Landmark_gold_summary",
sql_query="SELECT * FROM Landmark_combined WHERE region = 'US'"
)
# Delete an entity
client.delete_entity("Landmark_gold_summary")
# Disable schedule for an entity
client.disable_schedule("Landmark_combined")
📚 API Methods
FWClient(base_url, org, secret_key)
Creates a client to interact with the FactWeavers backend.
list_all_entities(layer="BRONZE", q="", sort_by="updated_at", sort_order="asc")
Fetch all entities from a specific layer. Internally fetches the total count and retrieves paginated results.
create_silver_entity(entity_name, sql_query)
Create a new silver entity by passing the entity name and SQL query.
create_gold_entity(entity_name, sql_query)
Create a new gold entity with the specified SQL logic.
delete_entity(entity_name)
Delete an existing entity using its name.
disable_schedule(entity_name)
Disable the schedule for a specific entity.
🔐 Authentication
Your secret_key must be valid and authorized for the target organization. All requests use the format:
Authorization: Bearer <secret_key>
X-Organization: <org>
🧪 Testing
Use a sample script like the following to test locally:
from fdc_sdk import FWClient
client = FWClient("https://dev.factweavers.com", "1", "your_token")
print(client.list_all_entities("bronze"))
🤝 Contributions
We welcome contributions! Please fork the repo and submit a pull request. For major changes, open an issue first to discuss what you would like to change.
📄 License
MIT License © 2025 FactWeavers
Project details
Release history Release notifications | RSS feed
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 fdc_sdk-0.0.4.tar.gz.
File metadata
- Download URL: fdc_sdk-0.0.4.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6db7d12df6215f4d795a294abaccba36b7c1923eb3b5a42fecd339a5c72b3b82
|
|
| MD5 |
4252f363372459a0a2ed6690b595dea8
|
|
| BLAKE2b-256 |
db4b85d835291ea5ff773a7c72ca7f7a367f8edfcc0ad8df6bbe71ab2284606f
|
File details
Details for the file fdc_sdk-0.0.4-py3-none-any.whl.
File metadata
- Download URL: fdc_sdk-0.0.4-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e6b3dac3ab34aacf8fd58529ce9174c2b243391eea13a63c0b186c83f2fd3b4
|
|
| MD5 |
9e4737781c07eba8872e7f2590654740
|
|
| BLAKE2b-256 |
1fe45e3140643e090feb531ce0e0ffd2f8d761ce6019066fab6b348b93de6847
|