Skip to main content

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


Download files

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

Source Distribution

fdc_sdk-0.0.4.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

fdc_sdk-0.0.4-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

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

Hashes for fdc_sdk-0.0.4.tar.gz
Algorithm Hash digest
SHA256 6db7d12df6215f4d795a294abaccba36b7c1923eb3b5a42fecd339a5c72b3b82
MD5 4252f363372459a0a2ed6690b595dea8
BLAKE2b-256 db4b85d835291ea5ff773a7c72ca7f7a367f8edfcc0ad8df6bbe71ab2284606f

See more details on using hashes here.

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

Hashes for fdc_sdk-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1e6b3dac3ab34aacf8fd58529ce9174c2b243391eea13a63c0b186c83f2fd3b4
MD5 9e4737781c07eba8872e7f2590654740
BLAKE2b-256 1fe45e3140643e090feb531ce0e0ffd2f8d761ce6019066fab6b348b93de6847

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